Advertisement Jump to content
Sign in to follow this  

Lines Render On Top?

This topic is 4204 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
Hmm, well I do have a depth buffer:

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;

...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
Sign in to follow this  

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!