Jump to content
  • Advertisement
Sign in to follow this  

nvidia atmospheric scattering

This topic is 1111 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am trying to use the algorithm explained in this nvidia page

In the vertex shader code there is a function "scale()", I don't understand what it does. 

what does it do?


There is another part where there is this...

scale(fLightAngle) ? scale(fCameraAngle))

what does the ? mean?

Share this post

Link to post
Share on other sites

found it!

I dowloaded the code form here which is in hlsl

 and it has this in scale()...

float scale(float fCos)
	float x = 1.0 - fCos;
	return ScaleDepth * exp(-0.00287 + x*(0.459 + x*(3.83 + x*(-6.80 + x*5.25))));

and for the ?... it is a minus...

scale(fLightAngle) - scale(fCameraAngle))


even better you can download any GPU gems files from here 


Edited by lomateron

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!