2
0
Эх сурвалжийг харах

Updated models.c (#1871)

- fixed issue where vertex positions being passed in place of vertex normals.
GoldenThumbs 4 жил өмнө
parent
commit
59acb6dbea
1 өөрчлөгдсөн 1 нэмэгдсэн , 1 устгасан
  1. 1 1
      src/models.c

+ 1 - 1
src/models.c

@@ -860,7 +860,7 @@ void UploadMesh(Mesh *mesh, bool dynamic)
     if (mesh->normals != NULL)
     if (mesh->normals != NULL)
     {
     {
         // Enable vertex attributes: normals (shader-location = 2)
         // Enable vertex attributes: normals (shader-location = 2)
-        void *normals = mesh->animNormals != NULL ? mesh->animNormals : mesh->vertices;
+        void *normals = mesh->animNormals != NULL ? mesh->animNormals : mesh->normals;
         mesh->vboId[2] = rlLoadVertexBuffer(normals, mesh->vertexCount*3*sizeof(float), dynamic);
         mesh->vboId[2] = rlLoadVertexBuffer(normals, mesh->vertexCount*3*sizeof(float), dynamic);
         rlSetVertexAttribute(2, 3, RL_FLOAT, 0, 0, 0);
         rlSetVertexAttribute(2, 3, RL_FLOAT, 0, 0, 0);
         rlEnableVertexAttribute(2);
         rlEnableVertexAttribute(2);