Sign in to follow this  

Mesh drawing?

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

Hello all, I got a problem rendering my meshes. I got a screeny under with 2 samples, the left sample is rendering of DXViewer which shows it correctly and the right is my application which doesn't draw it like I want it. My application presents some triangles of the back in front of the mesh. Left is DXViewer image, right is application image. DXViewer shows correctly. What could be causing this rendering-behavior in my application, what settings might I forgot about? Thank you, Xeile

Share this post


Link to post
Share on other sites
Quote:
Original post by vidalsasoon
are you clearing your z-buffer?

i.e:

this.D3DDevice.Clear(ClearFlags.Target | ClearFlags.ZBuffer, Color.Black, 1, 0);

p.s. i don't think clearing a zbuffer could save that nasty looking mesh!


Yep, I'm indeed clearing the target and ZBuffer every frame.

Share this post


Link to post
Share on other sites

Did you try using a mesh that was included with the SDK?

Maybe try running "Optimize" on the mesh...

i.e. mesh.OptimizeInPlace( MeshFlags.OptimizeCompact | MeshFlags.OptimizeAttributeSort, (GraphicsBuffer)null );

If those don't help, I don't know what could be wrong.

Share this post


Link to post
Share on other sites
This is a depth buffer problem.
What is your depth buffer set at?
you could try

presentParams.EnableAutoDepthStencil = true;
presentParams.AutoDepthStencilFormat = DepthFormat.D24S8;


and then also making sure your near and far plane of your projection matrix is set correctly. Usually this works if it's set at 1.0f and 1000.0f respectively.

I hope this helps.
Take care.

Share this post


Link to post
Share on other sites
Quote:
Original post by Armadon

And then also making sure your near and far plane of your projection matrix is set correctly. Usually this works if it's set at 1.0f and 1000.0f respectively.

I hope this helps.
Take care.


That was the problem, I had the nearplane set to 0.0f. On the moment you mentioned near plane, I slapped myself... Well making errors is human, I guess.

Thanks for all the help

Share this post


Link to post
Share on other sites

This topic is 4415 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.

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