Shadershow::sample


More or less the most simple example of how the timing script ties to a shader is the following:
The line with the event #color links the timespan 0-5 secs to the pixelshader color.ps.
purple and green are RGB colors specified, then the 2 lines with lin expressions interpolates between the colors.
The final line with x=halt() shuts down the system once the timespan 5-10 comes within range.

color.ps takes the color input and sets every pixel to that value.
see the test example provided with the dists for a more advanced example.
A good way to test shaders is to write them with shadertoy
time.txt
0    5    #color
0    5    purple=[1,0,1]
0    5    green=[0,1,0]
0    1.5  color=lin(purple,green)
1.5  5    color=lin(green,purple)
5    10   x=halt()
color.ps
#ifdef GL_ES
precision highp float;
#endif

uniform vec3 color;

void main(void) {
    gl_FragColor = vec4(color,1.0);
}
back to main page