🔧 Fix straight alpha

This commit is contained in:
Simon Schneegans
2022-05-08 20:49:29 +02:00
parent fa8e3a17c1
commit 78679ef139
8 changed files with 33 additions and 25 deletions
+1 -1
View File
@@ -55,7 +55,7 @@ function math2D() {
// compositing color values in the shader in the same way.
function compositing() {
return `
vec4 blendOver(vec4 over, vec4 under) {
vec4 alphaOver(vec4 under, vec4 over) {
float alpha = over.a + under.a * (1.0 - over.a);
return vec4((over.rgb * over.a + under.rgb * under.a * (1.0 - over.a)) / alpha, alpha);
}