Don't let light sources above a roof illuminate the space below the roof #8996
Labels
lighting/fog
Issues related to dynamic lighting or fog of war
tiles
Issues related to Tiles and their appearance
ux
Issues focused on user experience improvements
Milestone
User Experience
Just like light sources under a roof don't illuminate the space above the roof, light sources above a roof shouldn't illuminate the space below the roof (the light is blocked by the roof in both directions). We can use the new weather mask channel to make this happen.
In this example the light source is above the roof. Once the token steps under the roof, the roof is hidden, but the space below the roof is filled with the light that should be blocked by the roof, which is still there.
![roof_before](https://user-images.githubusercontent.com/31905376/223125739-e0416fae-2a20-4a55-97b1-d0ae37eb3ff4.gif)
After the suggested changes the light doesn't illuminated the space under the roof as expected.
![roof_after](https://user-images.githubusercontent.com/31905376/223125746-243c405b-8d5d-4ca0-86e5-f2d2391b24f3.gif)
The changes are simple. Replace
by
in the light shaders. One more change is required: the global light sources is special and should illuminate everything even below roofs (maybe it wouldn't have to behave that way, but changing this behavior would be breaking). So
GlobalLightSource
needs to override_updateCommonUniforms
to set thedepthTexture
to the empty texture, which makes all depth checks pass (no additional uniform required).The text was updated successfully, but these errors were encountered: