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: Texture filtering parameter that cuts out transparent material?

  1. #1
    Junior Member Newbie
    Join Date
    May 2015
    Posts
    26

    Texture filtering parameter that cuts out transparent material?

    So I had some code going that drew a nice line of dots going in a gradient from most transparent to least transparent. And this all worked great!

    Unfortunately I just added something that works like an accumulation buffer using a couple FBO's with textures. And now instead of that gradient going across the screen it goes only about a third of the way.

    This indicates that some of the transparent fragments are being discarded or something, and I suspect its a parameter on the texture that is to blame.

    Is there something that I should put in the "glTexParameteri()" function that would restore even the most transparent fragments?

    Thanks much!

  2. #2
    Senior Member OpenGL Guru
    Join Date
    Jun 2013
    Posts
    2,478
    There is no texture parameter which sets a threshold for alpha.

    Did you remember to set the viewport when switching between the window and the FBO? If they aren't the same size, you'll need to explicitly change the viewport each time; the viewport is automatically set to the bounds of the window the first time a context is bound, but doesn't change thereafter unless changed explicitly with glViewport().

    If you're accumulating by scaling the colour values prior to adding, you're losing intensity resolution, so values close to zero will be rounded to zero. If that's what's happening, there isn't really any solution other than using a texture with more bits per component (which may be a problem with OpenGL ES 2.0, as it doesn't support sized internal formats; and I don't believe the unsized formats are required to support any particular precision).

  3. #3
    Senior Member OpenGL Pro
    Join Date
    Jan 2007
    Posts
    1,716
    Have you got alpha test enabled?

Tags for this Thread

Posting Permissions

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