[dx10]depth test doesn't work

Started by
4 comments, last by Leafteaner 15 years, 10 months ago
Hi, i first draw some nearer points, then draw some farther background lines. But when i draw them, the points are hidden by the lines (yes i can tell since the background lines are massive). What's wrong? below is the shader:

	pass points
    {
        SetVertexShader(CompileShader(vs_4_0, vsPoints()));
		SetGeometryShader(NULL);
		SetPixelShader(CompileShader(ps_4_0, psPoints()));
		SetBlendState(NoBlending, float4( 0.0f, 0.0f, 0.0f, 0.0f ), 0xFFFFFFFF);
		SetDepthStencilState(EnableD, 0);
	}
pass grids
    {
        SetVertexShader( CompileShader( vs_4_0, vsGrids() ) );
        SetGeometryShader( NULL );
        SetPixelShader( CompileShader( ps_4_0, psGrids() ) );
		SetBlendState(NoBlending, float4( 0.0f, 0.0f, 0.0f, 0.0f ), 0xFFFFFFFF);
		SetDepthStencilState(EnableD, 0);
	}
where

BlendState NoBlending
{
    BlendEnable[0] = FALSE;
    RenderTargetWriteMask[0] = 0x0F;
};
DepthStencilState EnableD
{
    DepthEnable = TRUE;
    DepthWriteMask = ALL;
	DepthFunc = LESS;
}
Thanks a lot! [Edited by - yk_cadcg on June 8, 2008 4:38:08 AM]
Advertisement
Have you created and set a depth stencil view before you draw using this technique?
Thank you! Yes. so is it weird?
Quote:Original post by Demirug
Have you created and set a depth stencil view before you draw using this technique?


Check the output values in PIX. Make sure the depth is indeed less than the value in the depth buffer (also, make sure the depth buffer is written to correctly).
Sirob Yes.» - status: Work-O-Rama.
thanks! btw, NVPerfHud is not workable under newest driver for vista dx10. i used to use an older driver and successfully use perfHud.
Quote:Original post by sirob
Check the output values in PIX. Make sure the depth is indeed less than the value in the depth buffer (also, make sure the depth buffer is written to correctly).


[Edited by - yk_cadcg on June 8, 2008 8:47:12 AM]
Quote:btw, NVPerfHud is not workable under newest driver for vista dx10. i used to use an older driver and successfully use perfHud.

Get the PerfHUD 6 Beta, works just fine with D3D10 and doesn't need an instrumented driver [smile]

This topic is closed to new replies.

Advertisement