Results 1 to 7 of 7

Thread: Trasparency without blending and alpha

  1. #1
    Junior Member
    Join Date
    Jun 2004
    Posts
    7

    Trasparency without blending and alpha

    Hi All,

    I have taken some teapot data and I am trying to render it using OpenGL ES using vertex array. I can see that the teapot is looking trasparent, though I have disabled blending and alpha tests.

    Can some one tell me if there is any other reason to see a transparent image. Could the order of the vertices have anything to with this ?

    Thanks & regards,
    Neelima

  2. #2
    Senior Member
    Join Date
    Sep 2003
    Location
    Seattle, WA
    Posts
    246

    Re: Trasparency without blending and alpha

    Is this refering to the reference implementation?

  3. #3
    Junior Member
    Join Date
    Jun 2004
    Posts
    7

    Re: Trasparency without blending and alpha

    Hi,

    I've taken the data from the KLimt teapot example and I am using the reference implementation for rendering. I've disabled blending.

    The rim of top lid of the teapot is visible when the teapot is rotated upside down also...

    Thanks & regards,
    Neelima

  4. #4
    Junior Member
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    6

    Re: Trasparency without blending and alpha

    This seems to be a depth test issue.
    Have you enabled it?
    Marco Di Benedetto

  5. #5
    Junior Member
    Join Date
    Jun 2004
    Posts
    7

    Re: Trasparency without blending and alpha

    Hi !

    I had not enabled the depth test . When I enable it with GL_LEQUAL or GL_GEQUAL as the depth func only part of the teapot is visible. But when I enable GL_NOTEQUAL, most of the teapot is visible with the same trasparency problem.

    The same data is working fine in KLimt, the only difference being the commands used in KLimt are Vertex3fv and Normal3fv where as I am using VertexPointer and NormalPointer.

    Thanks & regards,
    Neelima

  6. #6
    Junior Member
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    6

    Re: Trasparency without blending and alpha

    Set the depth test function to GL_LESS (default):
    glDepthFunc(GL_LESS);

    Enable depth test:
    glEnable(GL_DEPTH_TEST);

    and, at every frame, remember to clear the depth buffer (and, if it's your case, color buffer )
    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

    Make you sure that the EGLConfig you are using has a depth buffer.

    There's no matter how you are sending geometry data to the GL pipeline: glVertex* or glVertexPointer achieve the same effect.

    Regards.
    Marco Di Benedetto

  7. #7
    Junior Member
    Join Date
    Jun 2004
    Posts
    7

    Re: Trasparency without blending and alpha

    Dear Marco !

    Thanks a lot It solved the problem. I wasnt clearing the depth buffer each time, that was probably responsible for the partial images in the later frames.
    Enabling depth test & clearing properly solved the problem.

    Thanks again

    Best regards,
    Neelima

Similar Threads

  1. glClear alpha vs geometry alpha -- blending result confusin
    By jasontrice in forum OpenGL ES 2X - for programmable 3D graphics pipelines
    Replies: 3
    Last Post: 06-16-2011, 11:51 AM
  2. Source Alpha Blending without an Alpha Buffer
    By niallm in forum OpenGL ES general technical discussions
    Replies: 1
    Last Post: 06-18-2009, 01:51 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
  •