* Added new uniform binding WorldMatrixInverseTranspose (thanks kwando)

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9197 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
3.0
Sha..rd 13 years ago
parent 7c999dc4cd
commit ea0617fa81
  1. 5
      engine/src/core/com/jme3/renderer/RenderManager.java
  2. 8
      engine/src/core/com/jme3/shader/UniformBinding.java

@ -380,6 +380,11 @@ public class RenderManager {
tempMat4.invertLocal(); tempMat4.invertLocal();
u.setValue(VarType.Matrix4, tempMat4); u.setValue(VarType.Matrix4, tempMat4);
break; break;
case WorldMatrixInverseTranspose:
worldMatrix.toRotationMatrix(tempMat3);
tempMat3.invertLocal().transposeLocal();
u.setValue(VarType.Matrix3, tempMat3);
break;
case ViewMatrixInverse: case ViewMatrixInverse:
tempMat4.set(viewMatrix); tempMat4.set(viewMatrix);
tempMat4.invertLocal(); tempMat4.invertLocal();

@ -79,6 +79,14 @@ public enum UniformBinding {
*/ */
ViewProjectionMatrix, ViewProjectionMatrix,
/**
* The world matrix inverse transpose. Converts a normals from Model space
* to world space.
* Type: mat3
*/
WorldMatrixInverseTranspose,
WorldMatrixInverse, WorldMatrixInverse,
ViewMatrixInverse, ViewMatrixInverse,

Loading…
Cancel
Save