godotengine / godotengine/godot
Shaders using TIME make editor unusable after some time
- Dominant language
- C++
- Stars
- 117k
- Forks
- 26.8k
- PR merge metrics
- PR metrics pending
Description
### Tested versions
4.3 beta1
I did not experience it before.
### System information
Windows 10.0.19045 - Vulkan (Forward+) - dedicated NVIDIA GeForce GTX 1060 (NVIDIA; 31.0.15.4633) - Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz (8 Threads)
### Issue description
https://github.com/godotengine/godot/assets/2223172/c68c897a-2398-445a-b9fb-a83d55370846
The ItemBlock has a shader that uses TIME. After the editor was open for a few hours, rendering this object makes the editor unusable. Same happens in other scenes with TIME shaders or particles. The problem goes away after editor restart.
Note that TIME being the problem is an assumption. I tested it with this one shader and with particles.
### Steps to reproduce
1. Have a CanvasIteme with shader that uses TIME
2. Wait a few hours with editor open
3. Check your scene
### Minimal reproduction project (MRP)
Shader used in the above scene:
```glsl
shader_type canvas_item;
uniform float intensity : hint_range(0, 1);
void vertex() {
VERTEX.x += sin(TIME * 10.0 + VERTEX.y) * 60.0 * intensity;
}
void fragment() {
vec2 uv = UV;
uv.y += sin(TIME * 10.0 + UV.x * 10.0) * 0.1 * intensity;
if (uv.y < 0.0 || uv.y > 1.0) {
COLOR = vec4(0);
}
}
```
Contributor guide
Research direction
Start with the minimal reproduction project and the provided CanvasItem shader, then reproduce the editor slowdown after leaving a TIME-based shader active for several hours. Compare the behavior with other TIME shaders and particles, as described in the report. Done means rendering these objects no longer makes the editor unusable after a long session.
Written by the indexing model from the issue text.
Assessment
- Domain
- computer-graphics, game-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100