SUBSIM Radio Room Forums

SUBSIM Radio Room Forums (https://www.subsim.com/radioroom/index.php)
-   Silent Hunter 5 (https://www.subsim.com/radioroom/forumdisplay.php?f=244)
-   -   Sky comparison. SH2 vs SH5. 2001 vs 2010. (https://www.subsim.com/radioroom/showthread.php?t=166003)

AVGWarhawk 03-24-10 08:24 AM

kriller2 speaks truth! :yep:

Seeadler 03-24-10 08:47 AM

SH5 does not use any more textures for the sky, neither external or embedded textures in the DAT/GR2 files. The gradations of the sky and the colors are calculated by the Sky_Shader. The input colors come from the CFG's in /data/env. There are the colors for different regions and daytime. You have SkyTopColor and SkyBottomColor and the shader now interpolates the colors and transitions between them. To get rid of the sky gradient bandings you must define a better and smoother algorithm within the shader.

Coldcall 03-24-10 11:04 AM

Quote:

Originally Posted by Seeadler (Post 1331490)
SH5 does not use any more textures for the sky, neither external or embedded textures in the DAT/GR2 files. The gradations of the sky and the colors are calculated by the Sky_Shader. The input colors come from the CFG's in /data/env. There are the colors for different regions and daytime. You have SkyTopColor and SkyBottomColor and the shader now interpolates the colors and transitions between them. To get rid of the sky gradient bandings you must define a better and smoother algorithm within the shader.

so could some GPUs be handling that better than others? Is there a way to alter this oneself, or do we need a patch from the devs?

java`s revenge 03-24-10 11:20 AM

Sorry to say but i didn`t see it in sh3 and sh4.

I have now a nvidia 260GTX and see also the banding in the sky so maybe it`s videocard related.

Seeadler 03-24-10 11:31 AM

Quote:

Originally Posted by Coldcall (Post 1331673)
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.

Coldcall 03-24-10 11:37 AM

Quote:

Originally Posted by Seeadler (Post 1331725)
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.

Thank you veyr much, though its all a bit ove rmy head. I'll wait for someone smart like you to do a mod :-)

THE_MASK 10-29-10 11:04 PM

Quote:

Originally Posted by Seeadler (Post 1331725)
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 .

panosrxo 10-30-10 07:35 AM

Quote:

Originally Posted by sober (Post 1524952)
Using a gradient causes the sky banding . I just deleted the bit in green and it seems much better .

pow is a power function, if you are to remove the function you should also remove this part: , g_skyBottomColor.w

power function is pow(x,y)=x^y

Sailor Steve 10-30-10 10:28 AM

I see it in SH4, and not in SH3. I have no idea about anything involved with this, I'm just sayin'.

divittor 10-30-10 11:47 AM

I get the banding in sh5 didn't notice it so much in 3 and 4.

I have an i7 quad core so i guess it's not something cpu related.

My cards are 2 x NVIDIA GTX 470 in SLI althought i read somewhere SLI
does not work in game ?

4gb RAM Windows 7 64 bit

Screen is a Samsung Syncmaster P2450

My res in game is 1900x1080 i think (not got it running at moment )
and have maxed most graphics options in game.

I personally think the latest nvidia cards accenctuate the banding maybe?

TDW uses a Nvidia GTX480 do you get the banding TDW?

Which enviroment MOD available at the moment best deals with this issue?

I don't really want to mess with stock files and I'm guessing i could reduce the banding by tweaking my personal settings.

Any ideas to reduce or eliminate it would be most welcome.

the_tyrant 10-31-10 08:12 PM

the best explanation is that it is the video card
just like how games designed for nvidia cards are horrible on ati cards
Ubisoft optimizes for ATI, so that is probably why

rik007 10-31-10 11:53 PM

Quote:

Originally Posted by sober (Post 1524952)
Using a gradient causes the sky banding . I just deleted the bit in green and it seems much better .

You can adapt the shader but it will still be called 992 times by SH-5 each time a screen is drawn. You would have liked that the shader is called 1984 (2 * 992) or more but therefore you need to change the code unfortunately. :down:

THE_MASK 11-01-10 12:46 AM

I can get rid of the banding completely by deleting the gradiant but it deletes the sun as well .

Seeadler 11-01-10 08:02 AM

Quote:

Originally Posted by sober (Post 1526109)
I can get rid of the banding completely by deleting the gradiant but it deletes the sun as well .

based on the posted shader function above, set the interpolate value in the lerp() function to a constant value. That ought to repeal the individual gradients but does not affect the pixel color for the sun.

change from:
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);

to:

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, 1 /*heightRatio*/);

I can not say if it work and/or how it will look in the game, I have SH5 not installed on my PC.

THE_MASK 11-01-10 02:10 PM

How it looks in game . The pic was auto enhanced so the banding is easier seen . Doesnt look quite so bad ingame . Thanks seeadler .
http://img708.imageshack.us/img708/9718/gradl.jpg
http://img294.imageshack.us/img294/4701/gradd.jpg


All times are GMT -5. The time now is 01:31 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright © 1995- 2025 Subsim®
"Subsim" is a registered trademark, all rights reserved.