c++ - GLSL glass effect plus depth peeling -


i'm working on rendering scene potentially has multiple intersecting transparent objects. makes standard method of sorting , drawing front problematic (even sorting triangles wouldn't work if triangles intersect). i've implemented depth peeling using glsl fragment shader second depth test. it's works great.

now want able apply effects using shaders. 1 of objects in scene syringe, , apply glass effect. if drawing front, easy - start shader when draw syringe, since behind in frame buffer. however, when using depth peeling approach won't work.

so questions are:

  1. how apply shader effects single object in scene when using depth peeling?
  2. how combine effect shaders depth peeling shader (assuming need run @ same time)?

i should note i'm pretty new @ using shaders, code examples appreciated!

i'd surprised if that's possible without ray tracing. far know, way use refraction shaders texture lookups in environment map. map can either precomputed, or it's computed on fly in separate rendering pass. latter option need 1 separate environment map , 1 pass each object uses shader. kinda doubt that's possible if objects intersect each other. if was, each of these passes need couple passes depth peeling. if wanted depth peeling shader passes factor in refractions surrounding objects, out of hand.


Comments

Popular posts from this blog

Perl - how to grep a block of text from a file -

delphi - How to remove all the grips on a coolbar if I have several coolbands? -

javascript - Animating array of divs; only the final element is modified -