Results 1 to 2 of 2

Thread: Color masking/changing of textures

  1. #1
    Junior Member Newbie
    Join Date
    Mar 2007

    Color masking/changing of textures


    I have several images that have black background, and then white images. I want to be able to change the color of the white part based upon different variables in my program. The only way I have figured out how to do this is to use glColorMask() and the problem with this is that the color that replaces the white is not constant because it is dependent upon what is drawn under it.

    is there any simple way to change the white in the texture to a color of choice?


  2. #2
    Senior Member OpenGL Pro k_szczech's Avatar
    Join Date
    Feb 2006

    Re: Color masking/changing of textures

    Simply use glColorMask but first draw the color you want behind it.
    I would probably use textured quad whth alpha test enabled and non-textured quad behind.

Similar Threads

  1. color masking a glTexSubImage2D call
    By mh104 in forum OpenGL: Advanced Coding
    Replies: 3
    Last Post: 09-04-2009, 02:09 PM
  2. Transparency/color masking blending help!!
    By RS543 in forum OpenGL: Advanced Coding
    Replies: 0
    Last Post: 04-06-2009, 08:20 PM
  3. Masking to show player color....problem please help
    By glBomb in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 12-28-2006, 01:24 AM
  4. Color Masking
    By Rodrix in forum OpenGL: Basic Coding
    Replies: 6
    Last Post: 10-04-2006, 08:19 AM
  5. Clearing and masking color attachments using FBOs and DBs
    By gamefreedom in forum OpenGL: Advanced Coding
    Replies: 3
    Last Post: 05-29-2006, 09:45 AM

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