Modify the Mirror demo in the following way. First draw a wall with the following depth settings:
depthStencilDesc.DepthEnable = false;
depthStencilDesc.DepthWriteMask = D3D10_DEPTH_WRITE_MASK_ALL;
depthStencilDesc.DepthFunc = D3D10_COMPARISON_LESS;
Next, draw a box behind the wall with these depth settings:
depthStencilDesc.DepthEnable = true;
depthStencilDesc.DepthWriteMask = D3D10_DEPTH_WRITE_MASK_ALL;
depthStencilDesc.DepthFunc = D3D10_COMPARISON_LESS;
Does the wall occlude the box? Explain. What happens if you use the following to draw the wall instead?
depthStencilDesc.DepthEnable = true;
depthStencilDesc.DepthWriteMask = D3D10_DEPTH_WRITE_MASK_ALL;
depthStencilDesc.DepthFunc = D3D10_COMPARISON_LESS;
Note that this exercise does not use the stencil buffer, so that should be disabled.
I have modified correctly as mentioned but i am not getting expected result.
what i had expected was that In first case since Wall depthTest is false and it will not update depthBuffer, box will shown and
in second case box will be hide by wall because wall is closer to camera.
but in actual the in both cases wall is occluding the box. why is that?
(Please excuse my poor english)