Reflection mapping - the logistics

Started by
2 comments, last by mikeman 19 years, 4 months ago
I have not added reflections to my work in progress yet so I am trying to get everything planned out first... What I need to know is how much I can afford to render for the local reflection maps. Where can I fake things easily and cheat a little without the viewer noticing. I would really appriciate some tips from those of you with some experience here. Here are a couple of scenarioes with added rambling: @ A man-sized mirror - there will be no distortion to hide little errors and vagueness. Once the mirror takes up a large portion of the screen more rendering time would be allocated to it. More of an angle you look at it the less detail you would need. How much of the normal geometry would have to be rendered to it at what detail, just approximately? Some shadow passes would have to go I guess, and all done hard. Model LOD would be knocked down. Lower quality lighting paths would be used. How often would it have to be updated? @ A wet area - could remain planar. More distortion and smaller surface area. Less light reflected. How much could be optimised here? @ Shiny objects - Distortion yes. Could I get away with a full local cube map of a small resolution? I really need some pointers from people who have implanted these kinds of things! What other things do I need to be prepared to render with reflection and stuff? Thanks for any help!
Advertisement
About mirrors, I haven't much to say, because I haven't gone into that in detail. But as far as wet/reflective areas(watch out: not water, like sea or rivers) and shiny objects: If you want to reflect only static geometry, you can cheat a lot. What I do now in my engine(which is based in the Halflife2 shading model) is that I predefine some keypoints inside the level,build the cubemaps around that points, and save them. The cubemaps are not rendered in real-time, so the complexity of the scene doesn't matter, but they are pretty lo-res, for memory reasons. For every reflective surface/object, I pick the most appropriate(right now, I just pick the closest) cubemap and do my reflections using that cubemap. For moving objects, you have to do the picking algorithm in realtime(it's fast though), for static reflective surfaces, you can compute that offline. You can even override the algorithm and allow the designer to define which cubemap to assign to a surface.

The whole method is not perfect(if you look you'll see that even in HL2 sometimes the reflections "break"), but it's cheap, fast and it works in most cases.
Thanks for the pointers!
How large are your cube maps or do vary them depending on the sizes of the nearby reflectors?
By, "how large", I guess you mean the resolution of the six textures of the cubemap. Right now, I think I have them at 32x32,and the results are not bad(you can check it out if you want here). As I said, it's a memory issue, all the cubemaps of the level reside in video memory, so I won't have to load them each time I use them. Maybe at a later point I will develop a better caching system(load/unload cubemaps depending of what parts of the levels are visible), so I will release some resources.

This topic is closed to new replies.

Advertisement