glsl-blend
glsl-blend copied to clipboard
Subtract mode error
Subtract is not as same as LinearBurn
Subtract should be
float blendSubtract(float base, float blend) {
return max(base-blend, 0.0);
}
vec3 blendSubtract(vec3 base, vec3 blend) {
return max(base-blend, vec3(0.0));
}
vec3 blendSubtract(vec3 base, vec3 blend, float opacity) {
return (blendSubtract(base, blend) * opacity + base * (1.0 - opacity));
}