Game Development Community

Static environment maps?

by Don · in Torque Game Engine · 01/05/2006 (9:37 pm) · 5 replies

Ive finally got environment mapping working on a weapon model. It looks great on the item, but on the weapon image (only in first person mind you), the reflections appear to be static. I expected to see different reflections as I move along, or the reflection moving. The weapon is animated, and it stays static during the animation, also. This doesn't look that great, is there a way to fix this?

#1
01/05/2006 (11:34 pm)
You will need to render a skybox image to the environment map in realtime to have this effect of moving through the scene. Most games don't do this because it's expensive on the CPU. If you wish to do it, do it low rez and the bilinear filtering will blur it automatically.

For best performance render only one view per cycle to a hidden texture. ie Render the front view on frame 1, left view frame 2, right view frame 3, back view frame 4, up view frame 5 and down view frame 6. Then on the 7th cycle copy the newly created image to where the original skybox is being used.

Actually having said this I think only one frame is used by default called "day_0007.jpg" found in "example
\data\skies". So you need to render to that - but that is not a true environment map, it's just a sky.

So over to someone else who knows how to rig the system to use a true environment map....but the theory is the same.
#2
01/06/2006 (3:41 am)
I think the environmap day_0007 is sphere mapped isn't it?

So doing 1 render would be enough.. trouble is, the FOV would have to be set to 360 for this render.. not sure what effect that would have on the engine or performance as you'd be rendering everything in the scene.. If you have a lot of objects, this is going to be a big render.

I'd really ask myself if it was worth it for a TGE game... or could you get away with using static env maps?

On the other hand, if you mange to make realtime environment mapping and get it running at a decent framerate, put up a resource because I'm sure other people would like to use it.

But I imagine you'd be at least doubling the rendering effort, so you'd half your frame rate at least... but I could be mistaken.
#3
01/07/2006 (1:15 pm)
Wow, I was hoping there would be a simpler solution. I'm not experienced enough with C++ to try anything that advanced. Guess I'll be leaving it off my weapons for now.

I wonder how hard it would be to include quake3 type shaders into the engine :P
#4
01/07/2006 (2:03 pm)
Don's right - this should be much simpler.
i don't think he wants an accurate reflection map,
just the impression that reflection is happening.

it sounds to me like the reflection map is being rendered with a static matrix,
and it's probably just a matter of adding a model-to-world matrix to the rendering.

that said, i'm unfortunately not the guy to do it. at least not this month.
#5
01/08/2006 (1:25 am)
I think Orion's more on track than the other guys. Sometimes moving pixels are plenty, and a full dynamic cubemap implementation isn't that crucial. ;)