Sign in to follow this  
n3Xus

[DX10] Rendering depth

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this