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: render only non-black pixels

  1. #1
    Intern Newbie
    Join Date
    Feb 2012
    Posts
    32

    render only non-black pixels

    how can i render only non-black pixels in a texture (bmp)???
    Alpha testing//?

    And I know you can mask, but isnt there another less expensive way??

  2. #2
    Member Regular Contributor
    Join Date
    Jan 2012
    Location
    Germany
    Posts
    325
    You can give the texture an additional alpha channel, or test the color in your fragment shader and discard those fragments. To give a good advice, you have to tell us what OpenGL version you're targeting, and what you want to do exactly. Are shaders an option? Will the texture get filtered (will there be semi-transparent parts)? Do you have a lot of those textures so sorting (for alpha blending) could become a problem or is it just one texture for a GUI with fixed size? Is there a special reason to use one color as the alpha (e.g. image size, if so, why not compressed textures?) etc. etc.

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
  •