diff --git a/CHANGELOG.md b/CHANGELOG.md index a2f0adaddb84c5e054610ed29f2873f8f8648744..6f5d92fee18f6d58cec2b279d17478ca2839fb7d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ Note that since we don't clearly distinguish between a public and private interf - Optimize BinaryCIF integer packing encoder - Fix Dual depth peeling when post-processing is off or when rendering direct-volumes - Add `cameraClipping.minNear` parameter +- Fix black artifacts on specular highlights with transparent background ## [v3.18.0] - 2022-09-17 diff --git a/src/mol-canvas3d/passes/smaa.ts b/src/mol-canvas3d/passes/smaa.ts index 4ac7296fa717dcb72e3c790fd027275c6a5177b5..4b1de5e41389eddec14bfbadc39d90ca95a3bc15 100644 --- a/src/mol-canvas3d/passes/smaa.ts +++ b/src/mol-canvas3d/passes/smaa.ts @@ -74,6 +74,7 @@ export class SmaaPass { state.viewport(x, y, width, height); state.scissor(x, y, width, height); + state.colorMask(true, true, true, true); state.clearColor(0, 0, 0, 1); gl.clear(gl.COLOR_BUFFER_BIT); diff --git a/src/mol-gl/shader/chunks/apply-light-color.glsl.ts b/src/mol-gl/shader/chunks/apply-light-color.glsl.ts index c0cd9b64b4a379ded35896aaa5d9f1027bac27f5..07374df935bb5c5a14df4977dba32b7f5cfdda38 100644 --- a/src/mol-gl/shader/chunks/apply-light-color.glsl.ts +++ b/src/mol-gl/shader/chunks/apply-light-color.glsl.ts @@ -57,6 +57,7 @@ export const apply_light_color = ` RE_IndirectSpecular_Physical(radiance, iblIrradiance, clearcoatRadiance, geometry, physicalMaterial, reflectedLight); vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular; + outgoingLight = clamp(outgoingLight, 0.0, 1.0); // prevents black artifacts on specular highlight with transparent background gl_FragColor = vec4(outgoingLight, color.a); #endif