From 9e60165ccfb3ff32ea53cbb0594b2cc40aa38936 Mon Sep 17 00:00:00 2001 From: David Rose Date: Mon, 9 Jul 2007 18:50:44 +0000 Subject: [PATCH] more fixes for state problems --- panda/src/glstuff/glGraphicsStateGuardian_src.cxx | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx index 0c0d5502f4..c74cd3de85 100644 --- a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx +++ b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx @@ -5866,10 +5866,13 @@ set_state_and_transform(const RenderState *target, determine_effective_texture(); int prev_active = _num_active_texture_stages; do_issue_texture(); - if (prev_active != _num_active_texture_stages) { - _state._tex_gen = 0; - _state._tex_matrix = 0; - } + + // Since the TexGen and TexMatrix states depend partly on the + // particular set of textures in use, we should force both of + // those to be reissued every time we change the texture state. + _state._tex_gen = 0; + _state._tex_matrix = 0; + _state._texture = _target._texture; }