Scaling Problem with Env Map Sphere

MatrixNAN

18-03-2007 06:39:30

Hey Everyone,

I have a problem when I was testing this product out for commercial use. This is the only problem I have run into. When I scale a model up and they have Env Mapped Spherical Projection on them then the reflection image on the model becomes scewed. To see this just download the tutorial demo file of the GT4 and load the part 1 file.

The shading is already applied and when you scale up this car say 20 times you will notice it does not remotely look correct. I tried playing around with the scaling of this image but I got bad results with the image pinching at a point and then the rest of the image being stretched across the model. As a result the reflections do not look like the orginal scaling. Oh I did put the whole car and everything else into a group before I scaled them up if this matters.

I opened up the code that was exported in the .material but I did not see anything that would allow me to change the scaling of the Environment Mapped Image in the exported code. I have to say they did a wonderful job on formating of the code it was very easy to read. I suspect someone has asked this before but I did not see it in a post on the forum. Sorry if this is a repeat question.

Cheers,
Nate Nesler

Lioric

19-03-2007 16:25:23

The env map uses the normals of the object to generate the effect UVs

In the Ogre engine (and any other interactive engine), the normals used are from the "unit size" object, to correct this if the object is scaled, either:

simply "Reset Scale" in the Hierarchy panel, the new scaled size becomes the unit size and the normals will use the new size (update the preview viewport to use the updated object)

or,

if you need to keep the non-unit scale of your object in your application (for a very specific reason), after loading the object you need to use the "normalizeNormals" method to update the normals to the new scaled size