High Quality Anti-Aliased Real Time Contours in OpenGL

High Quality Anti-Aliased Real Time Contour in OpenGL



Here is a method to get nice anti aliased contours (useful for displaying text for example) without the need for a big binary alpha map (like 4096×4096).

Stefan Gustavson has developed a distance transform method that takes an anti-aliased alpha map as input and computes a distance field with accurate sub-pixel resolution, without the need for a 4K+ binary alpha map—a modestly sized alpha map rendered with proper AA is enough.

A demo with full source code (OpenGL + GLSL) is available HERE.

And the method seems to work rather well:

High Quality Anti-Aliased Real Time Contour in OpenGL

High Quality Anti-Aliased Real Time Contour in OpenGL

High Quality Anti-Aliased Real Time Contour in OpenGL

[via]

6 thoughts on “High Quality Anti-Aliased Real Time Contours in OpenGL”

  1. zqueezy

    well, I get some really weird artifacts when rotating the plane…
    GeForce 8800 GTS, Windows 7

  2. rcohen

    Very cool!

    I’m seeing nasty rotation artifacts on NVidia cards, but not ATI. Any idea what’s causing the NVidia problem and/or how to fix it?

  3. david

    It also doesn’t handle minimization well. I.e. some flickering and the white background becomes grey-background. With the dragon texture black becomes grey. Probably something related to mipmaping but i’m not sure as I haven’t read the paper or the source yet.

    Color-mixing or flickering doesn’t happen with the dolphin texture.

    I also get artifacts when rotating Geforce 8800 gtx-Win vista here.

  4. Stefan Gustavson

    If you could only post these questions to the forum on contourtextures.wikidot.com, I will be happy to answer them. The artefacts are not inherent to the method, they are a side effect of my pretty ugly demo which was thrown together too quickly. But as I said, please use the dedicated forum if you have specific support questions!

  5. Stefan Gustavson

    I have posted the questions and the answers to the wikidot forum, so you don’t have to go to the trouble of asking. Thanks for the comments, and the bug reports. I didn’t have easy access to Nvidia hardware to test this when I wrote it.

Comments are closed.