Quote:
Originally Posted by Seeadler
it's all in the sky shaders (\Silent Hunter 5\data\Shaders\Sky)
and EnvColors_xxx.cfg's (\Silent Hunter 5\data\Env\)
Code:
// 1. base gradient, from top to bottom
float heightRatio = pow(In.eyeDir.w / 992.0, g_skyBottomColor.w);
color = lerp(g_skyBottomColor.rgb, g_skyTopColor.rgb, heightRatio);
Values for g_skyBottomColor and g_skyTopColor are set in EnvColors_xxx.cfg
Now in the above pixel shader code for each pixel the virtual camera eye is directed on, the color value will be calculated with a linear interpolation (x*(1-s) + y*s) between top- and bottom-color. This is done by the HLSL lerp() function.
You can now implement a different algorithm for example with smoothstep() functions which calculate a smoother intepolation based on the Hermite Interpolation instead of linear interpolation but this can cause lower framerates if alot of smoothstep's are used.
|
Using a gradient causes the sky banding .
I just deleted the bit in green and it seems much better .