Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: Transparency

  1. #1
    Advanced Member Frequent Contributor
    Join Date
    Dec 2005
    Location
    Italy
    Posts
    656

    Transparency

    We currently do accurate transparency using BSP. Is there any more simple way to do it with shaders?

    Thanks,

    Alberto

  2. #2
    Junior Member Regular Contributor tksuoran's Avatar
    Join Date
    Mar 2008
    Location
    United Kingdom
    Posts
    200

    Re: Transparency

    You could look for order independent transparency, you can find things like:

    http://developer.download.nvidia.com...pthPeeling.pdf

  3. #3
    Advanced Member Frequent Contributor
    Join Date
    Dec 2005
    Location
    Italy
    Posts
    656

    Re: Transparency

    Thanks, is this what most recent 3D graphics program use for transparency? Do you know any famous 3D graphics program using this approach, we would like to see it in action.

    Alberto

  4. #4
    Junior Member Regular Contributor tksuoran's Avatar
    Join Date
    Mar 2008
    Location
    United Kingdom
    Posts
    200

    Re: Transparency

    Sorry, I don't know. I have the impression that this kind of approaches are not yet common, and they may still be expensive.

  5. #5
    Super Moderator OpenGL Lord
    Join Date
    Dec 2003
    Location
    Grenoble - France
    Posts
    5,655

    Re: Transparency

    Only recently I learned about the "weighted average" fast approximation, I find it is a neat trick if perfect results are not needed :
    http://www.slideshare.net/acbess/ord...y-presentation

  6. #6
    Advanced Member Frequent Contributor
    Join Date
    Dec 2005
    Location
    Italy
    Posts
    656

    Re: Transparency

    Very nice and clear, thanks a lot ZbuffeR!

  7. #7
    Member Regular Contributor
    Join Date
    Dec 2007
    Posts
    250

    Re: Transparency

    I recently had a go at the weighted average transparency. My conclusion was it works .. but is not without problems. Frankly it turned out to be a waste of time. Dual depth peeling works, but it's real slow unless you have super high end hardware, and how can you know arbitraryly how many passes you might need?

    To be honest if you have your data already layed out in a binary space partition tree. Go with that..

  8. #8
    Super Moderator OpenGL Lord
    Join Date
    Dec 2003
    Location
    Grenoble - France
    Posts
    5,655

    Re: Transparency

    dukey, what sort of problems did you have with WAT ?

  9. #9
    Member Regular Contributor
    Join Date
    Dec 2007
    Posts
    250

    Re: Transparency

    Well for starters if you have 2 transparency values over 0.5 the result is wrong. It blends them together you totally lose the feeling one object being in front of another. The more objects you have like this, the worse it gets. I had other problems where in my project where i was blending shadows over reflections. If the reflection opacity value was zero or close to zero, you could see the reflection still somehow in the shadow. The problem of zero opacity. Screws the maths somewhat. Then theres the fact well in the nvidia sample code anyway it requires the scene have a constant clear colour. Ie you couldn't blend over a scene with a non uniform colour. I did figure out a method I was going to use to solve this, but since the above didn't work out so well I just scrapped the whole thing. I think the nail in the coffin for me was the fact that the last generation of ATI cards has shocking support for floating point blends. RGB float 16 kinda worked, although every poly had a poly crack. rgbf32 didn't work at all with blending.

    So a failed experiment.

    My conclusion was, BSP is where it's at. Pitty most model formats aren't actually BSP trees. Maybe the model format I should have chosen for my own project should have been quake bsp trees !

  10. #10
    Senior Member OpenGL Guru Dark Photon's Avatar
    Join Date
    Oct 2004
    Location
    Druidia
    Posts
    2,882

    Re: Transparency

    Besides multi-pass depth peeling approaches, there's also been some papers/presentations out recently doing A-buffers on the GPU. Essentially single-pass OIT (with some constraints). For instance, there was a cool presentation last year at SIGGRAPH doing smoke/clouds/translucent volume shadows (google Adaptive Volumetric Shadow Maps). Stores a few samples per fragment to represent a piecewise-linear visibility function. I think ATI's OIT demo a year or so ago did A-buffer too (google ATI OIT to get right to it). That said, I personally haven't implemented A-buffer on the GPU yet. Let me know how it goes!

    But seriously, it's worth giving a serious think to how translucency occurs in and can be constrained in your world. With just a few assumptions/limits, you may find you don't need some super-fancy sub-pixel-sorted-blending-accurate technique that handles intersecting triangles between or within objects or arbitrary volumetric transparency with full refraction, internal reflections, subsurface scattering, and cross-translucent-volume global illumination lighting interactions. Ray tracing anyone? It may be cost/benefit cheaper to resolve certain issues using other approaches.

    Besides intersection permutations (that you can't preprocess away), other things to consider: are your translucent objects all effectively 2D (flat sheets, like windows, canopies, etc.)? If not, are they convex? How are you modeling transmission through the medium (e.g. refraction, color shifting, scattering, etc.)? If objects intersect, do the component triangles of those objects intersect? Do you model partial reflection (e.g. fresnel reflectance)?

Posting Permissions

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