diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2016-03-27 14:19:09 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2016-03-27 14:21:33 +0300 |
commit | 7bce3dd3ad02941412919f2d5b9ab89c67f2cbb9 (patch) | |
tree | 9cae96d625d36f9d2877c866e4f499bd7fe6411c /source/blender/gpu | |
parent | 9c2704c169635ac6ef21d257e344f5f8f0149729 (diff) |
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.
Diffstat (limited to 'source/blender/gpu')
-rw-r--r-- | source/blender/gpu/shaders/gpu_shader_smoke_frag.glsl | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/source/blender/gpu/shaders/gpu_shader_smoke_frag.glsl b/source/blender/gpu/shaders/gpu_shader_smoke_frag.glsl index 7bee7ef47a7..4d1feb5c83e 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 */ |