SUBSIM Radio Room Forums



SUBSIM: The Web's #1 resource for all submarine & naval simulations since 1997

Go Back   SUBSIM Radio Room Forums > Silent Hunter 3 - 4 - 5 > SH5 Mods Workshop
Forget password? Reset here

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Old 03-24-10, 12:10 PM   #6
gutted
The Old Man
 
Join Date: Apr 2005
Location: New Orleans, LA.
Posts: 1,379
Downloads: 487
Uploads: 11
Default

Quote:
Originally Posted by W_clear View Post
// 6. horizont haze
float hazeMask = smoothstep(1, 0, saturate(In.eyeDir.w * g_skyHazeHeight.x - g_skyHazeHeight.y)*2);
color = lerp(color, g_skyHazeColor, hazeMask);


THANKS!

It's linear interpolation. Without seeing the specifics of their implemenation, and i can only guess.

the first function call is for finding out how much the color will change, and the second call is doing the actual color interpolation.

1. smoothstep:
The first two arguements define the Max/Min of the step ( 1 & 0 would mean between full color and no color) and the last part acts as a "weight" for the "step".

2. Lerp:
Is the actual interpolation. It's changing "color" towards "g_skyHazeColor" by "hazeMask" amount... and then returning it back into the "color" variable.

So if you need to change how the interpolation is done between the sky and the fog... you'd probably want to alter the way "hazemask" gets computed. And that would be done by adjusting the weight (3rd portion) of the smoothstep function call. Probalby leave the saturation part alone and adjust the multiplier to the right of it some.

Or

If you want less overall haze color, you could probably turn it down by change the 1 in smoothstep to like 0.8 or 0.5 or something. Just fiddle with it.
__________________


Solution Solver 2.3.2 - Visual Targeting Tools & Aids

Last edited by gutted; 03-24-10 at 03:05 PM.
gutted is offline   Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 10:40 AM.


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.