Skip to content

Instantly share code, notes, and snippets.

@spite
Created June 16, 2015 00:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save spite/a5d4388c01ba59cc879a to your computer and use it in GitHub Desktop.
Save spite/a5d4388c01ba59cc879a to your computer and use it in GitHub Desktop.
ShaderToy wrapper
// VERTEX SHADER
attribute vec2 pos;
void main() {
gl_Position = vec4(pos.xy,0.0,1.0);
}
// FRAGMENT SHADER
#ifdef GL_ES
precision highp float;
#endif
#extension GL_OES_standard_derivatives : enable
uniform vec3 iResolution;
uniform float iGlobalTime;
uniform float iChannelTime[4];
uniform vec4 iMouse;
uniform vec4 iDate;
uniform float iSampleRate;
uniform vec3 iChannelResolution[4];
uniform sampler2D iChannel0;
uniform sampler2D iChannel1;
uniform sampler2D iChannel2;
uniform sampler2D iChannel3;
// Shader Code
void main( void ){
vec4 color = vec4(0.0,0.0,0.0,1.0);
mainImage( color, gl_FragCoord.xy );
color.w = 1.0;
gl_FragColor = color;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment