Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


Don't forget to read Tuesday's email newsletter for your chance to win a free copy of Construct 2!


Limiting Light


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
4 replies to this topic

#1 Medo3337   Members   -  Reputation: 674

Like
0Likes
Like

Posted 09 September 2013 - 08:57 PM

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?



Sponsor:

#2 Steve_Segreto   Crossbones+   -  Reputation: 1539

Like
1Likes
Like

Posted 09 September 2013 - 10:15 PM

Two simple solutions: During art content creation, either make your light radius small enough that the light never goes out of the building or move the position of the light such that the light never goes out of the building.



#3 Matias Goldberg   Crossbones+   -  Reputation: 3570

Like
0Likes
Like

Posted 09 September 2013 - 11:05 PM

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.



#4 Tom KQT   Members   -  Reputation: 1612

Like
0Likes
Like

Posted 10 September 2013 - 12:42 AM

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.



#5 DwarvesH   Members   -  Reputation: 471

Like
0Likes
Like

Posted 10 September 2013 - 04:28 AM

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, 10 September 2013 - 04:29 AM.





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