Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

First off, I own Unity Pro.

I've been looking in to occluding lights when they aren't being viewed for a while now to improve performance. The main methods I ran in to were using BecameVisible() and testing the camera frustum.

My main problem was that if the player is viewing an area that would be lit by the light, I still want the light to be on.

Currently I'm using a method which checks to see if the lit area is in the camera frustum, but the problem is sometimes lights are in the frustum without actually being visible by the player (e.g. a wall between them and the player). I've tried raycasting to them but you can never get detailed enough for the actual lit area (the best I could figure was using renderer.bounds.extent and renderer.bounds.center to calculate the maximum lit points from the light).

Does anyone know of an easy way in Unity Pro to occlude lights? Or could you tell me a good way to use that camera fulcrum method I was talking about?

share|improve this question
1  
You can check if the camera frustum and the lights frustum intersect, but I expect unity is already doing this. –  Archy Feb 27 '13 at 9:15
1  
In Unity Pro, OcclusionCulling should handle lights too. –  Archy Feb 27 '13 at 9:24
    
Alright, my artist had said that Occlusion Culling wouldn't work for lights. So I'd probably just set my various light sources as occludees in the occlusion areas I already have set up? –  Timothy Williams Feb 27 '13 at 19:05
    
And something like checking the camera and light frustum against eachother may work, though I'd need it to work in 360 degrees. –  Timothy Williams Feb 27 '13 at 19:06
    
Occlusion culling seems to not be working with lights, despite what the artist and I try. How exactly would I occlude a light? –  Timothy Williams Mar 4 '13 at 23:37

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.