Skip to content

Instantly share code, notes, and snippets.

@aras-p
Created September 4, 2016 15:56
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aras-p/d40c430330506f0c9f5e83915b6b0725 to your computer and use it in GitHub Desktop.
Save aras-p/d40c430330506f0c9f5e83915b6b0725 to your computer and use it in GitHub Desktop.
Prefix to compile Shadertoy shaders to Vulkan/SPIR-V
// pasting this in front of most shadertoys allows them to be compiled with:
// glslangValidator -V inputFile.frag -o outputFile.spv
#version 430
layout(binding = 1, std140) uniform glob {
uniform vec3 iResolution;
uniform float iGlobalTime;
uniform float iTimeDelta;
uniform int iFrame;
uniform float iFrameRate;
uniform float iChannelTime[4];
uniform vec3 iChannelResolution[4];
uniform vec4 iMouse;
uniform vec4 iDate;
uniform float iSampleRate;
};
uniform sampler2D iChannel0;
uniform sampler2D iChannel1;
uniform sampler2D iChannel2;
uniform sampler2D iChannel3;
void mainImage( out vec4 fragColor, in vec2 fragCoord );
in vec2 _fragCoord;
out vec4 _fragColor;
void main() { mainImage (_fragColor, _fragCoord); }
#define texture2D texture
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment