Jump to content
  • Advertisement
Sign in to follow this  
sofakng

Why are my simple triangles sometimes very jagged? (screenshots inside)

This topic is 4177 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 trying to draw a bunch of triangles (using a Delphi DirectX v9.0 wrapper called Asphyre) and I noticed that sometimes my triangles are very jagged. It seems like the triangle is more or less jagged depending on the angles used to create the triangle. What is causing this and how can I smooth it out? Here are three examples: Both sides are jagged: Only the right side is jagged: No sides are jagged (everything is smooth) EDIT: These forums use regular HTML 'img' tags to include images in forum posts... [Edited by - jollyjeffers on June 13, 2007 8:36:37 AM]

Share this post


Link to post
Share on other sites
Advertisement
Looks like a standard case of spacial aliasing. I'm sure you've heard of MSAA - "Multisample Anti-Aliasing"? Gamers love it [smile]

As a test, go into your GPU's control panel and set it to force a level of MSAA on your application, 2x or 4x should be sufficient. Most hardware and drivers of the last few years will have an override capability.

Once this is done, re-run your app and see if it's improved. Assuming it has, do some reading on MSAA and set up your application to request it be enabled on start-up [smile]

hth
Jack

Share this post


Link to post
Share on other sites
Thanks for the information...

It just seems like a lot of games I play don't require turning on MSAA/FSAA (are they the same thing?) in order to have the game look good. I guess it's possible they are turning on MSAA behind the scenes without telling me, but are there any tricks for not requiring MSAA/FSAA?

I've tried out every MSAA/FSAA setting on my triangle image and it definitely helps a TON. However, it seems like I need at least 4x for it to look "good".

Here is a screenshot of the image with every different antialiasing available:
http://farm2.static.flickr.com/1112/543942868_f31b4070e5_o.png
(I didn't inline the image because its fairly big [resolution, not file size])

Here is a link to the flickr page for the screenshot (for viewing different sizes of the image, etc):
http://farm2.static.flickr.com/1112/543942868_f31b4070e5_o.png

Share this post


Link to post
Share on other sites
Quote:
Original post by sofakng
Thanks for the information...

It just seems like a lot of games I play don't require turning on MSAA/FSAA (are they the same thing?) in order to have the game look good.

You've got pretty much the worst case for showing aliasing in your image above - a long, straight edge with high contrast. A typical game is probably much lower contrast, and when you've got lots of texture and lighting detail it'll be less noticable too.

Theres a few less heavyweight hacks you can do as well - polygon smoothing will antialias the edges of polys and is good for vector graphics, but will require sorting your polys for correct results. You may also be able to do tricks with textures and blending to remove some edges as well.

Share this post


Link to post
Share on other sites
I'm planning to make a retro vector-based (that's the art style I'm going for) game so would polygon smoothing work for me?

Actually all I really want to do is render a really nice polygon to a bitmap (eg. render target/texture). After it's generated I'll just draw the texture and won't have to worry about antialiasing.

Can I do this somehow in software? (eg. enable software 8x antialiasing, render the polygon to a render target/texture, and then disable software 8x antialiasing)

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!