Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@gmail.com>2016-01-16 20:48:38 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2016-01-16 20:53:55 +0300
commit7e18918fae44156ce67fb7abd0077d23d36904fc (patch)
tree60cb512d6a46bdb85cccb369961690344de4de34 /source/blender/editors/space_view3d/drawvolume.c
parent1c71b8e32385ab8867b6d65c2e684626f1b3fca7 (diff)
OpenGL Smoke: fix possible inconsistency between fire shader/texture binding.
Diffstat (limited to 'source/blender/editors/space_view3d/drawvolume.c')
-rw-r--r--source/blender/editors/space_view3d/drawvolume.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/editors/space_view3d/drawvolume.c b/source/blender/editors/space_view3d/drawvolume.c
index 58142d7ee4a..5440fccf40e 100644
--- a/source/blender/editors/space_view3d/drawvolume.c
+++ b/source/blender/editors/space_view3d/drawvolume.c
@@ -297,7 +297,7 @@ void draw_smoke_volume(SmokeDomainSettings *sds, Object *ob,
return;
}
- const bool use_fire = (sds->active_fields & SM_ACTIVE_FIRE) != 0;
+ const bool use_fire = (sds->active_fields & SM_ACTIVE_FIRE) && sds->tex_flame;
GPUShader *shader = GPU_shader_get_builtin_shader(
(use_fire) ? GPU_SHADER_SMOKE_FIRE : GPU_SHADER_SMOKE);
@@ -343,7 +343,7 @@ void draw_smoke_volume(SmokeDomainSettings *sds, Object *ob,
GPUTexture *tex_spec = NULL;
- if (sds->tex_flame) {
+ if (use_fire) {
GPU_texture_bind(sds->tex_flame, 2);
GPU_shader_uniform_texture(shader, flame_location, sds->tex_flame);
@@ -412,7 +412,7 @@ void draw_smoke_volume(SmokeDomainSettings *sds, Object *ob,
GPU_texture_unbind(sds->tex);
GPU_texture_unbind(sds->tex_shadow);
- if (sds->tex_flame) {
+ if (use_fire) {
GPU_texture_unbind(sds->tex_flame);
GPU_texture_unbind(tex_spec);
GPU_texture_free(tex_spec);