Results 1 to 3 of 3

Thread: how to show a bitmap texture without the black background?

  1. #1
    Guest

    how to show a bitmap texture without the black background?

    Hi there. I have the following problem: How does one get a bitmap onto the screen without the black background of the image being shown? I've tried alpha-blending and it works for the black parts but also the rest of the image now looks transparent. What's going wrong with it?

  2. #2
    Senior Member Regular Contributor
    Join Date
    Feb 2000
    Posts
    154

    Re: how to show a bitmap texture without the black background?

    Try enabling alpha testing instead of blending.

  3. #3
    Member Contributor
    Join Date
    May 2001
    Location
    Malaysia
    Posts
    54

    Re: how to show a bitmap texture without the black background?

    There's nothing wrong with your alpha-blending. Your problem is, each pixel of your texture has the same alpha value. You need to put alpha value=0 to each black pixel in your texture and alpha value=1 for the rest of them. After that, you can enable the alpha-blending.

    The easy way to do that is to find any software that can convert 24-bit BMP to 32-bit BMP and set alpha value=0 to black area of your texture. Or go to NeHe site and see tutorial on masking.

Similar Threads

  1. Replies: 13
    Last Post: 08-19-2014, 07:06 PM
  2. How to make text show up against black background.
    By martinb0820 in forum OpenGL: Basic Coding
    Replies: 7
    Last Post: 01-05-2011, 11:58 AM
  3. remove black background from texture
    By Akez42 in forum OpenGL: Advanced Coding
    Replies: 3
    Last Post: 05-31-2009, 03:50 PM
  4. Replies: 0
    Last Post: 08-02-2006, 09:24 PM
  5. Making black background transparent in RGB texture
    By alan e in forum OpenGL: Advanced Coding
    Replies: 4
    Last Post: 06-29-2004, 02:57 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean