ADDED: Support model normal matrix location #1691

This commit is contained in:
raysan5 2021-03-31 20:44:16 +02:00
parent 2488d361b6
commit cdc3754449
6 changed files with 18 additions and 13 deletions

View file

@ -1058,6 +1058,9 @@ void DrawMeshInstanced(Mesh mesh, Material material, Matrix *transforms, int ins
// transform: function parameter transformation
matModelView = MatrixMultiply(transforms[0], MatrixMultiply(rlGetMatrixTransform(), matView));
}
// Upload model normal matrix (if locations available)
if (material.shader.locs[SHADER_LOC_MATRIX_NORMAL] != -1) rlSetUniformMatrix(material.shader.locs[SHADER_LOC_MATRIX_NORMAL], MatrixTranspose(MatrixInvert(matModelView)));
//-----------------------------------------------------
// Bind active texture maps (if available)