Jump to content

  • Log In with Google      Sign In   
  • Create Account


Outdoor vs Indoor Lighting


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 jeffkingdev   Members   -  Reputation: 736

Like
0Likes
Like

Posted 13 November 2012 - 02:24 PM

I have an outdoor scene with some indoor elements like a house. When a player walks indoor, the lighting is all wrong because the indoor of the house is now being lit from the sun, regardless if walls are blocking the light.

So, how do people generally handle this? I was going to add a bounding box around the house, if the player collides with it, I would switch the lighting to just an ambient color and not take the sun. Similarly if the player walks outside, I'd switch back to using the sunlight.

The sun is needed for the outside walls to show lit vs shaded side. The indoor doesn't need that (at least from the sun).

Is that how others do this?

Thanks
Jeff.

Sponsor:

#2 Radikalizm   Crossbones+   -  Reputation: 2770

Like
0Likes
Like

Posted 13 November 2012 - 02:30 PM

You can add a sun occlusion factor to your scene's materials, if your material is used outdoor you set this factor so it doesn't occlude sunlight, if it's used indoor you set it so it does occlude sunlight.
If you're using a deferred renderer you can store this value in your GBuffer.

I believe this technique is quite commonly used in some major engines and it's quite simple to implement.

#3 swiftcoder   Senior Moderators   -  Reputation: 9582

Like
0Likes
Like

Posted 13 November 2012 - 02:50 PM

If you implement shadows, you can also just rely on the shadows to deal with shadowing light sources located outside the house. Although what with shadows being a bit of a black art (no pun intended), you may need to fudge things a little.

Tristam MacDonald - Software Engineer @Amazon - [swiftcoding]


#4 jeffkingdev   Members   -  Reputation: 736

Like
0Likes
Like

Posted 13 November 2012 - 03:04 PM

Radikalizm,

Is this common? If you have multiple materials, then you'll need 2 draw calls. Is that correct?

Thanks
Jeff.

#5 kburkhart84   Members   -  Reputation: 1564

Like
0Likes
Like

Posted 13 November 2012 - 08:55 PM

I think that if the house is really it's own environment, then you need to control it directly in order to get proper lighting. On the other hand, if it is like 007 on the N64 where you walk into the shacks but it isn't very "important" than it doesn't make much difference. I'm not sure how you are rendering these graphics. If you are using OpenGL directly, you can change lighting scheme between rendering different objects so that the house has its own lighting. The catch is that you'd have to create models for the outside and for the inside, although if you already have a single model that has polys on both sides, you may be able to just split them in your modeling software.






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