Sign in to follow this  
paic

strange behavior of the fog in FFP & with shaders

Recommended Posts

paic    645
hi, I just noticed something strange. I'm using shader model 2.0 for my heightmap. Recently, I added fog in the FFP, and I thought I would have to add the fog myself in the code of my shader. But surprisingly, when I tested it, it worked for the heightmap as well as for the other meshes that were going throught the FFP :/ So I thought "ok, i'm lucky, no need to code... strange though, I remember I had a problem with another shader ... maybe they improved their driver since the 9.0a ..." And today, I changed the shader models from 2.0 to 3.0 to test the performance, and at my big surprise, the fog didn't work anymore ! So, a long story to say : FFP fog works by itself with SM2.0 but not with 3.0 :/ That's weird, and I really don't understand, so if anyone has an explenation ... ^^ thx in advance .:: Paic Citron ::.

Share this post


Link to post
Share on other sites
I think I read that fog support was dropped from SM3, as you have more than enough power to handle fog yourself, and it will save you from bugs where each vendor handles fog differently. (See DirectX index entry "Fog, Depth, and Shading Mode Changes", paragraph 2.)

In SM 1.1 you needed to write to oFog.x (or float fogAmount:FOG) where 0 means full fog, and 1 means no fog.

I've yet to try fog mixed with SM 2.0, but I would have expected it to require you to write to a fog register.

Share this post


Link to post
Share on other sites

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