summaryrefslogtreecommitdiffhomepage
path: root/src/models.c
diff options
context:
space:
mode:
authorraysan5 <[email protected]>2021-03-31 20:44:16 +0200
committerraysan5 <[email protected]>2021-03-31 20:44:16 +0200
commitcdc3754449da5cf8c83843f395dd97e71a7eba30 (patch)
tree2b850fbf711c08985840db841b778ab9584f2e2b /src/models.c
parent2488d361b6c9e65ba8e4ebc29bbc58a9bc3365ea (diff)
downloadraylib-cdc3754449da5cf8c83843f395dd97e71a7eba30.tar.gz
raylib-cdc3754449da5cf8c83843f395dd97e71a7eba30.zip
ADDED: Support model normal matrix location #1691
Diffstat (limited to 'src/models.c')
-rw-r--r--src/models.c3
1 files changed, 3 insertions, 0 deletions
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)