[Bf-blender-cvs] [7e18918] master: OpenGL Smoke: fix possible inconsistency between fire shader/texture binding.
Brecht Van Lommel
noreply at git.blender.org
Sat Jan 16 19:05:53 CET 2016
Commit: 7e18918fae44156ce67fb7abd0077d23d36904fc
Author: Brecht Van Lommel
Date: Sat Jan 16 18:48:38 2016 +0100
Branches: master
https://developer.blender.org/rB7e18918fae44156ce67fb7abd0077d23d36904fc
OpenGL Smoke: fix possible inconsistency between fire shader/texture binding.
===================================================================
M source/blender/editors/space_view3d/drawvolume.c
===================================================================
diff --git a/source/blender/editors/space_view3d/drawvolume.c b/source/blender/editors/space_view3d/drawvolume.c
index 58142d7..5440fcc 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);
More information about the Bf-blender-cvs
mailing list