diff --git a/NEW_RELEASE_NOTES.md b/NEW_RELEASE_NOTES.md index df4c465690..c3eca02fda 100644 --- a/NEW_RELEASE_NOTES.md +++ b/NEW_RELEASE_NOTES.md @@ -9,3 +9,5 @@ appropriate header in [RELEASE_NOTES.md](./RELEASE_NOTES.md). ## Release notes for next branch cut - `setFrameCompletedCallback` now takes a `backend::CallbackHandler`. +- The `emissive` property was not applied properly to `MASKED` materials, and could cause + dark fringes to appear diff --git a/shaders/src/shading_lit.fs b/shaders/src/shading_lit.fs index 7a1d4e7b67..72b2b9ec33 100644 --- a/shaders/src/shading_lit.fs +++ b/shaders/src/shading_lit.fs @@ -299,7 +299,10 @@ void addEmissive(const MaterialInputs material, inout vec4 color) { #if defined(MATERIAL_HAS_EMISSIVE) highp vec4 emissive = material.emissive; highp float attenuation = mix(1.0, getExposure(), emissive.w); - color.rgb += emissive.rgb * (attenuation * color.a); +#if defined(BLEND_MODE_TRANSPARENT) || defined(BLEND_MODE_FADE) + attenuation *= color.a; +#endif + color.rgb += emissive.rgb * attenuation; #endif } diff --git a/shaders/src/shading_unlit.fs b/shaders/src/shading_unlit.fs index af30ddd7db..a98cf60203 100644 --- a/shaders/src/shading_unlit.fs +++ b/shaders/src/shading_unlit.fs @@ -2,7 +2,10 @@ void addEmissive(const MaterialInputs material, inout vec4 color) { #if defined(MATERIAL_HAS_EMISSIVE) highp vec4 emissive = material.emissive; highp float attenuation = mix(1.0, getExposure(), emissive.w); - color.rgb += emissive.rgb * (attenuation * color.a); +#if defined(BLEND_MODE_TRANSPARENT) || defined(BLEND_MODE_FADE) + attenuation *= color.a; +#endif + color.rgb += emissive.rgb * attenuation; #endif }