Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TileMaps do not remove their tile occluders when the tile changes. #85766

Closed
ThePhantomLemon opened this issue Dec 4, 2023 · 3 comments · Fixed by #85893
Closed

TileMaps do not remove their tile occluders when the tile changes. #85766

ThePhantomLemon opened this issue Dec 4, 2023 · 3 comments · Fixed by #85893

Comments

@ThePhantomLemon
Copy link

Tested versions

Reproducible in 4.2-stable

System information

Godot v4.2.stable (46dc277) - Windows 10.0.22621 - Vulkan (Forward+) - dedicated NVIDIA GeForce GTX 1660 Ti (NVIDIA; 31.0.15.1640) - AMD Ryzen 7 4800H with Radeon Graphics (16 Threads)

Issue description

If you have a tile_set with an occlusion layer, and you remove a tile with an occlusion shape at runtime, the occlusion shape will remain.

image

image

Steps to reproduce

  • Setup a scene with CanvasModulate and a 2D Light
  • Create a tilemap & tileset
  • Add an occlusion layer
  • Give one or more tiles an occlusion shape
  • Make a script run sometime during process to randomly remove and add the tiles with occlusion shapes, and tiles without.
    You should now see errant shadows.

Or, in the MRP, just play the scene and you should see the problem once tiles alternate.

Minimal reproduction project (MRP)

OccluderProblem.zip

@ThePhantomLemon
Copy link
Author

Also, I was able to fix this by altering TileMapLayer::_rendering_occluders_update_cell to call _rendering_occluders_clear_cell before updating/creating occluders. However I don't know if that's an acceptable fix.

@itsmagu
Copy link

itsmagu commented Dec 6, 2023

Bug With Tilemaps
Here is an example of this bug

@itsmagu
Copy link

itsmagu commented Dec 6, 2023

Stable 4 1 3
In Godot 4.1.3.stable this is not a issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

4 participants