The drawing is now completely shader based, which makes away
with all usage of the depracted matrix stack. This also allows
us to do things like simple translations and texture coordinate
translation directly instead of doing everything indirectly
through matrices.
Fixed vertex attributes ('vertexPointer()' etc) are also
replaced with user defined attribute arrays.
16 lines
374 B
GLSL
16 lines
374 B
GLSL
/* Fragment shader that produces a simple
|
|
* fade in / fade out type transition */
|
|
|
|
uniform sampler2D frozenScene;
|
|
uniform sampler2D currentScene;
|
|
uniform float prog;
|
|
|
|
varying vec2 v_texCoord;
|
|
|
|
void main()
|
|
{
|
|
vec4 newPixel = texture2D(currentScene, v_texCoord);
|
|
vec4 oldPixel = texture2D(frozenScene, v_texCoord);
|
|
|
|
gl_FragColor = mix(oldPixel, newPixel, prog);
|
|
}
|