[Bf-committers] Viewport FX Design

Antony Riakiotakis kalast at gmail.com
Fri Jun 1 13:11:53 CEST 2012


> Regarding the Start/Commit/Rollback idea, why not add the functions
> gpuTranslateScale and glTranslateRotate, and just immediately apply
> the transforms always. From looking through the code, that covers
> nearly all cases, with a few places in the code that could construct
> the matrix manually, and the remaining ones either not being
> performance critical enough to bother avoiding the state change.

The only thing I can think performance-wise here is that GL probably
recalculates the inverse matrix internally for each of these
operations optimally (meaning, the inverse of a translation transform
for instance is known and it avoids a full 4x4 matrix inversion). But
for many matrix transforms in a row (think animation graphs?), doing a
full matrix inversion at the end may be preferable.

> Isn't such an inverse matrix is needed only for either normals or some
> more advanced shading operation? I hope this would not be needed in
> e.g. UI drawing code.

This can be a flag for the function naturally, but this is a very long
term optimization for when/if we support a shader driven display where
matrices are loaded manually as uniforms.


More information about the Bf-committers mailing list