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.
This commit is contained in:
Sergey Sharybin 2016-03-27 13:19:09 +02:00
parent 9c2704c169
commit 7bce3dd3ad
Notes: blender-bot 2023-02-14 08:07:50 +01:00
Referenced by issue #47697, Smoke simulation doesn't work in viewport
1 changed files with 7 additions and 1 deletions

View File

@ -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 */