From 97d4e25f9d1b5cba170a6f5d1584dda650f5a20d Mon Sep 17 00:00:00 2001 From: David Rose Date: Wed, 15 May 2002 00:53:36 +0000 Subject: [PATCH] M_dual --- panda/src/dxgsg/dxGraphicsStateGuardian.cxx | 14 ++------------ panda/src/dxgsg8/dxGraphicsStateGuardian8.cxx | 14 ++------------ 2 files changed, 4 insertions(+), 24 deletions(-) diff --git a/panda/src/dxgsg/dxGraphicsStateGuardian.cxx b/panda/src/dxgsg/dxGraphicsStateGuardian.cxx index 7e08dd01f7..133c6d9df2 100644 --- a/panda/src/dxgsg/dxGraphicsStateGuardian.cxx +++ b/panda/src/dxgsg/dxGraphicsStateGuardian.cxx @@ -4894,7 +4894,6 @@ set_blend_mode(ColorWriteAttrib::Mode color_write_mode, // outside of a blend mode. if (color_write_mode == ColorWriteAttrib::M_off) { enable_blend(true); - enable_alpha_test(false); call_dxBlendFunc(D3DBLEND_ZERO, D3DBLEND_ONE); return; } @@ -4906,19 +4905,16 @@ set_blend_mode(ColorWriteAttrib::Mode color_write_mode, case ColorBlendAttrib::M_multiply: enable_blend(true); - enable_alpha_test(false); call_dxBlendFunc(D3DBLEND_DESTCOLOR, D3DBLEND_ZERO); return; case ColorBlendAttrib::M_add: enable_blend(true); - enable_alpha_test(false); call_dxBlendFunc(D3DBLEND_ONE, D3DBLEND_ONE); return; case ColorBlendAttrib::M_multiply_add: enable_blend(true); - enable_alpha_test(false); call_dxBlendFunc(D3DBLEND_DESTCOLOR, D3DBLEND_ONE); return; @@ -4931,23 +4927,18 @@ set_blend_mode(ColorWriteAttrib::Mode color_write_mode, // No color blend; is there a transparency set? switch (transparency_mode) { case TransparencyAttrib::M_none: + case TransparencyAttrib::M_binary: break; case TransparencyAttrib::M_alpha: case TransparencyAttrib::M_alpha_sorted: case TransparencyAttrib::M_multisample: case TransparencyAttrib::M_multisample_mask: + case TransparencyAttrib::M_dual: enable_blend(true); - enable_alpha_test(false); call_dxBlendFunc(D3DBLEND_SRCALPHA, D3DBLEND_INVSRCALPHA); return; - case TransparencyAttrib::M_binary: - enable_blend(false); - enable_alpha_test(true); - call_dxAlphaFunc(D3DCMP_EQUAL, 1); - return; - default: dxgsg_cat.error() << "invalid transparency mode " << (int)transparency_mode << endl; @@ -4956,7 +4947,6 @@ set_blend_mode(ColorWriteAttrib::Mode color_write_mode, // Nothing's set, so disable blending. enable_blend(false); - enable_alpha_test(false); } //////////////////////////////////////////////////////////////////// diff --git a/panda/src/dxgsg8/dxGraphicsStateGuardian8.cxx b/panda/src/dxgsg8/dxGraphicsStateGuardian8.cxx index 2c6df99dd2..57cacff025 100644 --- a/panda/src/dxgsg8/dxGraphicsStateGuardian8.cxx +++ b/panda/src/dxgsg8/dxGraphicsStateGuardian8.cxx @@ -4392,7 +4392,6 @@ set_blend_mode(ColorWriteAttrib::Mode color_write_mode, nassertv(color_write_mode == _color_write_mode); #if 0 if(color_write_mode == ColorWriteAttrib::M_off) { - enable_alpha_test(false); set_color_writemask(0x0); return; } @@ -4405,19 +4404,16 @@ set_blend_mode(ColorWriteAttrib::Mode color_write_mode, case ColorBlendAttrib::M_multiply: enable_blend(true); - enable_alpha_test(false); call_dxBlendFunc(D3DBLEND_DESTCOLOR, D3DBLEND_ZERO); return; case ColorBlendAttrib::M_add: enable_blend(true); - enable_alpha_test(false); call_dxBlendFunc(D3DBLEND_ONE, D3DBLEND_ONE); return; case ColorBlendAttrib::M_multiply_add: enable_blend(true); - enable_alpha_test(false); call_dxBlendFunc(D3DBLEND_DESTCOLOR, D3DBLEND_ONE); return; @@ -4430,23 +4426,18 @@ set_blend_mode(ColorWriteAttrib::Mode color_write_mode, // No color blend; is there a transparency set? switch (transparency_mode) { case TransparencyAttrib::M_none: + case TransparencyAttrib::M_binary: break; case TransparencyAttrib::M_alpha: case TransparencyAttrib::M_alpha_sorted: case TransparencyAttrib::M_multisample: case TransparencyAttrib::M_multisample_mask: + case TransparencyAttrib::M_dual: enable_blend(true); - enable_alpha_test(false); call_dxBlendFunc(D3DBLEND_SRCALPHA, D3DBLEND_INVSRCALPHA); return; - case TransparencyAttrib::M_binary: - enable_blend(false); - enable_alpha_test(true); - call_dxAlphaFunc(D3DCMP_EQUAL, 1.0f); - return; - default: dxgsg_cat.error() << "invalid transparency mode " << (int)transparency_mode << endl; @@ -4455,7 +4446,6 @@ set_blend_mode(ColorWriteAttrib::Mode color_write_mode, // Nothing's set, so disable blending. enable_blend(false); - enable_alpha_test(false); } ////////////////////////////////////////////////////////////////////