Hi David,

David Spilling wrote:
Note that doing (1) doesn't preclude RTT - e.g. you can RTT the whole inverted scene to a texture and then generate appropriate texcoords on the mirror, either "by hand" since your camera is fixed, or in a shader.

Plus I'm not sure why you think that (1) is "quite a few additional render passes". Obviously with RTT it's only one more pass - the inverted scene - but without RTT, and with a stencil buffer, you only have to draw (a) the mirror, with stencil buffer set, (b) the inverted scene respecting the stencil buffer, (c) the rest of the scene without the mirror. Good control of your renderbins makes this fairly easy.

Additional issues with (1) might include the fact that you have to manage the lighting (i.e. you have to invert the scene lighting as well, otherwise it looks pretty odd). Also, an unlikely but possible issues is that If you have some special requirements for poly winding - e.g. models with special shaders - note that if you just mirror the scene, all the winding inverts as well.

FWIW, I would do either technique as RTT, as then effects like blur, or mirror surface non uniformity, or things like this become a lot easier (in GLSL).

Given theat, I'm not sure I have a strong favorite. I guess I'd do (2) since your camera(s) are fixed; you need a new camera to do RTT anyway so setting it up inverted is easy. The only reason I might not is if I want to play with complex camera settings later which might be a pain to implement e.g. stereo, strange projections, etc.

Rendering performance should be near identical (assuming RTT for both).

thank you for this insight, it really helped a lot. I am using RTT with a duplicate inverted camera now, as this seems easiest for the simple effects I want to achieve. Currently, I am struggling with texture coordinates and placement and masking of cameras in my scenegraph to avoid introducing infinite recursion. Solving this will be just a matter of time, though. ;)

Thanks again,
Alex.
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to