1、multiply:
result=base*blend;
2、screen:
result=vec4(1.0)-((vec4(1.0)-blend)*(vec4(1.0)-base));
3、darken:
result=min(blend,base);
4、lighten:
result=max(blend,base);
5、difference:
result=abs(base-blend);
6、negation:
result=vec4(1.0)-abs(vec4(1.0)-base-blend);
7、exclusion:
result=base+blend-(2.0*base*blend);
8、overlay:
# per channel:
if(base<0.5){
result=2.0*base*blend;
}else{
result=vec4(1.0)-2.0*(vec4(1.0)-blend)*(vec4(1.0)-base);
}
9、hard light:
# per channel:
if(blend<0.5){
result=2.0*base*blend;
}else{
result=vec4(1.0)-2.0*(vec4(1.0)-blend)*(vec4(1.0)-base);
}
10、soft light:
# per channel:
if(blend<0.5){
result=2.0*base*blend+base*base-2.0*base*base*blend;
}else{
result=2.0*sqrt(base)*blend-sqrt(base)+2.0*base-2.0*base*blend;
}
11、dodge:
result=base/(vec4(1.0)-blend);
12、burn:
result=vec4(1.0)-(vec4(1.0)-base)/blend;
网友评论