Sign in to follow this  

Strange artifacts in DX10

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

I'm drawing a model, loaded from a parced .x-file and put into a vertex-buffer. This buffer only contains position and normal-data. When I draw this in DX10 with a effect, I get strange results: http://www.paperbag.se/images/strange.jpg As you can see, the arm, for example, (supposed to be hidden) is partial showing somewhat through the body which is semi-transparent. The same error appears on the leg. Does someone know what this is? Have anyone else had this problem? I'm guessing it got something to do with the Z-ordering, but how does one set that in DX10?

Share this post


Link to post
Share on other sites
Ahem... no. I'm embarrased to say that I thought that DX10 worked somewhat like DX9 in that regard that there was one already from the start when you created the device.

I guess that isn't the case then? ;)
You think it has something to do with the depth-buffer and z-ordering then?

Share this post


Link to post
Share on other sites
Yeah, I had the same situation. As Demirug said, you need to set your depthstencilstate, either in shader-code (as below) or in your DX10-code:

DepthStencilState EnableDepth
{
DepthEnable = TRUE;
DepthWriteMask = ALL;
DepthFunc = LESS_EQUAL;
};

technique10
{
...
SetDepthStencilState( EnableDepth, 0 );
};

Share this post


Link to post
Share on other sites

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