Skip to content

Commit b6343d4

Browse files
#4323 fix for transparent meshes
1 parent ecf220f commit b6343d4

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

indra/newview/gltf/llgltfloader.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,8 @@ static const glm::mat4 coord_system_rotationxy(
8686
0.f, 0.f, 0.f, 1.f
8787
);
8888

89+
static const S32 VERTICIES_LIMIT = USHRT_MAX - 2;
90+
8991
LLGLTFLoader::LLGLTFLoader(std::string filename,
9092
S32 lod,
9193
LLModelLoader::load_callback_t load_cb,
@@ -889,7 +891,7 @@ bool LLGLTFLoader::populateModelFromMesh(LLModel* pModel, const LL::GLTF::Mesh&
889891
mats[materialName] = impMat;
890892

891893
// Indices handling
892-
if (faceVertices.size() >= USHRT_MAX)
894+
if (faceVertices.size() >= VERTICIES_LIMIT)
893895
{
894896
// Will have to remap 32 bit indices into 16 bit indices
895897
// For the sake of simplicity build vector of 32 bit indices first
@@ -957,7 +959,7 @@ bool LLGLTFLoader::populateModelFromMesh(LLModel* pModel, const LL::GLTF::Mesh&
957959
}
958960
indices_16.push_back((U16)vert_index);
959961

960-
if (indices_16.size() % 3 == 0 && face_verts.size() >= 65532)
962+
if (indices_16.size() % 3 == 0 && face_verts.size() >= VERTICIES_LIMIT - 1)
961963
{
962964
LLVolumeFace face;
963965
face.fillFromLegacyData(face_verts, indices_16);

0 commit comments

Comments
 (0)