Fix shader context example

This commit is contained in:
creare
2025-09-09 15:20:01 -04:00
committed by GitHub
parent 7996b42b05
commit 69cc06f101

View File

@@ -215,21 +215,18 @@ local shaderCtx = canvas:withContext('shader')
shaderCtx:source([[
shader_type canvas_item;
uniform float time : hint_range(0.0, 10.0) = 1.0;
uniform vec2 resolution;
void fragment() {
vec2 uv = UV;
// Create animated rainbow effect
vec3 color = vec3(
0.5 + 0.5 * cos(time + uv.x * 6.0),
0.5 + 0.5 * cos(time + uv.y * 6.0 + 2.0),
0.5 + 0.5 * cos(time + (uv.x + uv.y) * 6.0 + 4.0)
0.5 + 0.5 * cos(TIME + uv.x * 6.0),
0.5 + 0.5 * cos(TIME + uv.y * 6.0 + 2.0),
0.5 + 0.5 * cos(TIME + (uv.x + uv.y) * 6.0 + 4.0)
);
COLOR = vec4(color, 1.0);
}
]])
```
```