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 3 of 3

Thread: FXAA doesn't work with alpha blending

  1. #1
    Newbie Newbie
    Join Date
    May 2014
    Posts
    2

    Question FXAA doesn't work with alpha blending

    I applied FXAA version 3.11 on my program. It works when drawing the whole texture without alpha blending (yes smooth edges).
    However when I draw on a white background (cleared with glClear), and use alpha blending with "glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA)", I can see the black pixels around the edges (the pixels that are used by FXAA to smoothen, they look black), and they don't blend with the background.
    There is some sort of problem with the color, I don't figure out how to fix. Please help.
    My full C source and fxaa shader in attachment.
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	fxaa.jpg 
Views:	46 
Size:	16.3 KB 
ID:	1329  
    Attached Files Attached Files

  2. #2
    Senior Member OpenGL Pro Ilian Dinev's Avatar
    Join Date
    Jan 2008
    Location
    Watford, UK
    Posts
    1,290
    FXAA depends on the depthbuffer iirc; your management of depth-test and depth-writes is completely nonexistent.

  3. #3
    Newbie Newbie
    Join Date
    May 2014
    Posts
    2
    Quote Originally Posted by Ilian Dinev View Post
    FXAA depends on the depthbuffer iirc; your management of depth-test and depth-writes is completely nonexistent.
    Can you clarify? How does it depend on the depthbuffer? Not the edge detection right? Because it detects normally and I know it uses luma to detect.
    I tried enabling the depth buffer in the framebuffer or disabling the depth test, nothing changes.
    What do you suggest to change?

Posting Permissions

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