Sign in to follow this  
Medo Mex

Limiting Light

Recommended Posts

Medo Mex    891

I notice when I have light inside the building, it affect the building from outside as well

 

So If I have a light inside the building, I can notice the building outer wall is affected by the light, while in real life only the inner wall should be affected.

 

How do I resolve that?

Share this post


Link to post
Share on other sites
Matias Goldberg    9573

A third solution is to use shadow maps. However they're expensive for point lights and will probably have artifacts hard to fix as shadow maps are far from perfect. The best options are the ones Steve_Segreto said.

 

A fourth option could be to set a bit mask to the outer walls different from the inside walls, and have lights from the inside match the bit mask from the inner walls. Again, this requires artist intervention.

Share this post


Link to post
Share on other sites
Tom KQT    1704

A fourth option could be to set a bit mask to the outer walls different from the inside walls, and have lights from the inside match the bit mask from the inner walls. Again, this requires artist intervention.

Yep, in general you can assign individual lights to individual objects (or rather larger groups of objects like "room 1 interior") in your scene and render each object only with lights that belong to it.
It doesn't have to be a bitmask, it doesn't matter.

Share this post


Link to post
Share on other sites
DwarvesH    510

A fifth, probably more expensive solution is to implement light clipping. Clipping to an AABB box is the simplest form.

 

But the best solution would be to have some convex polygons for each interior. Project the light to the floor plane (the easiest way is to say that the polygon has a Y of 0 and all lights have a Y of 0). If the light is inside the polygon, determine all other objects that are inside the polygon and render them using the interior light + the exterior lights. The rest of the objects that are not inside the polygon will be rendered only with the exterior lights. It also helps if you use smart light placement, like Steve_Segreto suggested. Put the lights either somewhere near the center of the polygon, or place them on walls, but not near the door. This was you won't get weird lighting changes once the object begins to get close or enter the interior. And your interior should have an exterior surface and an interior one. This is not a problem because most interiors that can be viewed from the inside or outside are modeled this way.

 

For a first test, I would recommend using an AABB box for you polygon and interior surface and for the exterior surface a slightly bigger AABB, with the mesh having a simple door cut inside it.

Edited by DwarvesH

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this