Skip to content

Basic ShaderToy shader support#271

Merged
osnr merged 4 commits into
mainfrom
osnr/toy-shaders
Jun 9, 2026
Merged

Basic ShaderToy shader support#271
osnr merged 4 commits into
mainfrom
osnr/toy-shaders

Conversation

@osnr

@osnr osnr commented Jun 9, 2026

Copy link
Copy Markdown
Collaborator
IMG_5703.MOV

Basic example (same as https://www.shadertoy.com/new):

Wish $this draws toy shader {
void mainImage( out vec4 fragColor, in vec2 fragCoord )
{
    // Normalized pixel coordinates (from 0 to 1)
    vec2 uv = fragCoord/iResolution.xy;

    // Time varying pixel color
    vec3 col = 0.5 + 0.5*cos(iTime+uv.xyx+vec3(0,2,4));

    // Output to screen
    fragColor = vec4(col,1.0);
}
}

ShaderToy code should run verbatim as long as it only uses iResolution and iTime (no channels, iFrame, iMouse, or iFrameRate support yet).

Tested and working:

This is not very flexible right now -- you can't add additional uniforms -- but I like the idea of maintaining verbatim compatibility so we can use the existing library of ShaderToy. Can try to make it extensible later while maintaining compatibility (maybe use reflection to find declared uniforms)

Fixes #106 / May supersede #270

@osnr osnr requested review from cwervo, ppkn and smj-edison June 9, 2026 16:14
@osnr osnr merged commit 0671c7a into main Jun 9, 2026
@osnr osnr mentioned this pull request Jun 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Userland pixel shader language

2 participants