• Advertisement
Sign in to follow this  

Lines Render On Top?

This topic is 3877 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

Hey, I have this minor problem. When I render my lines, no matter whether its before or after my geometry, it always renders the lines on top. I would like for the lines to be rendered depending on thier depth. I'm rendering my geometry with multiple vertex buffers using DrawIndexPrimitives as my call. For the lines however, I'm using DrawUserPrimitives. I don't know what else I could tell you. Is there some paramater i need to set? Maybe its a problem with the backbuffer?

Share this post


Link to post
Share on other sites
Advertisement
Hmm, well I do have a depth buffer:

[SOURCE]
presentParams.Windowed = true;
presentParams.SwapEffect = SwapEffect.Discard;
presentParams.BackBufferFormat = DXdisplay.Format;
presentParams.EnableAutoDepthStencil = true;
presentParams.AutoDepthStencilFormat = DepthFormat.D16;
presentParams.PresentationInterval = PresentInterval.Immediate;
presentParams.MultiSample = MultiSampleType.NonMaskable;
presentParams.MultiSampleQuality = 0;
[/SOURCE]


...and my backface culling is set to counter-clockwise. I am clearing the depthbuffer and i have the z and w buffer enabled.

DXdevice.RenderState.ZBufferEnable = true;
DXdevice.RenderState.UseWBuffer = true;

Share this post


Link to post
Share on other sites
aha! got it... depth bias was set a little too high. Thanks for pointing me in the right direction though. :D

Share this post


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

  • Advertisement