Ver a proveniência

Fix DrawMeshInstanced breaking if instanceTransform is unused (#5469)

pull/5473/head
Michael Kolupaev há 4 semanas
committed by GitHub
ascendente
cometimento
c4b11a30cd
Não foi encontrada uma chave conhecida para esta assinatura, na base de dados ID da chave GPG: B5690EEEBB952194
1 ficheiros alterados com 7 adições e 4 eliminações
  1. +7
    -4
      src/rmodels.c

+ 7
- 4
src/rmodels.c Ver ficheiro

@ -1762,11 +1762,14 @@ void DrawMeshInstanced(Mesh mesh, Material material, const Matrix *transforms, i
instancesVboId = rlLoadVertexBuffer(instanceTransforms, instances*sizeof(float16), false);
// Instances transformation matrices are sent to shader attribute location: SHADER_LOC_VERTEX_INSTANCE_TX
for (unsigned int i = 0; i < 4; i++)
if (material.shader.locs[SHADER_LOC_VERTEX_INSTANCE_TX] != -1)
{
rlEnableVertexAttribute(material.shader.locs[SHADER_LOC_VERTEX_INSTANCE_TX] + i);
rlSetVertexAttribute(material.shader.locs[SHADER_LOC_VERTEX_INSTANCE_TX] + i, 4, RL_FLOAT, 0, sizeof(Matrix), i*sizeof(Vector4));
rlSetVertexAttributeDivisor(material.shader.locs[SHADER_LOC_VERTEX_INSTANCE_TX] + i, 1);
for (unsigned int i = 0; i < 4; i++)
{
rlEnableVertexAttribute(material.shader.locs[SHADER_LOC_VERTEX_INSTANCE_TX] + i);
rlSetVertexAttribute(material.shader.locs[SHADER_LOC_VERTEX_INSTANCE_TX] + i, 4, RL_FLOAT, 0, sizeof(Matrix), i*sizeof(Vector4));
rlSetVertexAttributeDivisor(material.shader.locs[SHADER_LOC_VERTEX_INSTANCE_TX] + i, 1);
}
}
rlDisableVertexBuffer();

Carregando…
Cancelar
Guardar