Jump to content

  • Log In with Google      Sign In   
  • Create Account

Interested in a FREE copy of HTML5 game maker Construct 2?

We'll be giving away three Personal Edition licences in next Tuesday's GDNet Direct email newsletter!

Sign up from the right-hand sidebar on our homepage and read Tuesday's newsletter for details!


We're also offering banner ads on our site from just $5! 1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


Rendering Fog in Night


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   -  Reputation: 141

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.

Sponsor:

#2 Ashaman73   Crossbones+   -  Reputation: 7797

Like
0Likes
Like

Posted 29 October 2012 - 04:14 AM

Please suggest me some solution.

Screenshots ?

#3 Tom KQT   Members   -  Reputation: 1610

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   -  Reputation: 1439

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.



PARTNERS