Reflexion shader ?

franz's picture

Hi, for the purpose of an installation pre-viz., i would need some kind of reflexion shader. Is that possible with the current qc'GLSL implementation ? any help truly welcme.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

gtoledo3's picture
Re: Reflexion shader ?

Image map with a horizontal flip...

... and then grabbing the source image from either a render in image or a kineme gl tools Read Pixels patch.

At least, that's how I've done it... with the read pixels stuff, layer order matters... and with the render in image stuff, you obviously have to have the whole scene (or whatever needs to be reflected) running on it's own, just to pipe into the image map.

Basically, any GLSL with image/"texture" input.

Hopefully, I'm not misunderstanding you!

cwright's picture
Re: Reflexion shader ?

(you got an icon! now I can find your posts more easily! :)

That depends upon what you mean, exactly, by reflection.

If you're reflecting a static scene, you can do the simple environment map trick in the developer examples (you supply a spherical "environment map" image, and it performs the reflection).

If you're wanting "live" reflection (reflecting other objects in the scene), that's going to be really hard in QC -- you need to get a spherical map about each reflecting object, and use the above trick (the hard part, of course, being the "get a spherical map about each object").

If you're wanting "live, realistic" reflection (reflecting other objects, self reflection, etc), you'll need a raytracer -- correct self-reflection in opengl is remarkably hard (even outside of QC's limitations), as it requires per-primitive (polygon) spherical maps and numerous passes.