home/ atoms/ glsl-shadertoy-uniform-names-differ

Shadertoy shaders use different uniform names from glslViewer and will not run as-is

Shadertoy and glslViewer use different conventions for built-in uniforms and the entry-point signature. Pasting Shadertoy code directly into a glslViewer .frag file causes undeclared-identifier errors. The translation table is: iTimeu_time, iResolutionu_resolution, iMouseu_mouse, fragCoordgl_FragCoord, fragColorgl_FragColor, and mainImage(out vec4 f, vec2 c)void main(). After translation, the Shadertoy body runs correctly.

Examples

Shadertoy: void mainImage(out vec4 fragColor, vec2 fragCoord). glslViewer: void main() { gl_FragColor = ... }.

Assessment

List the five uniform/variable translations needed to port a Shadertoy shader to glslViewer.

“Shadertoy uniform names** | pasting Shadertoy code using `iTime`, `iResolution`, `iMouse`, `fragCoord`, `fragColor`, `mainImage()` | Terminal: undeclared identifier / no `main`”
context/ · L5-debug/glsl.md · chunk 1