By: Nobody/Anonymous - nobody |
I had a question concerning ray tracing/ mapping. |
-
By: Martin Baker - martinbaker
RE: raytracing or real time mapping?
2005-06-15 15:59I don't really know much about rendering, can anyone else answer this?
Is it possible that the new programing features in OpenGL and DirectX like Shading Language could do things like reflections and shadows. I would like to learn more about this.
Martin -
By: Nobody/Anonymous - nobody
RE: raytracing or real time mapping?
2005-06-17 09:56It's likely to be done using a technique called environment (A.K.A. reflection) mapping. As I understand it you use the camera view vector to calculate UV coordinates (for reflection only) on your reflective model. You then use these UV coordinates to map a bitmap representing the (static) surroundings on to the model. The map is an known as an environment map (or a reflection map).
Interestingly, blurred reflection (to simulate a rough metal surface) can be got just by blurring the environment map, a fast procedure. The equivalent procedure in a raytracer is very slow. You can also use any map you like, it doesn't have to represent the real surroundings of the object at all.
The technique is described in detail at
http://www.opengl.org/resources/tutorials/sig99/advanced99/notes/node174.html
And there is a page on its history at
http://www.debevec.org/ReflectionMapping/
It does have limitations. In some games items carried by the player are reflective. You then see environment maps change abruptly as you move from room to room - each room has a different environment map but you can't interpolate between them smoothly.
In other (older) games you can see that the UV coordinates are not interpolated smoothly, but are precalculated for five or six viewing angles - the reflection does not change continuously as you move around a reflective object, but in discrete steps.
Real-time raytracing is a long way away for general purpose use without dedicated hardware. There exist "demos" written by very talented people that can do realtime raytracing in specific, limited surfaces (often at low resolution and with heavy interpolation). I think
http://www.scene.org
is probably a good site to start at if you are interesting in finding such things.