-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathshadertoy_starter.js
44 lines (39 loc) · 1.17 KB
/
shadertoy_starter.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
export default {
meta: {
type: 'isf',
name: 'Get started with ISF using the default shadertoy shader',
author: 'NERDDISCO'
},
fragmentShader: `
/*{
"DESCRIPTION": "Get started with ISF using the default shadertoy shader",
"CREDIT": "shadertoy for the code & NERDDISCO for converting it to ISF",
"ISFVSN": "2",
"CATEGORIES": [
"gradient"
],
"INPUTS": [
{
"NAME": "alpha",
"TYPE": "float",
"DEFAULT": 0.5,
"MIN": 0.0,
"MAX": 1.0
}
]
}*/
// We can't use
// void mainImage( out vec4 fragColor, in vec2 fragCoord )
// as we would do in shadertoy, but use main() instead
void main() {
// ISF is using RENDERSIZE instead of iResolution
vec2 uv = gl_FragCoord.xy/RENDERSIZE.xy;
// ISF is using TIME instead of iTime
float iTime = TIME;
// The following line is the default code for a shader
// created in shadertoy
vec3 col = 0.5 + 0.5*cos(iTime+uv.xyx+vec3(0,2,4));
gl_FragColor = vec4(col, alpha);
}
`,
};