PDA

View Full Version : reflections on single sided objects



jide
04-04-2006, 02:14 PM
I was wondering if using cube_mapping is the best thing to do reflections on 'single sided' objects, like water for example (but not like flat mirrors). If yes, then, if I'm not wrong, there will have a waste of 6 faces, do that hurt ? If not, what would one use ? Stencil reflections do not suit my needs.

Rodrix
04-04-2006, 07:36 PM
Why don't you try sphere reflection mapping?
It's one face only.

Cheers!
Rod

jide
04-05-2006, 03:11 AM
True.

Zulfiqar Malik
04-05-2006, 05:47 AM
For simple flat surfaces like glass, water surface etc. try using planar reflections. Memory issues aside, you'll also have to render to at least 3 sides (on average) of the cube map to get your reflections going.,whereas you just have to render once for planar reflections. There are plenty of tutorials on planar reflections including a very famous one from Mark Kilgard (IIRC).

jide
04-05-2006, 08:23 AM
What do you mean with planar reflections, stencil reflection ? I can't use it since the surface that will show the reflection is not flat (and I would like to avoid calculating surface equation for each polygon).

Zulfiqar Malik
04-06-2006, 12:03 AM
Well, using stencil buffer is also a technique for using planar reflections, but there are other ways as well, so stencil reflections is not the proper terminology.
Well, you referred to water surface which are usualy planar (sea, pond etc). The little waves don't matter and planar reflections give a reasonable approximation.
If your object is more complex and reflections cannot be modelled using planar reflections, then you can use a cube map, but i'd still recommend having a look since the approximation might work well for you.