Jump to content

  • Log In with Google      Sign In   
  • Create Account

Awesome job so far everyone! Please give us your feedback on how our article efforts are going. We still need more finished articles for our May contest theme: Remake the Classics

#Actualfurqantariq

Posted 13 July 2012 - 11:00 AM

I'm reading 'introduction to D3D10' by Frank Luna. I have problem in solving first exercise of ninth chapter 'stenciling', which is following

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)


#1furqantariq

Posted 13 July 2012 - 10:58 AM

I'm reading 'introduction to D3D10' by Frank Luna. I have problem in solving first exercise of ninth chapter 'stenciling', which is following

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;


D

oes 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)


PARTNERS