About Store Forum Documentation Contact



Post Reply 
Trees & Lighting
Author Message
Brainache Offline
Member

Post: #1
Trees & Lighting
Hey there... I've added some trees (using the code from the nature demo) to the day night cycle demo... the leaves are rendering correctly.. but the trunks are not fallowing the rules of lighting ( they are staying the same brightness during all hours )

I figure it has something to do with material settings - can you point me in the right direction?

Thanks!
12-04-2008 10:45 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #2
Re: Trees & Lighting
there is a chance that you're rendering them also in RM_LIGHT mode which sets all the light to the maximum of an object
12-04-2008 11:32 PM
Find all posts by this user Quote this message in a reply
Brainache Offline
Member

Post: #3
Re: Trees & Lighting
Yep looks like that was the cause...

Which led me to researching the rendering modes a bit...

Can you please confirm:

Game.world.draw should be called from both RM_SOLID and RM_SHD_MAP as well as any other object that needs to cast shadows...

Thanks
12-05-2008 03:47 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #4
Re: Trees & Lighting
Hi,

Game::World.draw() should be called with no checking of rendering mode, as the function World.draw autodetects the mode

so it should be used like this

Code:
Render()
{
  Game::World.draw(); // this is outside of  switch(Renderer())

  switch(Renderer())
  {
    your custom drawing here
  }
}
12-05-2008 04:14 PM
Find all posts by this user Quote this message in a reply
Post Reply