Jump to content
  • Advertisement
Sign in to follow this  
Spk

Fogging and shader model 3.0

This topic is 4145 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'm currently working on an underwater scene and I'd like to add a simple bluish scene fogging to simulate the light scattering effect in the water. I'm using shader model 3.0 for all my scene. It was my understanding that the pixel fog stage was performed after the pixel shader by the card, so I thought that adding fog to my scene would be a simple matter of turning some render states on, and wouldnt require extra code to be added to my shaders. After enabling pixel fog as demonstrated in the DXSDK doc, there is no fog effect happening whatsoever. So I searched in the DXSDK doc some more and fell on this text: "If fog rendering is desired, vs_3_0 and ps_3_0 shaders must implement fog. No fog calculations are done outside of the shaders. There is no fog register in vs_3_0 and additional semantics D3DDECLUSAGE_FOG (for fog blend factor computed per vertex) and D3DDECLUSAGE_DEPTH"/> (for passing in a depth value to the pixel shader to compute the fog blend factor) have been added." So if Im reading this correctly, it means that starting from shader model 3.0, fogging must be manually implemented in the vertex/pixel shaders and there no longer is a fog stage after the pixel shader in the pipeline. Is this correct? Implementing fog manually in my shaders isnt a problem, but I'd rather use the card functionalities and save myself some troubles if i can :)

Share this post


Link to post
Share on other sites
Advertisement
This is correct. Starting from SM3.0 you have to do fogging for yourself using additional shader code.

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!