- Home /
Why am I getting light leaks in Basic Realtime, and how can I avoid them in future?
Hey folks, doing some procedural generation with 3D tiles, so can't bake lights. Basically left using Basic Realtime Lighting: However, I'm having a little trouble as I'm finding point and spot lights shining 'through' seams of my test modules... (see the little white bar of light at the back of the first four modules) (The rightmost module has no backfaces - I clearly need to include those backfaces in order to occlude the majority of inappropriate light).
Can anybody advise me if there's a way to 100% exclude light leaks like these, or if I just need to be super careful about where I place the light objects?
I'd love to get some kind of authoritative verdict on this! Many thanks in advance!
Answer by WarmedxMints · Feb 26, 2019 at 06:12 PM
Unity's default shadows aren't great. You could use the HD render pipeline but it is still in development.
Assets like NGSS can improve things greatly on the default pipeline though - https://assetstore.unity.com/packages/vfx/shaders/next-gen-soft-shadows-137380
Holy cow! NGSS looks amazing! Unfortunately, I'm trying to handle most of this myself as a learning exercise - plus I'm trying to keep things to basic Unity to make upgrading to later versions as straightforward as possible.
Thank you for your advice, however!
Answer by MattG54321 · Feb 26, 2019 at 06:21 PM
This is a bit of a shot in the dark (if you'll excuse the pun), but try playing around with the settings in the Light Inspector, specifically the values under "Realtime Shadows." Changing the normal bias might be what you need.
You could also try changing "Cast Shadows" to "Two Sided" in your Mesh Renderers.
Hope this helps! Check out the Shadows page in the documentation for more information.
Thank you, $$anonymous$$att! Advice and puns gratefully received!
This seems to speak directly to the problem (search the page for 'light bleeding') - thank you for the link. They also mention your second piece of advice, to change 'Cast Shadows' to 'Two Sided' in my mesh renderers.
Trying that out, unfortunately, had $$anonymous$$imal effect on my test! =( It helped a little with the module that had no backfaces, but I still got light leaks on all modules. I guess the only solution is to try to be very careful about using spotlights and to avoid ai$$anonymous$$g them at 'joins' in meshes or allowing a wide angle to overlap onto a join.
Thank you so much for your thought and experience!
Your answer
Follow this Question
Related Questions
Lighting problem and glitch. 4 Answers
Low shadow quality from distance light 2 Answers
Directional light 2D 0 Answers
Flickering circle of light around character 0 Answers
How can I change the SpotAngle's range in a SpotLight? 0 Answers