Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: GL_POLYGON_SMOOTH creates bad lines



On Sep 17, 2004, at 12:26 PM, Lorenzo wrote:
when I set

    glShadeModel(GL_SMOOTH);
    glEnable(GL_POLYGON_SMOOTH);

I see on my mapped QUAD, some gray diagonal lines over the map.
How can I eliminate those lines?

Polygon smooth with blendfunc (SRC_ALPHA, SRC_ALPHA_MINUS_ONE) creates seams along quad diagonals, because quads are broken into two triangles for rendering. You can get around this by using blendfunc (SRC_ALPHA_SATURATE, GL_ONE), as described at http://www.edm2.com/0603/opengl.html


The problem with POLYGON_SMOOTH (or any other approach that relies on blending) is that it doesn't work well with the Z buffer. Depth-independent transparency is a non-trivial problem (consider what happens with intersecting objects.) There may be some good solutions for certain cases, but it depends on what you need to draw in your scene. For example the border suggestions I gave earlier work well for 2D, but not 3D.

Yes, Alex gave me a solution, that is the FSAA, but it requires 4x of VRAM
and fill rate, so I suppose it should slow down the animation speed. If you
instead think it's good for animations too, please let me know, so I will go
to study that topic (I already gave it a look and it seems to be hard...).

FSAA is a good general solution because it works with any scene and doesn't require blending. It is also very easy to set up, just add the sample buffers attribute to your pixel format and enable multisampling. See this Q&A: http://developer.apple.com/qa/qa2001/qa1268.html


The downside of FSAA is that the quality is relatively low for the added VRAM/fillrate overhead. My scenes require compositing multiple 2D framebuffers, so FSAA wasn't the best solution for me. It might be fine for you, it depends on what you're trying to draw.

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Mac-opengl mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/mac-opengl/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.