Advice on mirror reflection on iPad?

subsym

Newcomer
Hi,

I'm wondering if anyone can give me some advice. I am trying to implement mirror relfection for planar surfaces (glass tables, polished wood floors and so on) on the iPad.

How to do this? My current thinking is to render the reflector first, use that as a stencil, then render the scene normally, and afterwards the scene mirrored by the reflector plane and using the stencil. Straightforward, but is it the fastest way?

I'm a bit new to this, so any help is really appreciated :smile:
 
How to do this? My current thinking is to render the reflector first, use that as a stencil, then render the scene normally, and afterwards the scene mirrored by the reflector plane and using the stencil. Straightforward, but is it the fastest way?

I think this is the traditional way and if all you want is planar reflection it should be fast enough.
However, if you have performance problem you may want to render it with a reduced resolution, although I'm not familiar enough with iPad's GPU to know if it worth the effort.
 
Can you use a (transform of) the previous framebuffer?
 
Can you use a (transform of) the previous framebuffer?

Not sure. I guess that would make it a screen-space method? There are probably a number of subleties involved even if you look at the reflector from the side.

I've heard that some commercial engines have something like that (UE3??)
 
Thanks for that Pcchen
ps: where I got the idea from ;)

Very nice :smile: For this you still need to prerender part of the scene from a different camera. With cube maps though you'd have an extra resampling step later which will probably mean a lower image quality (haven't tried it though).
 
Hi,

I'm wondering if anyone can give me some advice. I am trying to implement mirror relfection for planar surfaces (glass tables, polished wood floors and so on) on the iPad.

How to do this? My current thinking is to render the reflector first, use that as a stencil, then render the scene normally, and afterwards the scene mirrored by the reflector plane and using the stencil. Straightforward, but is it the fastest way?

I'm a bit new to this, so any help is really appreciated :smile:
Obviously some additional culling of the reflected geometry would help both at the database traversal level and, if possible, at the clipping stage. What I don't know, however, is whether user clip planes are exposed on IOS.
 
Not sure. I guess that would make it a screen-space method? There are probably a number of subleties involved even if you look at the reflector from the side.

I've heard that some commercial engines have something like that (UE3??)

I know about it because PGR used it and that was discussed as one of the cheapest reflections possible that can still look top quality. Of course it only works for stuff that is already visible to the viewer - you can't use it for a rear-view mirror in a car. But for reflections of planar surfaces it could work quite well?

I'm just guessing though based on stuff I read on these boards. No idea if that kind of thing could end up expensive on the iPad or if there are cheaper ways to do it.
 
Was my idea, bad ?
yes :) cubemaps only give a correct reflection at one spot only (the center of the cube)

@subsym depends on what youre doing a single surface eg floor, I'ld use it its straight forward and gives nearperfect results, perhaps use a scaling matrix also so the reflections are squashed (or elongated).
the powervr gpu doesnt like it when you start doing different texture coordinates in the fragment shader (way slower than a desktop GPU from my testing), so screenbased stuff will prolly be slow
 
Back
Top