home/ atoms/ glsl-panic-cosine-palette

The canonical GLSL panic shader is the hello.frag cosine palette driven by u_time with a clamped output

When a GLSL shader fails to compile or the frame goes black, the recovery procedure is to replace the file with a minimal, guaranteed-compiling shader. The rig’s canonical panic is the hello.frag cosine palette: it includes the precision block, declares only glslViewer-provided uniforms, assigns gl_FragColor, and clamps the output so it cannot blow out. Motion comes from u_time only — no audio. The absolute minimum fallback is a solid color: void main() { gl_FragColor = vec4(0.03, 0.03, 0.05, 1.0); }.

Examples

#ifdef GL_ES
precision mediump float;
#endif
uniform vec2 u_resolution;
uniform float u_time;
void main() {
    vec2 st = gl_FragCoord.xy / u_resolution.xy;
    vec3 col = 0.5 + 0.5 * cos(u_time + st.xyx + vec3(0.0, 2.0, 4.0));
    gl_FragColor = vec4(clamp(col, 0.0, 1.0), 1.0);
}

Assessment

Describe how the canonical GLSL panic shader satisfies the precision, uniform-declaration, output-assignment, and clamp requirements, and give the single-line fallback for when even the cosine palette is suspect.

“guaranteed-compiling**, always-nice shader — the seed's cosine palette, driven by `u_time` (no audio, since the bridge isn't wired here)”
context/ · L5-debug/glsl.md · chunk 1