From 08d204b964de7860aba74cd380de8663a0964796 Mon Sep 17 00:00:00 2001 From: aignacio_sf <> Date: Sat, 10 Feb 2007 01:28:50 +0000 Subject: [PATCH] Fix multi-texture problem: If multi-texture was on before drawing with a shader, then the multi-texture would be in a bad state after drawing with the shader. So, turn off multi-texture before shader usage. --- panda/src/dxgsg9/dxShaderContext9.cxx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/panda/src/dxgsg9/dxShaderContext9.cxx b/panda/src/dxgsg9/dxShaderContext9.cxx index 1fc3b741ff..ef7af84f3d 100644 --- a/panda/src/dxgsg9/dxShaderContext9.cxx +++ b/panda/src/dxgsg9/dxShaderContext9.cxx @@ -544,6 +544,9 @@ bind(GSG *gsg) { // clear the last cached FVF to make sure the next SetFVF call goes through gsg -> _last_fvf = 0; + // turn off fixed-function multi-texture + gsg -> set_texture_stage_state (0, D3DTSS_COLOROP, D3DTOP_DISABLE); + gsg -> set_texture_stage_state (1, D3DTSS_COLOROP, D3DTOP_DISABLE); // Pass in k-parameters and transform-parameters issue_parameters(gsg, true); @@ -1088,6 +1091,7 @@ update_shader_texture_bindings(CLP(ShaderContext) *prev, GSG *gsg) continue; } TextureContext *tc = tex->prepare_now(gsg->_prepared_objects, gsg); +// TextureContext *tc = tex->prepare_now(gsg->get_prepared_objects(), gsg); if (tc == (TextureContext*)NULL) { continue; }