The cause and solution of light leakage that passes through the thin walls of URP is a serious technical bug that frequently occurs during actual machine tests and rendering pipeline extensions. Explanation of the solution to the shadow leak bug that causes light to penetrate and leak behind thin walls and floors.

Specific symptoms of the problem

Even though the room is completely sealed and dark, or the room next door is separated by a thin wall, sunlight (directional light) from outside leaks unnaturally through the joints of the walls and the backside of the floor, illuminating the room.

Real-world analogy: light leaking through gaps in thin theater partitions and error in thickness of shadow puppet sheet

In order to eliminate the shadow stripe noise, the position of the shadow (shadow bias) was shifted back by a distance greater than the thickness of the wall.As a result, no shadow is formed inside the wall, and light passes through the wall and leaks into the next room. By moving the starting point of the shadow back to the wall surface in millimeters (reducing the bias), you can completely shut out light.

Causes and solutions for light leaks passing through the thin walls of URP troubleshooting diagram

Figure: Outline diagram of the cause and solution of light leakage that passes through the thin walls of URP, the failure mechanism and solution approach.

Assumed causes and detailed mechanism

This is because the resolution of the Shadow Map is insufficient, and the "Shadow Bias (depth offset value)" value set to prevent shadow flickering (shadow acne) is too large, causing the starting position of the shadow to shift several centimeters deeper than the physical shape of the object, and light penetrating beyond the thickness of the thin wall.

Solution approach and optimization procedure

Open the light settings window and adjust the "Shadow Bias" and "Normal Bias" values to the lowest possible value (e.g. 0.02 or less). You can also physically increase the wall thickness or apply Double Sided Shadows to the wall material to increase its shielding power if necessary.