jPCT-AE - a 3d engine for Android > Support

Normal matrix

(1/2) > >>

Shot:
Is there a way to send a normal matrix (transpose of inverse of model view matrix) to shader for every object in a scene?

EgonOlsen:
You don't have to. I think the source of the shaders in the HelloShader example show what to do instead.

Shot:
Yep, I saw it, but imho it's not correct because after this operation normal may not be prependicular to its' surface. See this explanation: http://www.lighthouse3d.com/tutorials/glsl-tutorial/the-normal-matrix/

Thomas.:
Calculation normals from modelViewMatrix is faster and for orthogonal transformations it is fine (transpose and invert is about O(300)) ;)

Shot:
I see, but what about non-orthogonal transformations? Is it a proper way of thinking: orthogonal camera == orthogonal transformations and perspective camera == non-orthogonal transformations?

Navigation

[0] Message Index

[#] Next page

Go to full version