Results 1 to 2 of 2

Thread: Semi-transparent blending?

  1. #1
    Junior Member Newbie
    Join Date
    Apr 2003
    Posts
    3

    Semi-transparent blending?

    My goal is to render semi-tranparent geometry using a texture's alpha values. In the texture's alpha channel, black is transparent, white is opaque, and everything in between is partially transparent. I am having trouble with the in between part. It seems like any alpha value that is not totally white is completely transparent.

    My blending function is:
    glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA)

    I am working in windows and I am curious if the cAlphaBits field of the pixelformatdescriptor is important. Changing it from 0 to 8 had no effect. Is there some obvious setting in OpenGL that I am forgetting? Can OpenGL even do this kind of blending?

    Thanks in response,

    Von

  2. #2
    Senior Member OpenGL Guru
    Join Date
    Jun 2000
    Location
    Gastonia, NC, USA
    Posts
    2,068

    Re: Semi-transparent blending?

    You that is now most people do it, I would have to see how you are setting the alpha channel.

    but you can just use the glcolor4f(r,g,b,a) to set the object alpha

    a = 1.0 non-transparent, 0.0 transparent, 0.5 simi-transparent.


    Originally posted by von:
    My goal is to render semi-tranparent geometry using a texture's alpha values. In the texture's alpha channel, black is transparent, white is opaque, and everything in between is partially transparent. I am having trouble with the in between part. It seems like any alpha value that is not totally white is completely transparent.

    My blending function is:
    glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA)

    I am working in windows and I am curious if the cAlphaBits field of the pixelformatdescriptor is important. Changing it from 0 to 8 had no effect. Is there some obvious setting in OpenGL that I am forgetting? Can OpenGL even do this kind of blending?

    Thanks in response,

    Von

Similar Threads

  1. Semi-transparent texture
    By devdept in forum OpenGL: Advanced Coding
    Replies: 7
    Last Post: 09-22-2008, 05:27 PM
  2. Rendering semi transparent
    By 0stress in forum OpenGL: Basic Coding
    Replies: 4
    Last Post: 07-01-2006, 12:50 PM
  3. Rendering semi transparent
    By 0stress in forum OpenGL: GLSL
    Replies: 1
    Last Post: 06-27-2006, 01:08 PM
  4. semi-transparent texture
    By lawrencesuniga in forum OpenGL ES
    Replies: 0
    Last Post: 11-08-2005, 08:40 PM
  5. Semi transparent texture
    By NOAH IV in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 02-10-2001, 11:49 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