# furqantariq

Members

3

111 Neutral

• Rank
Newbie
1. ## Understanding Depth Testing

Now i got it. Thank you very much.
2. ## Understanding Depth Testing

I'm reading 'introduction to D3D10' by Frank Luna. I have problem in solving first exercise of ninth chapter 'stenciling', which is following [left]Modify the Mirror demo in the following way. First draw a wall with the following depth settings:[/left] [left][background=rgb(192, 192, 192)]depthStencilDesc.DepthEnable = false;[/background][/left] [left][background=rgb(192, 192, 192)]depthStencilDesc.DepthWriteMask = D3D10_DEPTH_WRITE_MASK_ALL;[/background][/left] [left][background=rgb(192, 192, 192)]depthStencilDesc.DepthFunc = D3D10_COMPARISON_LESS;[/background][/left] [left]Next, draw a box behind the wall with these depth settings:[/left] [left][background=rgb(192, 192, 192)]depthStencilDesc.DepthEnable = true;[/background][/left] [left][background=rgb(192, 192, 192)]depthStencilDesc.DepthWriteMask = D3D10_DEPTH_WRITE_MASK_ALL;[/background][/left] [left][background=rgb(192, 192, 192)]depthStencilDesc.DepthFunc = D3D10_COMPARISON_LESS;[/background][/left] [left]Does the wall occlude the box? Explain. What happens if you use the following to draw the wall instead?[/left] [indent=1][size=4][background=rgb(192, 192, 192)][color=#000000]depthStencilDesc.DepthEnable = true; depthStencilDesc.DepthWriteMask = D3D10_DEPTH_WRITE_MASK_ALL; depthStencilDesc.DepthFunc = D3D10_COMPARISON_LESS;[/color][/background][/size][/indent] [left]Note that this exercise does not use the stencil buffer, so that should be disabled.[/left] [left]I have modified correctly as mentioned but i am not getting expected result.[/left] [left]what i had expected was that In first case since Wall depthTest is false and it will not update depthBuffer, box will shown and[/left] [left]in second case box will be hide by wall because wall is closer to camera.[/left] [left]but in actual the in both cases wall is occluding the box. why is that?[/left] [left](Please excuse my poor english)[/left]