Sign in to follow this  

nvidia atmospheric scattering

This topic is 827 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 

http://http.download.nvidia.com/developer/GPU_Gems_2/CD/Index.html

Edited by lomateron

Share this post


Link to post
Share on other sites

This topic is 827 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this