mirror of
https://github.com/jorio/Pomme.git
synced 2024-12-27 06:29:18 +00:00
3DMF: parse per-vertex diffuse colors
This commit is contained in:
parent
98a72ecdbd
commit
ee34771758
@ -398,18 +398,17 @@ void Q3MetaFileParser::Parse_atar(uint32_t chunkSize)
|
|||||||
}
|
}
|
||||||
else if (isVertexAttribute && attributeType == kQ3AttributeTypeDiffuseColor) // used in Bugdom's Global_Models2.3dmf
|
else if (isVertexAttribute && attributeType == kQ3AttributeTypeDiffuseColor) // used in Bugdom's Global_Models2.3dmf
|
||||||
{
|
{
|
||||||
Assert(false, "per-vertex diffuse color not supported in Nanosaur");
|
|
||||||
#if 0
|
|
||||||
printf("vertex diffuse");
|
printf("vertex diffuse");
|
||||||
// Assert(positionInArray == 0, "PIA must be 0 for colors");
|
// Assert(positionInArray == 0, "PIA must be 0 for colors");
|
||||||
Assert(currentMesh->vertexNormals, "current mesh has no vertex color array");
|
Assert(!currentMesh->vertexColors, "current mesh already had a vertex color array");
|
||||||
|
currentMesh->vertexColors = __Q3Alloc<TQ3ColorRGBA>(currentMesh->numPoints, 'TMvc');
|
||||||
for (int i = 0; i < currentMesh->numPoints; i++)
|
for (int i = 0; i < currentMesh->numPoints; i++)
|
||||||
{
|
{
|
||||||
currentMesh->vertexColors[i].r = f.Read<float>();
|
currentMesh->vertexColors[i].r = f.Read<float>();
|
||||||
currentMesh->vertexColors[i].g = f.Read<float>();
|
currentMesh->vertexColors[i].g = f.Read<float>();
|
||||||
currentMesh->vertexColors[i].b = f.Read<float>();
|
currentMesh->vertexColors[i].b = f.Read<float>();
|
||||||
|
currentMesh->vertexColors[i].a = 1.0f;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
else if (isTriangleAttribute && attributeType == kQ3AttributeTypeNormal) // face normals
|
else if (isTriangleAttribute && attributeType == kQ3AttributeTypeNormal) // face normals
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user