View Single Post
Old 03-24-10, 11:31 AM   #20
Seeadler
Pacific Aces Dev Team
 
Join Date: Mar 2001
Location: Northern Germany
Posts: 1,096
Downloads: 169
Uploads: 0


Default

Quote:
Originally Posted by Coldcall View Post
Is there a way to alter this oneself, or do we need a patch from the devs?
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.
__________________
--
Vapor-ware is always easier to sell because there's no limit what it can do!
Seeadler is offline   Reply With Quote