godotengine / godotengine/godot
TilemapLayer flickers in CanvasModulate
- Dominant language
- C++
- Stars
- 117k
- Forks
- 26.8k
- PR merge metrics
- PR metrics pending
Description
### Tested versions
4.3.stable
### System information
Win10 v4.3 Vulkan(Forward+)
### Issue description
https://github.com/user-attachments/assets/7e9dab57-2d4b-4b9d-b731-2660dbac8d6a

Recently I was trying to find a way to make a lot of lights in a dark environment, and I came across this problem. The screenshot has 3 parts. Part B is a Light2D, which works fine. Part C is a Sprite2D with a shader, which flickers badly. So at first, I guessed it was a shader problem. But I found that Part A also flickers, although not as bad as Part C because it is too dark.
For comparison, the Sprite2D on the right also flickers, and is not as bad as the TilemapLayer on the left.
Removing the Light2D and lighting Sprite2D does not help, and the TilemapLayer still flickers in the CanvasModulate.
Also, if CanvasModulate wasn't so dark, this wouldn't be as much of a problem.

You can select the commented out config to see the effect.
### Steps to reproduce
I posted a minimal reproduction project.
### Minimal reproduction project (MRP)
[lightshader.zip](https://github.com/user-attachments/files/17269162/lightshader.zip)
Contributor guide
Assessment
This issue has not been assessed yet.