From ba734ed8dd6586573a45d7232e4403831feedad2 Mon Sep 17 00:00:00 2001 From: Alessandro Borges Date: Thu, 5 Jan 2006 11:35:56 +0000 Subject: Fix ZFunc behavior. ZFunc must work even when there is no z-buffer write enable, just as OpenGL does. git-svn-id: https://svn.java.net/svn/j3d-core~svn/trunk@494 ba19aa83-45c5-6ac9-afd3-db810772062c --- src/native/d3d/Attributes.cpp | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/native/d3d/Attributes.cpp b/src/native/d3d/Attributes.cpp index 2f099d0..8894627 100644 --- a/src/native/d3d/Attributes.cpp +++ b/src/native/d3d/Attributes.cpp @@ -574,7 +574,7 @@ void JNICALL Java_javax_media_j3d_RenderingAttributesRetained_updateNative( else { d3dCtx->zEnable = FALSE; - device->SetRenderState(D3DRS_ZENABLE, D3DZB_FALSE); + device->SetRenderState(D3DRS_ZENABLE, D3DZB_FALSE); } } @@ -582,16 +582,9 @@ void JNICALL Java_javax_media_j3d_RenderingAttributesRetained_updateNative( { d3dCtx->zWriteEnable = db_write_enable; device->SetRenderState(D3DRS_ZWRITEENABLE, db_write_enable); - if (db_write_enable) - { - device->SetRenderState(D3DRS_ZFUNC, getDepthFunc(db_func)); - //printDepthFunc(db_func); - } - else - { - // disable ZFunc if ZBuffer is disabled - device->SetRenderState(D3DRS_ZFUNC, D3DCMP_NEVER); - } + // disable ZFunc if ZBuffer is disabled ? no. + // ZFunc must work even when there is no z-buffer enable + device->SetRenderState(D3DRS_ZFUNC, getDepthFunc(db_func)); } if (at_func == javax_media_j3d_RenderingAttributes_ALWAYS) -- cgit v1.2.3