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.
3 replies to this topic
Sponsor:
#2 Members - Reputation: 4603
Posted 29 October 2012 - 04:14 AM
Screenshots ?Please suggest me some solution.
Ashaman
My game: Gnoblins
Developer journal about Gnoblins
Small goodies: Simple alpha transparency in deferred shader
My game: Gnoblins
Developer journal about Gnoblins
Small goodies: Simple alpha transparency in deferred shader
#4 Members - Reputation: 923
Posted 29 October 2012 - 08:18 AM
EDIT: Whoooops, thought Tom was the OP.
Edited by InvalidPointer, 29 October 2012 - 08:20 AM.
clb: At the end of 2012, the positions of jupiter, saturn, mercury, and deimos are aligned so as to cause a denormalized flush-to-zero bug when computing earth's gravitational force, slinging it to the sun.






