Use material.premultipliedAlpha to adjust blending function (#136)

This commit is contained in:
Noeri Huisman
2025-07-25 03:26:29 +02:00
committed by GitHub
parent 3445167e7a
commit 30f50aa9ee
2 changed files with 6 additions and 25 deletions
+3 -4
View File
@@ -6,7 +6,6 @@ precision highp int;
uniform float near;
uniform float far;
uniform bool premultipliedAlpha;
uniform bool encodeLinear;
uniform float maxStdDev;
uniform float minAlpha;
@@ -69,9 +68,9 @@ void main() {
rgba.rgb = srgbToLinear(rgba.rgb);
}
if (premultipliedAlpha) {
#ifdef PREMULTIPLIED_ALPHA
fragColor = vec4(rgba.rgb * rgba.a, rgba.a);
} else {
#else
fragColor = rgba;
}
#endif
}