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

Thread: texturing with transparency

  1. #1
    Intern Contributor
    Join Date
    Feb 2011
    Posts
    50

    texturing with transparency

    Whats the best way of texturing an a polygon whilst making certain sections of the textured polygon transparent.

    Are the only two ways possible using a texture with an alpha channel or loading your rectangle texture and then making certain colours transparent.

    Please can you recommend the fastest and easiest way

  2. #2
    Senior Member OpenGL Guru Dark Photon's Avatar
    Join Date
    Oct 2004
    Location
    Druidia
    Posts
    2,882

    Re: texturing with transparency

    The traditional way is to use a texture with an alpha channel.

    Is there some concern you have regarding that approach?

  3. #3
    Member Regular Contributor Rosario Leonardi's Avatar
    Join Date
    Aug 2008
    Location
    Italy
    Posts
    352

    Re: texturing with transparency

    Using alpha channel you have no memory impact (the pixel are always stored aligned at 32 bit) the only overload is on the disk.
    Is faster and hardware usually make optimization, you can also use advanced technique like alpha to coverage. Alpha can vary from 0 to 255 making the transition smooth.

    Choosing one color to be transparent you have ma add instruction to your shader (slower) and can't make smooth transition.
    I don't see any advantage using this technique.
    ~ ~ I tell you, realtime 3D is made of blood, sweat and screams! ~ ~

  4. #4
    Senior Member OpenGL Guru Dark Photon's Avatar
    Join Date
    Oct 2004
    Location
    Druidia
    Posts
    2,882

    Re: texturing with transparency

    Quote Originally Posted by Rosario Leonardi
    Using alpha channel you have no memory impact (the pixel are always stored aligned at 32 bit)
    That depends on the texture formats you choose. You're probably just thinking about RGB8 vs. RGBA8.

Posting Permissions

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