Jump to content

  • Log In with Google      Sign In   
  • Create Account

#ActualDwarvesH

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


#1DwarvesH

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 you 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.


PARTNERS