Results 1 to 4 of 4

Thread: Transparency

  1. #1
    Junior Member Newbie
    Join Date
    Oct 2008
    Location
    India
    Posts
    9

    Transparency

    Dear friends,

    I have to render a model of a building which contains transparent windows and translucent glass inside the building.
    When I use the blend function, it makes the windows and glass completey transparent.
    Is there any way, so that I can render transparent windows and translucent glass simantaneously.

  2. #2
    Senior Member Frequent Contributor scratt's Avatar
    Join Date
    May 2008
    Location
    Thailand
    Posts
    555

    Re: Transparency

    When drawing multiple layers of transparency, which is what I think you want to do, you need to think about the drawing order and your depth sorting. You will also perhaps need to think about the alpha blending values you assign to colours and/or textures to get various effects.

    If you draw the windows of the building first and then the glass inside if you are using depth masking the internal glass will not be drawn as it is behind the windows of the building and as far as OpenGL is concerned (wrt to depth functions) all polygons are opaque.

    This may be of help..
    http://www.opengl.org/resources/faq/...ansparency.htm

    After that you then perhaps need to think about reflections of environments to give the effect of glass and that opens a whole pandoras box of either environment maps and / or shaders for getting reflections and refractions.

    I am not sure if you want to go quite that far for this, but let me know if you do and I can post some other links.

  3. #3
    Junior Member Newbie
    Join Date
    Oct 2008
    Location
    India
    Posts
    9

    Re: Transparency

    Thanks for the reply.

    The whole building is a mesh in obj format and I can't detect which part is drawn first. Even I am not using Depth Masking, the internal glass is not drawn or drawn completely transparent.

  4. #4
    Senior Member Frequent Contributor scratt's Avatar
    Join Date
    May 2008
    Location
    Thailand
    Posts
    555

    Re: Transparency

    Well to get things to work you are going to have to split out the various parts that make up different layers in the mesh.

    Unfortunately these kind of effects are not that simple to achieve without a bit of work on your end to draw the model in stages with different settings.

    I have not used OBJ files much, but it seems to me from this..

    http://www.royriggs.com/obj.html

    ..that if the model is made in "parts" you should be able to easily identify them.

    If you can load it in an editor and see the different parts / materials etc. then you should be able to split those out into different parts either procedurally, or by hand as OBJ is a text format.

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