Back to shaders
Shader test bench
Fragment
runnable fragment
Complete GLSL fragment shader. Stronghold runs it directly when the browser can compile it.
Code
precision mediump float;
uniform vec3 uColorA;
uniform vec3 uColorB;
varying float vWobble;
void main()
{
float colorMix = smoothstep(-1.0, 1.0, vWobble);
csm_DiffuseColor.rgb = mix(uColorA, uColorB, colorMix);
}