WGSL Shader Code
Available Variables
Uniforms
f32 uniforms.time
- Time in seconds since start
vec2f uniforms.resolution
- Canvas size (width, height)
vec2f uniforms.mouse
- Normalized mouse position (0-1)
Texture
texture_2d<f32> myTex
- Loaded texture
sampler mySampler
- Texture sampler
vec4f textureSample(myTex, mySampler, uv)
- Sample texture at UV coordinates
Built-in Variables
vec4f fragCoord
- Fragment coordinates in pixels
Preview