We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 10a6332 commit 07c01a9Copy full SHA for 07c01a9
src/renderers/shaders/ShaderChunk/opaque_fragment.glsl.js
@@ -9,7 +9,11 @@ diffuseColor.a *= material.transmissionAlpha;
9
10
#ifdef PREMULTIPLIED_ALPHA
11
12
-gl_FragColor = vec4( outgoingLight * diffuseColor.a, diffuseColor.a );
+// Convert to sRGB, apply premultiplied alpha, convert back to linear.
13
+// This ensures correct blending in sRGB framebuffers.
14
+vec3 srgb = sRGBTransferOETF( vec4( outgoingLight, 1.0 ) ).rgb;
15
+srgb *= diffuseColor.a;
16
+gl_FragColor = vec4( sRGBTransferEOTF( vec4( srgb, 1.0 ) ).rgb, diffuseColor.a );
17
18
#else
19
0 commit comments