From cdc3754449da5cf8c83843f395dd97e71a7eba30 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Wed, 31 Mar 2021 20:44:16 +0200 Subject: ADDED: Support model normal matrix location #1691 --- src/models.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/models.c') diff --git a/src/models.c b/src/models.c index 9dfdc0ea..b0b54a21 100644 --- a/src/models.c +++ b/src/models.c @@ -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) -- cgit v1.2.3