Results 1 to 3 of 3

Thread: color alpha?

  1. #1
    Member Contributor
    Join Date
    May 2010
    Posts
    66

    color alpha?

    Hello,

    When I set my vertex color in my glsl vertex shader like this, it doesn't do what I expect. Specifically I expect that setting the alpha to 0 would cause the vertex to be transparent. But it isn't. The color stays there pretty visibly, and seems to get lighter. Why is that? Are they supposed to be pre-multiplied or something, where the following color might be illegal?

    colorVarying = vec4(0.3,0.1,0.75, 0.0);

    Thanks
    Bob

  2. #2
    Senior Member OpenGL Pro
    Join Date
    Jan 2012
    Location
    Australia
    Posts
    1,117
    You have to enable blending before the alpha value has an effect

    http://www.opengl.org/archives/resou...ansparency.htm

  3. #3
    Member Contributor
    Join Date
    May 2010
    Posts
    66
    Yes, it is enabled. I do see transparency, but just not how I expect. Basically I am accustomed to thinking "oh if I want a half-transparent red color, will set it to RGBA 1.0 0.0 0.0 0.5"

    But it appears that for me at least, I would have to tell openGL 0.5 0.0 0.0 0.5 to get something half transparent. Basically, with red set at 1.0, it does not seem to have much effect changing the alpha value. It looks about the same at .75 alpha as .01 alpha. It doesn't seem right to me.

    Bob

Similar Threads

  1. Alpha Texture + Color
    By Victor Hugo in forum OpenGL: Basic Coding
    Replies: 4
    Last Post: 06-04-2009, 03:06 AM
  2. Replies: 3
    Last Post: 04-24-2009, 08:59 AM
  3. GL_LINEAR for color and GL_NEAREST for alpha
    By firegun9 in forum OpenGL: Advanced Coding
    Replies: 3
    Last Post: 05-28-2007, 03:07 PM
  4. Replies: 3
    Last Post: 05-31-2003, 11:24 PM
  5. secondary color - alpha channel
    By zroobavela in forum OpenGL: Advanced Coding
    Replies: 1
    Last Post: 04-04-2002, 08:14 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