Skip to main content
GameDev.net gamedev.net
🔒 Locked

About cubic environment mapping

Started by Alload May 31, 2002 at 2:10 AM 7 replies 350+ views
Original Post
Alload
Alload
I want to use cubic environment mapping in my engine and I was wondering where the camera had to be positioned in order to render the cube maps. Is the position of the camera the same as if I rendered normally the scene? Or is it elsewhere?
Yann L
Yann L
It should be at the place where you display your cubemap afterwards.

Eg. if you have an object you would like to apply a reflective cubemap to, then place the camera at the center of that object, and render the geometry around it to the 6 sides of the cubemap (but skip the object itself !).

Don''t forget to set your camera to a FOV of 90°.

/ Yann
greeneggs
greeneggs
Does setting a larger FOV (e.g., 95 degrees) help?
Yann L
Yann L
quote:

Does setting a larger FOV (e.g., 95 degrees) help?


Well, you''ll introduce discontinuities at the edges of the cubemap for every FOV other than exactly 90°. But for special effects (esp. refractive), it can be useful.
Alload
Alload
Okay.

But if I want to render several objects with environment mapping, do I have to draw for each object four times the scene?
python_regious
python_regious
Since you will have to re-render the cubemap for each object ( as they are at different positions/orientations, and can see different things etc ), yes, you will.

Death of one is a tragedy, death of a million is just a statistic.
If at first you don't succeed, redefine success.
python_regious
python_regious
Although... If you have a static scenery, you could compute the cubemaps at run-time, save them somewhere, and only render the dynamic objects ontop of them... perhaps... Wait... no.. you won''t have depth information to do that... well, perhaps a variation on that.

Death of one is a tragedy, death of a million is just a statistic.
If at first you don't succeed, redefine success.
Alload
Alload
For instance, if you take a look at the water effect in Morrowind. Do they render cube maps for every triangles of the water surface?
davepermen
davepermen
they dont use cubemaps. they render the scene mirrored at the waterplane, then copy this on texture (or render it on texture directly.. blah).
this one is then used on the rippled water surface wich displaces the texturecoordinates a little (per vertex or perpixel with pixelshaders, dunno) to get the waves working.

"take a look around" - limp bizkit
www.google.com
If that's not the help you're after then you're going to have to explain the problem better than what you have. - joanusdmentia
My Page davepermen.net | My Music on Bandcamp and on Soundcloud

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.