general cubemap question

Anything and everything that's related to OGRE or the wider graphics field that doesn't fit into the other forums.
Post Reply
User avatar
Noldomire
Halfling
Posts: 78
Joined: Sat May 29, 2004 9:43 am
Location: Warsaw, Poland

general cubemap question

Post by Noldomire »

Hello,
I've got a general question about texturing with rendered cubemaps - for instance for mirror reflections, like in some ogre demo.

The picture held in the cubemap is rendered with respect to the cubemap center, where the camera eye is put. Now, as we map the cube onto the object, what happens with those parts of the mesh that are near the cube's corners or edges? I mean - the picture rendered from those points of view would definitely be different than the one rendered from the center of the cube. So aren't those outer regions mapped with incorrect textures? Or perhaps the trilinear interpolation solves this somehow?

Tell me if the question is unclear, I'll do a sketch in m$paint to clarify ; )
faber est suae quisque fortunae

Krulspeld
Kobold
Posts: 35
Joined: Tue Apr 05, 2005 9:51 pm

Post by Krulspeld »

Your observations are correct. Cubemaps will not result in physically correct reflections, but under the assumption that the reflected environment is relatively far from the object that uses the cubemap this will not be noticable.

A cubemap models an infinitely far environment and that is why you will not see any changes in reflections when the object translates, but only when it rotates. You can however use a shader program to adjust the vertex coordinates so local offsets of the object center do matter and translation of the object is taken into account, but this has his limitations.

Post Reply