What am I doing wrong with my lighting? (Baking/Occlusion)

I’m trying to finally get advanced with my lighting/drawing techniques. This involves such enjoyable topics as light baking, ambient occlusion, etc. However, I’m clearly doing something really wrong… The most severe problem I have is that scenes that have complex lighting requirements generate a lot of drawcalls. In and of itself it isn’t a problem as I limit rooms like this and try to bake the lighting in to reduce drawcalls and use walls in between that room and the outside world to occlude it so that those small rooms don’t affect overall framerate. Herein lies my problem. For some reason baking doesn’t appear to be painting the colors and textures into the scene properly, and worse, the occlusion doesn’t appear to be blocking lights on the other side of walls. In fact, in some instances, lights bleed through the walls entirely.

I have to feel like the fact that lights bleed through walls, etc is part of the reason that the occlusion culling isn’t hiding the lights on the other side of the wall. I think if I could fix that , it would help with the draw call problem. Lightmapping is a whole other problem that’s not working.

Thanks!

A few different things…

Dual lightmaps are more expensive than single lightmaps. If you don’t need your baked lights to move, then use single lightmaps. You can also mark baked only lights as baked only to save CPU.

Light bleed is difficult to fix. It’s a function of your texel density, as larger texels will take less memory but be much more susceptible to bleeding. There are lots of small things you can do to try to work around it, like using SSAO, shifting objects to align better with ground texels, putting clutter objects around the perimiter to hide bleeding, etc. etc. There’s no silver bullet, though.

Thank you for the awesome response!! That makes me feel a lot better. One more question, why on earth am I getting so many draw calls when the lights and the scene that is generating them is nestled inside of the building which should be occluded?

You should use Occlusion culling to make sure that the insides of the buildings are only loaded when viable.

I am using occlusion culling, that’s why its so strange. I have occlusion areas set up and occlusion turned on in the camera. You can see the areas in the green. They are sub separated with by zones with a lot of lighting.

You should try toggling OC on and off in the camera to see what impact is has. Maybe you’d have even more batches if not for the OC. If you don’t have the profiler, you can also just hide and show chunks of your scene to narrow down where the batches are coming from.

If you think Umbra just isn’t cutting it for you, you can check out my product SECTR VIS which is on sale this week as part of SECTR COMPLETE.

I have pro and I’m absolutely not adverse to spending money. I’d like to know it does what I want though. It appears I may have had a few holes that weren’t being covered, but no matter what even after toggling OC/etc, I ended up with like 3000 draw calls no matter what.

A huge problem does seem to be my terrain too. No matter what it drops the framerate by about 30-40fps…

If you want an eval of SECTR, email support@makecodenow.com and I’ll set you up. You can also check out the various docs and videos on sectr.co.