Sign in to post a comment.
Shader Inputs
uniform vec3      iResolution;           // viewport resolution (in pixels)
uniform float iGlobalTime; // shader playback time (in seconds)
uniform float iChannelTime[4]; // channel playback time (in seconds)
uniform vec3 iChannelResolution[4]; // channel resolution (in pixels)
uniform vec4 iMouse; // mouse pixel coords. xy: current (if MLB down), zw: click
uniform samplerXX iChannel0..3; // input channel. XX = 2D/Cube
uniform vec4 iDate; // (year, month, day, time in seconds)
0 chars
Select Input
Standard Keyboard

Resolution: 512 x 512
Format: rgb

Source: unkown
Resolution: 1024 x 1024
Format: rgb

Source: unkown
Resolution: 512 x 512
Format: rgb

Source: unkown
Resolution: 512 x 512
Format: rgb

Source: unkown
Resolution: 512 x 512
Format: rgb

Source: unkown
Resolution: 1024 x 1024
Format: rgb

Source: unkown
Resolution: 1024 x 1024
Format: rgb

Source: unkown
Resolution: 1024 x 1024
Format: rgb

Resolution: 512 x 512
Format: rgb

Resolution: 1024 x 1024
Format: rgb

Resolution: 64 x 64
Format: r

Resolution: 64 x 64
Format: rgba

Resolution: 256 x 256
Format: r

Resolution: 8 x 8
Format: r

Resolution: 256 x 256
Format: rgba

Resolution: 256 x 32
Format: rgb


Videos / Webcam
Duration: 34s

Duration: 3m 40s

Duration: 29s


Resolution: 512x512

Resolution: 64x64

Resolution: 256x256

Resolution: 64x64

Resolution: 128x128

Resolution: 64x64



ElectronebulaeTitle: Electronebulae
Duration: 4m 18s
Author: stage7

ExperimentTitle: Experiment
Duration: 3m 48s
Author: iq

8 bit mentalityTitle: 8 bit mentalit
Duration: 3m 25s
Author: stage7

X'TrackTureTitle: X'TrackTure
Duration: 3m 50s
Author: josSs

ourpithyatorTitle: ourpithyator
Duration: 7m 32s
Author: AudeoFlow & Gizma

Tropical BeeperTitle: Tropical Beepe
Duration: 2m 42s
Author: Dave Hoskins

Most Geometric PersonTitle: Most Geometric Person
Duration: 1m 15s
Author: Noby
This help only covers the parts of GLSL ES that are relevant for Shadertoy. For the complete specification please have a look at GLSL ES specification


  • Preprocessor: # #define #undef #if #ifdef #ifndef #else #elif #endif #error #pragma #extension #version #line
  • Operators: () + - ! * / % << >> < > <= >= == != && ||
  • Comments: // /* */
  • Types: void bool int float vec2 vec3 vec4 bvec2 bvec3 bvec4 ivec2 ivec3 ivec4 mat2 mat3 mat4 sampler2D
  • Function Parameter Qualifiers: [none], in, out, inout
  • Global Variable Qualifiers: const
  • Vector Components: .xyzw .rgba .stpq
  • Flow Control: if else for return break continue
  • Output: vec4 gl_FragColor
  • Input: vec4 gl_FragCoord

Built-in Functions:

  • type radians (type degrees)
  • type degrees (type radians)
  • type sin (type angle)
  • type cos (type angle)
  • type tan (type angle)
  • type asin (type x)
  • type acos (type x)
  • type atan (type y, type x)
  • type atan (type y_over_x)
  • type pow (type x, type y)
  • type exp (type x)
  • type log (type x)
  • type exp2 (type x)
  • type log2 (type x)
  • type sqrt (type x)
  • type inversesqrt (type x)
  • type abs (type x)
  • type sign (type x)
  • type floor (type x)
  • type ceil (type x)
  • type fract (type x)
  • type mod (type x, float y)
  • type mod (type x, type y)
  • type min (type x, type y)
  • type min (type x, float y)
  • type max (type x, type y)
  • type max (type x, float y)
  • type clamp (type x, type minV, type maxV)
  • type clamp (type x, float minV, float maxV)
  • type mix (type x, type y, type a)
  • type mix (type x, type y, float a)
  • type step (type edge, type x)
  • type step (float edge, type x)
  • type smoothstep (type a, type b, type x)
  • type smoothstep (float a, float b, type x)
  • mat matrixCompMult (mat x, mat y)
  • float length (type x)
  • float distance (type p0, type p1)
  • float dot (type x, type y)
  • vec3 cross (vec3 x, vec3 y)
  • type normalize (type x)
  • type faceforward (type N, type I, type Nref)
  • type reflect (type I, type N)
  • type refract (type I, type N,float eta)
  • bvec lessThan(vec x, vec y)
  • bvec lessThan(ivec x, ivec y)
  • bvec lessThanEqual(vec x, vec y)
  • bvec lessThanEqual(ivec x, ivec y)
  • bvec greaterThan(vec x, vec y)
  • bvec greaterThan(ivec x, ivec y)
  • bvec greaterThanEqual(vec x, vec y)
  • bvec greaterThanEqual(ivec x, ivec y)
  • bvec equal(vec x, vec y)
  • bvec equal(ivec x, ivec y)
  • bvec equal(bvec x, bvec y)
  • bvec notEqual(vec x, vec y)
  • bvec notEqual(ivec x, ivec y)
  • bvec notEqual(bvec x, bvec y)
  • bool any(bvec x)
  • bool all(bvec x)
  • bvec not(bvec x)
  • vec4 texture2D(sampler2D sampler, vec2 coord )
  • vec4 texture2D(sampler2D sampler, vec2 coord, float bias)
  • vec4 textureCube(samplerCube sampler, vec3 coord)
  • vec4 texture2DProj(sampler2D sampler, vec3 coord )
  • vec4 texture2DProj(sampler2D sampler, vec3 coord, float bias)
  • vec4 texture2DProj(sampler2D sampler, vec4 coord)
  • vec4 texture2DProj(sampler2D sampler, vec4 coord, float bias)
  • type dFdx( type x ), dFdy( type x )
  • type fwidth( type p )


  • Use structs: struct myDataType { float occlusion; vec3 color; }; myDataType myData = myDataType(0.7, vec3(1.0, 2.0, 3.0));
  • Initialize arrays: arrays cannot be initialized in WebGL.
  • Do conversions: int b = 3; float b = float(a);
  • Do component swizzling: vec4 a = vec4(1.0,2.0,3.0,4.0); vec4 b = a.zyyw;
  • Access matrix components: mat4 m; m[1] = vec4(2.0); m[0][0] = 1.0; m[2][3] = 2.0;

Be careful!

  • the f suffix for floating pont numbers: 1.0f is illegal in GLSL. You must use 1.0
  • saturate(): saturate(x) doesn't exist in GLSL. Use clamp(x,0.0,1.0) instead
  • pow/sqrt: please don't feed sqrt() and pow() with negative numbers. Add an abs() or max(0.0,) to the argument
  • variables: initialize your variables! Don't assume they'll be set to zero by default
  • functions: don't call your functions the same as some of your variables

Shader Toy specific input

  • uniform vec3 iResolution: the rendering viewport resolution.
  • uniform float iGlobalTime: current time in seconds.
  • uniform float iChannelTime[4]: time for channel (if video or sound), in seconds.
  • uniform vec4 iMouse: xy contain the current pixel coords (if LMB is down). zw contain the click pixel.
  • uniform sampler2D iChannel{i}: sampler for input textures i
  • uniform vec4 iDate:year, month, day, time in seconds in .xyzw

BBCode Help


You can format your comments by using standard BBCode. The following tags are implemented in Shadertoy:

Bold[b]this text goes in bold[/b]
Italic[i]this text goes in italic[/i]
Code[code]fixed-width text[/code]


:) :] =)
:( :[



Share your shader
Direct link:

Just copy and paste this URL below:


Shader reported
Thanks for helping us keeping Shadertoy an enjoyable place for everyone. We will review this shader shortly and take action if appropriate.
Share your shader