Redundant transform in GpuProgramParams

Anything and everything that's related to OGRE or the wider graphics field that doesn't fit into the other forums.
Post Reply
peanutandchestnut
Kobold
Posts: 36
Joined: Tue Nov 11, 2014 9:29 am
x 2

Redundant transform in GpuProgramParams

Post by peanutandchestnut »

This is a code snippet of GpuProgramParams:

Code: Select all

                  case ACT_LIGHT_DIRECTION_OBJECT_SPACE:
                    // We need the inverse of the inverse transpose
                    source->getInverseTransposeWorldMatrix().inverse().extract3x3Matrix(m3);
                    vec3 = m3 * source->getLightDirection(i->data);
                    vec3.normalise();
                    // Set as 4D vector for compatibility
                    _writeRawConstant(i->physicalIndex, Vector4(vec3.x, vec3.y, vec3.z, 0.0f), i->elementCount);
                    break;
because:
(A^-1)^t = (A^t)^-1
((A^-1) ^t)^-1 = ((A^t)^-1)^-1 = A^t

so :
source->getInverseTransposeWorldMatrix().inverse() is just the same as source->getTransposeWorldMatrix()

This also happens for case ACT_LIGHT_DIRECTION_OBJECT_SPACE_ARRAY
paroj
OGRE Team Member
OGRE Team Member
Posts: 1994
Joined: Sun Mar 30, 2014 2:51 pm
x 1074
Contact:

Re: Redundant transform in GpuProgramParams

Post by paroj »

peanutandchestnut
Kobold
Posts: 36
Joined: Tue Nov 11, 2014 9:29 am
x 2

Re: Redundant transform in GpuProgramParams

Post by peanutandchestnut »

Hi paroj:
I see a lot of new stuff has been added to https://github.com/OGRECave/ogre/, what's it's goal ?
paroj
OGRE Team Member
OGRE Team Member
Posts: 1994
Joined: Sun Mar 30, 2014 2:51 pm
x 1074
Contact:

Re: Redundant transform in GpuProgramParams

Post by paroj »

work around the lethargy of the current 1.10 maintainers to push ogre forward.
Post Reply