Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Kekko

Triangles only partially drawn

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

This is kind of silly, because I've had this problem before, but this time around I just can't solve it. You see, where my two triangle are supposed to be drawn like this: *************** *************** *************** *************** *************** *************** *************** It's instead drawn like this: ***----------- *-----------** ---------***-- ------***----- ---**--------- --------***--- *------------- (Where - is empty space) It kinda looks like it's drawing from an uninitialized buffer full of junk. Where should I look for errors? [edited by - Kekko on June 6, 2004 7:28:33 AM]

Share this post


Link to post
Share on other sites
Advertisement

Most common reason: Make sure you''re clearing the Z buffer in your Clear(..) call. Do the same with stencil buffers if you used those.

If the empty pixels are like a zig-zag/sawtooth pattern, then it indicates you''re stressing the available range of the z buffer too much. Try increasing the near clip plane and decreasing the far clip plane values of your projection matrix by an amount that makes sense for the units your world uses.

Also carefully check any alpha test settings you''re using.

Finally it can be useful to determine if it''s truly "empty" space or black pixels - change the colour you clear the backbuffer to (again, in the Clear(..) call) to something bright.


Simon O''Connor
Game Programmer &
Microsoft DirectX MVP

Share this post


Link to post
Share on other sites
I recognized the error as soon as I saw your post. I forgot to clear the z-buffer.
Now everything works just as it's supposed to do! Thanks!

[edited by - Kekko on June 6, 2004 8:45:03 AM]

Share this post


Link to post
Share on other sites

  • 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!