diff options
-rw-r--r-- | source/blender/gpu/intern/gpu_basic_shader.c | 9 | ||||
-rw-r--r-- | source/blender/gpu/intern/gpu_draw.c | 1 |
2 files changed, 8 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; diff --git a/source/blender/gpu/intern/gpu_draw.c b/source/blender/gpu/intern/gpu_draw.c index 05d11549656..27e428d7f69 100644 --- a/source/blender/gpu/intern/gpu_draw.c +++ b/source/blender/gpu/intern/gpu_draw.c @@ -2113,6 +2113,7 @@ void GPU_state_init(void) glDisable(GL_STENCIL_TEST); glDisable(GL_TEXTURE_1D); glDisable(GL_TEXTURE_2D); + glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); /* default disabled, enable should be local per function */ glDisableClientState(GL_VERTEX_ARRAY); |