- Home /
Multiple Rooms with Lights
I'm in a bit of a predicament and I'm sure I'm not the first one to run into this problem.
I'm trying to model an office building with multiple rooms. I want the player to be able to turn the lights on/off for each room. Here are the problems I'm running into:
Problem 1: With forward rendering I can't use shadows and therefore my point lights leak through the wall (i.e. room with the lights turned off aren't pitch black because they're receiving light from adjacent rooms).
Solution: Initially, I was solving this by light mapping my scene twice - once with lights on and once with lights off. When the player turned the lights off I was switching all renderers in the room to an all black lightmap and turning the light off.
Problem 2: The above solution is not bad, but all of my dynamic objects still receive the light leaking through walls. I think I could fix this using lightprobes. However, I'm not sure how to change the lightmap of individual probes (i.e. the probes in the room use the off lightmap, probes outside the room use the on lightmap).
If I use deferred lighting with shadows everything works good, but my fps drops from 60 to ~20.
Thanks
Looking at the LightProbeGroup script reference I don't see any property for 'enabled'... damn.
You actually can use shadows with point lights in forward rendering. It involves modifying shaders a bit; can't remember exactly but you should be able to find it with a search.
This would be perfect, but I seem to be having difficulties. Could you take a look at the screen shots and let me know what you think?
I only added fullforwardshadows to the floor's shader, so I don't expect shadows to appear, but I do expect the floor to still be lit..
Here's a link ins$$anonymous$$d: http://postimage.org/image/5yieo1le5/
I think it might have something to do with multiple point lights?.. even though my pixel light count is set extremely high.
Your answer
Follow this Question
Related Questions
Lightmapped terrain no shadow from dynamic objects 0 Answers
How to dynamically BAKE lighting? 0 Answers
Lightprobes on Vertex-lit rendering path 0 Answers
Unity Free - Lightmapped Shadows 1 Answer