[Bf-blender-cvs] [930c22e84a6] tmp-eevee-glsl-cleanup: Fix undefined behavior with background alpha

Clément Foucault noreply at git.blender.org
Mon Jul 13 15:44:11 CEST 2020


Commit: 930c22e84a6d91843e56274842ea85c789fc5125
Author: Clément Foucault
Date:   Mon Jul 13 16:25:51 2020 +0200
Branches: tmp-eevee-glsl-cleanup
https://developer.blender.org/rB930c22e84a6d91843e56274842ea85c789fc5125

Fix undefined behavior with background alpha

===================================================================

M	source/blender/gpu/shaders/material/gpu_shader_material_output_world.glsl

===================================================================

diff --git a/source/blender/gpu/shaders/material/gpu_shader_material_output_world.glsl b/source/blender/gpu/shaders/material/gpu_shader_material_output_world.glsl
index b298fa4f8d1..27ca96501ae 100644
--- a/source/blender/gpu/shaders/material/gpu_shader_material_output_world.glsl
+++ b/source/blender/gpu/shaders/material/gpu_shader_material_output_world.glsl
@@ -4,6 +4,7 @@ void node_output_world(Closure surface, Closure volume, out Closure result)
 {
 #ifndef VOLUMETRICS
   float alpha = renderPassEnvironment ? 1.0 : backgroundAlpha;
+  result = CLOSURE_DEFAULT;
   result.radiance = surface.radiance * alpha;
   result.transmittance = vec3(1.0 - alpha);
 #else



More information about the Bf-blender-cvs mailing list