Results 1 to 5 of 5

Thread: transparency

  1. #1
    Junior Member Newbie
    Join Date
    May 2001
    Location
    aulnay, france
    Posts
    19

    transparency

    help me please

    i want to display a transparent object composed by several levels of polygons. Each level is a closed ribbon of gl_triangle_strip ( so that it seems like a stack of cylinders).
    i draw my ribbons of gl_strip_triangle with :
    glBegin(GL_TRIANGLE_STRIP) ;
    for each level
    Vertices from 1 to n ;
    Vertice 1 ; //to close the ribbon

    i use blending :

    glEnable(GL_BLEND);
    glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);

    i saw in the forum, that i should sort the polygons and display them according to their z value. but my problem is here : how can i sort the triangles while :
    * i use gl_triangl_strip,
    * for the same ribbon of gl_triangle_strip, i have to pass behind or foreward the triangles i have just drawn ;

    moreover, my object is composed by nearly 20,000 triangles and i want to perform "real-time".
    how can i sort such a number of triangles and have good performances ?

    thanks
    phanie

  2. #2
    Senior Member Regular Contributor
    Join Date
    Jul 2000
    Location
    Canada
    Posts
    173

    Re: transparency

    This is a good question. I also have this problem. How do you sort the triangles?
    Another rule is to draw opaque objects fisrt and then transparent ones.
    Billy

  3. #3
    Junior Member Newbie
    Join Date
    May 2001
    Location
    aulnay, france
    Posts
    19

    Re: transparency

    Thanks for your answer.

    for the moment i don't sort the triangles 'cause i don't know how.
    currently, i display opaque object, and then transparent object. but it don't resolve my problem because when i display a transparent one i have for the same object some polygons front and some behind.
    i wondering if it is a good idea to procede with gl_triangle_strip. do you have an idea ?
    phanie

  4. #4
    Senior Member OpenGL Guru zed's Avatar
    Join Date
    Nov 2010
    Posts
    2,466

    Re: transparency

    u wont be able to sort the triangles in a strip. u will have to break the strip up into indivual triangles + use GL_TRIANGLES. also there was a paper recently on the nvidia developer website which might be of interest.

  5. #5
    Junior Member Newbie
    Join Date
    May 2001
    Location
    aulnay, france
    Posts
    19

    Re: transparency

    thanks for the information !
    phanie

Similar Threads

  1. NSOpenGLView visual transparency vs. mouse transparency
    By hidefromkgb in forum OpenGL: macOS
    Replies: 1
    Last Post: 05-12-2015, 01:05 PM
  2. transparency!
    By thasadams in forum OpenGL: Basic Coding
    Replies: 7
    Last Post: 05-27-2003, 05:54 AM
  3. transparency
    By drummerboy_2002 in forum OpenGL: Basic Coding
    Replies: 6
    Last Post: 07-28-2002, 01:22 AM
  4. OpenGL window transparency and texture transparency
    By ramalhais in forum OpenGL: Basic Coding
    Replies: 4
    Last Post: 03-15-2002, 09:37 AM
  5. Transparency
    By in forum OpenGL: Basic Coding
    Replies: 11
    Last Post: 07-05-2001, 06:03 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