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: OGL lighting calculation erasing alpha given w/ glcolor4f ?

  1. #1
    Junior Member Newbie
    Join Date
    Apr 2004
    Location
    Paris
    Posts
    26

    OGL lighting calculation erasing alpha given w/ glcolor4f ?

    Hi all,
    I'm rendering an heightmap with gouraud shading.
    I'm trying to begin the texturing part.
    I'm doing several pass to blend the different textures and i'm using alpha blending to fade them.
    Each point have it's own alpha coeficient.
    With the lights disabled there is no problem.
    But it seems that the OpenGL lighting calculation is overwriting the colors i have sets with a glColor4f when the lights are enabled.
    I can obtain the result i want with one more pass , but i'm sure there is a way to keep my alpha component even with the OGL lighting.
    (i'm using vertex array : blocks of 9x9 vertices, 128 triangles and i only change the Color Array and the bindtexture between each pass).

    Any help would be appreciated.
    "This is not a signature ..."

  2. #2
    Junior Member Newbie
    Join Date
    Apr 2004
    Location
    Paris
    Posts
    26

    Re: OGL lighting calculation erasing alpha given w/ glcolor4f ?

    glEnable(GL_COLOR_MATERIAL); is my friend ^^
    found the solution somewhere on this forum...

    thx anyway ^^
    "This is not a signature ..."

Posting Permissions

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