diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2015-12-23 22:38:58 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2015-12-23 22:38:58 +0300 |
commit | 93c75bf99205504d5cec35829813af23b48d7cb0 (patch) | |
tree | 3b129045f444e66208409845bdb02c85e8de39e7 /source/blender/gpu/intern/gpu_basic_shader.c | |
parent | eb6a8e43214037a077aa198b5cfdf1d20a053aae (diff) |
Fix T47051: cycles viewport textured shadeless draw bug.
Diffstat (limited to 'source/blender/gpu/intern/gpu_basic_shader.c')
-rw-r--r-- | source/blender/gpu/intern/gpu_basic_shader.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/source/blender/gpu/intern/gpu_basic_shader.c b/source/blender/gpu/intern/gpu_basic_shader.c index 6b01ee85170..c441a44c17b 100644 --- a/source/blender/gpu/intern/gpu_basic_shader.c +++ b/source/blender/gpu/intern/gpu_basic_shader.c @@ -205,10 +205,15 @@ void GPU_basic_shader_bind(int options) glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, GL_FALSE); } - if (options & GPU_SHADER_TEXTURE_2D) + if (options & GPU_SHADER_TEXTURE_2D) { + GLint env_mode = (options & (GPU_SHADER_USE_COLOR|GPU_SHADER_LIGHTING)) ? GL_MODULATE : GL_REPLACE; glEnable(GL_TEXTURE_2D); - else if (bound_options & GPU_SHADER_TEXTURE_2D) + glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, env_mode); + } + else if (bound_options & GPU_SHADER_TEXTURE_2D) { + glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); glDisable(GL_TEXTURE_2D); + } } GPU_MATERIAL_STATE.bound_options = options; |