diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2016-03-27 14:19:09 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2016-04-05 11:36:09 +0300 |
commit | edb1cc6fa8915403a73bae7519fc16aa21f1666c (patch) | |
tree | eeef4be8bc3cc7442f29361d5728a2728894ddd7 /source/blender | |
parent | ee128c348fa12fa0be53a6f8ae3f7bda08c5d664 (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')
-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 */ |