About Store Forum Documentation Contact



Post Reply 
Make object rendered on top receive light
Author Message
Outdoordoor Offline
Member

Post: #1
Make object rendered on top receive light
I'm trying to find a way to render an object always on top of others without tinkering with the source, and I've come up with two ways to do this. First one use Renderer.combine and looks like this:
Code:
void Render()
{
   Game.World.draw();
}
void Render2()
{
   switch(Renderer())
   {
      case RM_PREPARE:
      {
         objOnTop.mesh->draw(objOnTop.matrix());
      }break;
   }
}
void Draw()
{
   Renderer(Render);
   Renderer.combine=true;
   Renderer(Render2);
   Renderer.combine=false;
}

Another way is to use this:
Code:
void Render()
{
   Game.World.draw();
   switch(Renderer())
   {  
      case RM_BLEND:
      {
         D.clearDepth();
         objOnTop.mesh->drawBlend(objOnTop.matrix());
      } break;
   }
}

However, in both cases the object on top does not interact with lights in the scene, like point lights. It only reacts to the sun.

Is there a way to fix this?
(This post was last modified: 04-22-2024 09:35 AM by Outdoordoor.)
04-22-2024 09:34 AM
Find all posts by this user Quote this message in a reply
Post Reply