Jump to content

View more

View more

Image of the Day

Working on an auto spawn system. #gamedev #indiedev #screenshotsaturday https://t.co/Mm2kfekz7b
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

Rendering Fog in Night

4: Adsense

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.


  • You cannot reply to this topic
3 replies to this topic

#1 duskndreamz   Members   

179
Like
0Likes
Like

Posted 29 October 2012 - 02:47 AM

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.

#2 Ashaman73   Members   

13714
Like
0Likes
Like

Posted 29 October 2012 - 04:14 AM

Please suggest me some solution.

Screenshots ?

Ashaman

 

Gnoblins: Website - Facebook - Twitter - Youtube - Steam Greenlit - IndieDB - Gamedev Log


#3 Tom KQT   Members   

1704
Like
0Likes
Like

Posted 29 October 2012 - 06:47 AM

The white (day) fog is working, just the black (night) isn't?

Edited by Tom KQT, 29 October 2012 - 07:01 AM.


#4 InvalidPointer   Members   

1842
Like
0Likes
Like

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.




Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.