mirror of
https://github.com/raysan5/raylib.git
synced 2025-09-20 10:18:14 +00:00
[MODELS] Better fix for GPU skinning issues (#4353)
* Make the max VBO match the animation flag. * re-enable GPU skinning for mac, and fix the max buffer to be correct based on the GPU skinning support flag.
This commit is contained in:
@@ -1345,7 +1345,7 @@ void UploadMesh(Mesh *mesh, bool dynamic)
|
||||
rlDisableVertexAttribute(RL_DEFAULT_SHADER_ATTRIB_LOCATION_TEXCOORD2);
|
||||
}
|
||||
|
||||
#ifdef RL_SUPPORT_MESH_ANIMATION_VBO
|
||||
#ifdef RL_SUPPORT_MESH_GPU_SKINNING
|
||||
if (mesh->boneIds != NULL)
|
||||
{
|
||||
// Enable vertex attribute: boneIds (shader-location = 6)
|
||||
@@ -1492,7 +1492,7 @@ void DrawMesh(Mesh mesh, Material material, Matrix transform)
|
||||
// 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(matModel)));
|
||||
|
||||
#ifdef RL_SUPPORT_MESH_ANIMATION_VBO
|
||||
#ifdef RL_SUPPORT_MESH_GPU_SKINNING
|
||||
// Upload Bone Transforms
|
||||
if (material.shader.locs[SHADER_LOC_BONE_MATRICES] != -1 && mesh.boneMatrices)
|
||||
{
|
||||
@@ -1578,7 +1578,7 @@ void DrawMesh(Mesh mesh, Material material, Matrix transform)
|
||||
rlEnableVertexAttribute(material.shader.locs[SHADER_LOC_VERTEX_TEXCOORD02]);
|
||||
}
|
||||
|
||||
#ifdef RL_SUPPORT_MESH_ANIMATION_VBO
|
||||
#ifdef RL_SUPPORT_MESH_GPU_SKINNING
|
||||
// Bind mesh VBO data: vertex bone ids (shader-location = 6, if available)
|
||||
if (material.shader.locs[SHADER_LOC_VERTEX_BONEIDS] != -1)
|
||||
{
|
||||
@@ -1738,7 +1738,7 @@ void DrawMeshInstanced(Mesh mesh, Material material, const Matrix *transforms, i
|
||||
// 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(matModel)));
|
||||
|
||||
#ifdef RL_SUPPORT_MESH_ANIMATION_VBO
|
||||
#ifdef RL_SUPPORT_MESH_GPU_SKINNING
|
||||
// Upload Bone Transforms
|
||||
if (material.shader.locs[SHADER_LOC_BONE_MATRICES] != -1 && mesh.boneMatrices)
|
||||
{
|
||||
|
Reference in New Issue
Block a user