Skip to content

Instantly share code, notes, and snippets.

@scheibel
Created December 28, 2019 10:14
Show Gist options
  • Save scheibel/99a4c0f4504ca25d0088c131c071f31f to your computer and use it in GitHub Desktop.
Save scheibel/99a4c0f4504ca25d0088c131c071f31f to your computer and use it in GitHub Desktop.
ShaderToy demo
float utilityFunction(float t, float value)
{
return t;
}
float subFunction(float t, vec2 uv)
{
return utilityFunction(t, texture(iChannel0, uv)[0]);
}
void mainImage( out vec4 fragColor, in vec2 fragCoord )
{
// Normalized pixel coordinates (from 0 to 1)
vec2 v_uv = fragCoord/iResolution.xy;
float a = subFunction(0.5, v_uv);
fragColor = vec4(1.0,a,0.0,1.0);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment