Merge pull request #27 from thecreare/patch-1

Fix shader context example
This commit is contained in:
Face
2025-09-10 16:36:56 +03:00
committed by GitHub

View File

@@ -216,17 +216,14 @@ local shaderCtx = canvas:withContext('shader')
shaderCtx:source([[ shaderCtx:source([[
shader_type canvas_item; shader_type canvas_item;
uniform float time : hint_range(0.0, 10.0) = 1.0;
uniform vec2 resolution;
void fragment() { void fragment() {
vec2 uv = UV; vec2 uv = UV;
// Create animated rainbow effect // Create animated rainbow effect
vec3 color = vec3( vec3 color = vec3(
0.5 + 0.5 * cos(time + uv.x * 6.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.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 + uv.y) * 6.0 + 4.0)
); );
COLOR = vec4(color, 1.0); COLOR = vec4(color, 1.0);