Created
September 4, 2016 15:56
-
-
Save aras-p/d40c430330506f0c9f5e83915b6b0725 to your computer and use it in GitHub Desktop.
Prefix to compile Shadertoy shaders to Vulkan/SPIR-V
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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