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 3 of 3

Thread: a question about "the official guide to opengl ver1.2" on texture3d

  1. #1
    Junior Member Newbie
    Join Date
    Aug 2004
    Location
    shanghai,PRC
    Posts
    16

    a question about "the official guide to opengl ver1.2" on texture3d

    There is an example on texture3d named "texture3d.c" (example 9-4) in that "Red Book".That example describes how to use the 3d texture.However, when I changed the array of texture to the format of RGBA,instead of the RGB in the example, and at the same time, set the alpha to zero, the image still displayed on the framebuffer.Why? I am puzzled...

  2. #2
    Member Regular Contributor CrazyButcher's Avatar
    Join Date
    Jan 2004
    Location
    Germany
    Posts
    402

    Re: a question about "the official guide to opengl ver1.2" on texture3d

    did you enable blending ? like

    glEnable(GL_BLEND)
    glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA)

    that will make your alpha values transparent

    however if you just want to have full opaque/ full transparent, use

    glEnable(GL_ALPHATEST)
    glAlphaFunc(GL_GREATER, 0)

    then only fragments with alpha greater zero will pass, and this is faster than blending. Also wont require a depth sort as blend would

  3. #3
    Intern Contributor
    Join Date
    Oct 2004
    Location
    Thailand
    Posts
    83

    Re: a question about "the official guide to opengl ver1.2" on texture3d

    Help me!

    // WORLD MESH
    glNewList(WORLD_GLOBE, GL_COMPILE);
    WorldObj := gluNewQuadric();
    for i := 0 to WORLD_MESH-1 do
    begin
    glBegin(GL_TRIANGLES);
    ... // World mesh is here
    glEnd();
    end;
    glEndList();

    // ROOM MESH
    glNewList(ROOM_GLOBE, GL_COMPILE);
    RoomObj := gluNewQuadric();
    glEnable(GL_BLEND); // ***TRANSPARENT THE ROOM
    for i := 0 to ROOM_MESH-1 do
    begin
    glBegin(GL_TRIANGLES);
    ... // Room mesh is here
    glEnd();
    end;
    glDisable(GL_BLEND);
    glEndList();

    // GIRL MODEL INCLUDE BONE SYSTEM...
    glNewList(GIRL_GLOBE, GL_COMPILE);
    GirlObj := gluNewQuadric();
    for i := 0 to GIRL_MESH-1 do
    begin
    glBegin(GL_TRIANGLES);
    ... // GIRL MODEL IS HERE...
    glEnd();
    end;
    glEndList();

    The world model is show completed but the girl model is run into the glass room the girl model not show. WHY? WHAT HAPPEN? HELP ME...
    Put AI system into human robot.

Posting Permissions

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