Jump to content
  • Advertisement
Sign in to follow this  
luke88

Fog Failure

This topic is 4814 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 can't seem to get DX8 fog to work. Apon doing this: D3DRS_FOGSTART, 10 D3DRS_FOGEND, 300 D3DRS_FOGCOLOR, D3DColorXRGB(255, 255, 255) D3DRS_FOGENABLE, 1 The screen just turns completely white, no matter what settings I choose. If I add: D3DRS_FOGTABLEMODE, 1 Then I can see my 3D scene, but no fog. How do I enable fog correctly? (Just so you know, I do not know what FOGVERTEXMODE or FOGTABLEMODE is.)

Share this post


Link to post
Share on other sites
Advertisement
What Fog formula is being used here? Exponential or linear? and can you paste the entire intialisation code for the fog and also the render code for you app.

ace

Share this post


Link to post
Share on other sites
Well, I figured out that I have to set the fog formula by using:
D3DRS_FOGTABLEMODE D3DFOG_EXP
or
D3DRS_FOGTABLEMODE D3DFOG_LINEAR
(I think I need to add D3DRS_FOGVERTEXMODE D3DFOG_EXP aswell?)
If I do this, without setting anything else (suchas FOGSTART, FOGDENSITY etc.) fog works, but it's very dense and the range is short. If I set all the parameters the fog either disappears, or remains unaffected.
What am I doing wrong? Is there a short guide anywhere that I quickly read?

(BTW, I'm pretty sure there is nothing in my rendering code that would affect the fog).

Share this post


Link to post
Share on other sites
All i can suggest is commenting out your overriding of the fog settings until it works then you can figure out what is causing the problem.

ace

Share this post


Link to post
Share on other sites
Quote:
Original post by MENTAL
change fogstart and fogend to some bigger values then...

I have tried that, but still the fog remains unaffected.

Quote:
Original post by ace_lovegrove
All i can suggest is commenting out your overriding of the fog settings until it works then you can figure out what is causing the problem.

I'm not too sure what you mean, but if you mean what I think you mean, then that's what I'm doing, but nothings changing.

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!