Jump to content
  • Advertisement
Sign in to follow this  
n3Xus

[DX10] Rendering depth

This topic is 3569 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

this was probably asked before but search found nothing usefull :S so, how do I read the depth buffer in order to render the depth of the scene? i have a fullscreen quad, in the depth stencil desc i put .BindFlags=D3D10_BIND_DEPTH_STENCIL|D3D10_BIND_SHADER_RESOURCE; , this is how i create the depth stencil shader resource view: note: ptdepth is the texture2d i use to create the depth stencil view
// Create Depth shader resource view
	D3D10_SHADER_RESOURCE_VIEW_DESC dSRV;
	ZeroMemory(&dSRV,sizeof(D3D10_SHADER_RESOURCE_VIEW_DESC));
	dSRV.Format=DXGI_FORMAT_R32_FLOAT;
	dSRV.ViewDimension=D3D10_SRV_DIMENSION_TEXTURE2D;
	dSRV.Texture2D.MipLevels=1;
	dSRV.Texture2D.MostDetailedMip=0;

	device->CreateShaderResourceView(ptdepth,&dSRV,&m_pDSRV);

than i bind this shader resource view to my effect file so it is applied to the fullscreen quad. i have only one render target now (and i'm not sure if i should made more of them :S). can someone please write or link me the steps necessary to display the zbuffer on the screen?

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!