Back to shaders
Shader test bench
Fadecolor
runnable transition
GLSL transition function. Stronghold supplies two demo textures and progress/time uniforms.
Code
// Author: gre
// License: MIT
uniform vec3 color;// = vec3(0.0)
uniform float colorPhase; // = 0.4 ; // if 0.0, there is no black phase, if 0.9, the black phase is very important
vec4 transition (vec2 uv) {
return mix(
mix(vec4(color, 1.0), getFromColor(uv), smoothstep(1.0-colorPhase, 0.0, progress)),
mix(vec4(color, 1.0), getToColor(uv), smoothstep( colorPhase, 1.0, progress)),
progress);
}