• Advertisement
Sign in to follow this  

Rendering Fog in Night

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

Hi,

I am trying to render Fog in my car game, but I am unable to get a good version going for Night mode.


[source lang="cpp"]GetDirectXDevice()->SetRenderState(D3DRS_FOGENABLE,true);
GetDirectXDevice()->SetRenderState(D3DRS_RANGEFOGENABLE,true);
if( m_iTimeOfDay > 2000 || m_iTimeOfDay < 400 ) // Render Black Fog
GetDirectXDevice()->SetRenderState(D3DRS_FOGCOLOR,D3DCOLOR_XRGB(0,0,0));
else
GetDirectXDevice()->SetRenderState(D3DRS_FOGCOLOR,D3DCOLOR_XRGB(255,255,255));

GetDirectXDevice()->SetRenderState(D3DRS_FOGVERTEXMODE,D3DFOG_LINEAR);
//GetDirectXDevice()->SetRenderState(D3DRS_FOGDENSITY, *(DWORD *)(&newFogLevel));
GetDirectXDevice()->SetRenderState(D3DRS_FOGSTART,*(DWORD*)(&fFogStart));
GetDirectXDevice()->SetRenderState(D3DRS_FOGEND,*(DWORD*)(&fFogEnd));[/source]

Please suggest me some solution. I am currently not getting any fog when I switch on Night Mode.

Share this post


Link to post
Share on other sites
Advertisement
[quote name='duskndreamz' timestamp='1351500441' post='4994981']
Please suggest me some solution.
[/quote]
Screenshots ?

Share this post


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

  • Advertisement