Jump to content
  • Advertisement
Sign in to follow this  
Bangladesh

Strange artifacts in DX10

This topic is 3904 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
Advertisement
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
Direct3D 10 doesn’t create a default depth buffer for you. Tutorial 5 shows how you create and set a depth buffer.

Share this post


Link to post
Share on other sites
Thanks all, the depth-buffer was the problem, or rather, the lack of one was the problem. Silly problem, should have read the tutorial more carefully. =)
Anyway, thanks again!

Share this post


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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!