Jump to content

Light Calc


Rick
 Share

Recommended Posts

Is the light calculated on the current 3D world data or the buffer that the 3D world was drawn on? So for example, if I draw the world, then change the world, then draw the lights, would the lights be done on my altered world and not was draw to the buffer before I altered it?

 

I'm assuming that's how it works. I assume the rendering of the lights doesn't use the buffer as information, but just to draw to and it gets it's info from the current world geometry.

Link to comment
Share on other sites

This doesn't seem to be the case. I have the following and I still get the directional light affecting the inside of the building, which if the lighting took into consideration the world geometry and not what was drawn onto the buffer wouldn't be the case.

 

SetBuffer(buffer);

TriggerShowHide::Hide();       // This would hide the roof

RenderWorld();

SetBuffer(BackBuffer());

TriggerShowHide::ShowAll();  // this would show the roof

RenderLights(buffer);

// Send to screen
Flip(0);

 

 

Apparently this is impossible with LE *sigh*. Man, every time I get a concept for a game it gets slowed or killed by LE making it such a pain to get working. So frustrating.

Link to comment
Share on other sites

The lighting just lights what was rendered onto the buffer on

SetBuffer(buffer); RenderWorld();

, it doesn't take any changes you make to the world after rendering it into account.

 

You can easily make an object invisible yet still cast a shadow (meaning what is below won't be affted by the light making it cast a shadow), I think Josh already showed how to in your other thread.

 

The idea is to use a material that doesn't render anything with it's normal "shader", yet has a "shadowshader" that renders the object solid.

Link to comment
Share on other sites

Nothing has given the correct results so far. I tried what Josh had and it didn't seem to work. I tried some other variations and still wasn't able to get it to work. The closest I've come is getting the roof transparent but the lights I have inside the building weren't being drawn.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...