[Bf-blender-cvs] [7bce3dd] master: Fix T47697: Smoke simulation doesn't work in viewport

Sergey Sharybin noreply at git.blender.org
Sun Mar 27 13:24:02 CEST 2016


Commit: 7bce3dd3ad02941412919f2d5b9ab89c67f2cbb9
Author: Sergey Sharybin
Date:   Sun Mar 27 13:19:09 2016 +0200
Branches: master
https://developer.blender.org/rB7bce3dd3ad02941412919f2d5b9ab89c67f2cbb9

Fix T47697: Smoke simulation doesn't work in viewport

Seems to be a division by zero error.

Should be safe for an upcoming 'a' release.

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

M	source/blender/gpu/shaders/gpu_shader_smoke_frag.glsl

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

diff --git a/source/blender/gpu/shaders/gpu_shader_smoke_frag.glsl b/source/blender/gpu/shaders/gpu_shader_smoke_frag.glsl
index 7bee7ef..4d1feb5 100644
--- a/source/blender/gpu/shaders/gpu_shader_smoke_frag.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_smoke_frag.glsl
@@ -17,7 +17,13 @@ void main()
 {
 	/* compute color and density from volume texture */
 	vec4 soot = texture3D(soot_texture, coords);
-	vec3 soot_color = active_color * soot.rgb / soot.a;
+	vec3 soot_color;
+	if (soot.a != 0) {
+		soot_color = active_color * soot.rgb / soot.a;
+	}
+	else {
+		soot_color = vec3(0, 0, 0);
+	}
 	float soot_density = density_scale * soot.a;
 
 	/* compute transmittance and alpha */




More information about the Bf-blender-cvs mailing list