[Bf-blender-cvs] [edb1cc6] blender-v2.77-release: Fix T47697: Smoke simulation doesn't work in viewport

Sergey Sharybin noreply at git.blender.org
Tue Apr 5 10:38:25 CEST 2016


Commit: edb1cc6fa8915403a73bae7519fc16aa21f1666c
Author: Sergey Sharybin
Date:   Sun Mar 27 13:19:09 2016 +0200
Branches: blender-v2.77-release
https://developer.blender.org/rBedb1cc6fa8915403a73bae7519fc16aa21f1666c

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