godotengine / godotengine/godot

TilemapLayer flickers in CanvasModulate

Open
#97,883 0 comments 0 reactions 0 assignees View on GitHub
bug topic:2d topic:rendering
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

![cd71245b-2d76-4c30-9ad9-e958e429d899](https://github.com/user-attachments/assets/51e7e09b-34b4-46c5-a2e7-051ec17c8003)

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.
![image](https://github.com/user-attachments/assets/050a203e-e20b-452e-bc71-0b67e08d8e6a)
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.