PDA

View Full Version : Realistic Reflective Mapping



maximian
03-15-2005, 06:13 AM
Okay, this is kind of a noobish question, but there seems to be so little information. Is there a better technique, than sphere mapping, and cube mapping. I need a method to do environment/reflection mapping only. No bump maps, or anything else. Is there a method that does not use only directions. Ie distance to reflected object is finite. Hardware accelerated?

3B
03-15-2005, 06:32 AM
possibly useful: http://www.ati.com/developer/shaderx/ShaderX_CubeEnvironmentMapCorrection.pdf

maximian
03-15-2005, 06:56 AM
Tried that technique, implemented on CPU, since I am not very comfortable with shader assembly. Did not produce the results I was looking for. Thank you for the suggestion, though. Any other ideas? Perhaps, a modification to cube mapping?

Overmind
03-15-2005, 07:29 AM
AFAIK there are two major algorithms for reflections:

cube-/sphere-/...-mapping:
It does generally not assume infinitely far away viewer, the reflection is based on a correctly reflected ray. But the ray is not originated at correct point of the object, but in the center (or wherever you choose to place the camera when rendering cubemap faces). It would work correctly when the object is infinitly small...

rendering the scene from a reflected camera to a texture:
This would work absolutely correct for perfectly planar reflections. Bumps in the plane are only approximated by changing the texture coordinates, so this method only works for nearly planar surfaces like water, for more complex objects you would need one reflection pass per face.

The link of 3B shows a very good technique to correct the problem with cubemaps, but it is only an aproximation similar to the one used when making bumps with planar reflections. It will not produce exactly correct results in every situation, since much depends on the distance between the reflecting object and the reflected object, which is assumed constant with this method...