Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 2 of 2

Thread: Anti-aliasing with fragment shaders and textures

  1. #1
    Intern Newbie
    Join Date
    Apr 2011
    Posts
    38

    Anti-aliasing with fragment shaders and textures

    I have a texture mapped object that I am putting through a fragment shader. The original texture mapped to the object is anti-aliased, but I think that the fragment shader only works on the pixel level. So in my case, if I have an anti-aliased line, half the pixel might be black and half of it white. My fragment shader should act on black pixels, but I only want to apply it to the part of the pixel that is actually black. Is that possible?

  2. #2
    Senior Member OpenGL Guru
    Join Date
    May 2009
    Posts
    4,948
    Textures do not have parts of texels. Textures don't know if they're "anti-aliased" or not. They're just images. Half the texel can't be black, because a texel can only be one color at a time. If the texel was created from half-black and half-white, it is now grey. And it doesn't magically remember that it was created from half-black and half-white.

    Unless you're using a multisample texture, but accessing them requires texelFetch anyway.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •