diff options
author | Maxim Nikolenko <maximnproductengine@lindenlab.com> | 2025-07-04 20:37:29 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-07-04 20:37:29 +0300 |
commit | b6343d4169a1a3c10c287f32a86db6c1a52bca4d (patch) | |
tree | f36e0272d098d8a77b860cce9f0cb8271a494acd | |
parent | ecf220f1b8b56769d5489af2c7c7c3be962dff6e (diff) |
#4323 fix for transparent meshes
-rw-r--r-- | indra/newview/gltf/llgltfloader.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/indra/newview/gltf/llgltfloader.cpp b/indra/newview/gltf/llgltfloader.cpp index 5abd4cf5ae..3bee909951 100644 --- a/indra/newview/gltf/llgltfloader.cpp +++ b/indra/newview/gltf/llgltfloader.cpp @@ -86,6 +86,8 @@ static const glm::mat4 coord_system_rotationxy( 0.f, 0.f, 0.f, 1.f ); +static const S32 VERTICIES_LIMIT = USHRT_MAX - 2; + LLGLTFLoader::LLGLTFLoader(std::string filename, S32 lod, LLModelLoader::load_callback_t load_cb, @@ -889,7 +891,7 @@ bool LLGLTFLoader::populateModelFromMesh(LLModel* pModel, const LL::GLTF::Mesh& mats[materialName] = impMat; // Indices handling - if (faceVertices.size() >= USHRT_MAX) + if (faceVertices.size() >= VERTICIES_LIMIT) { // Will have to remap 32 bit indices into 16 bit indices // 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& } indices_16.push_back((U16)vert_index); - if (indices_16.size() % 3 == 0 && face_verts.size() >= 65532) + if (indices_16.size() % 3 == 0 && face_verts.size() >= VERTICIES_LIMIT - 1) { LLVolumeFace face; face.fillFromLegacyData(face_verts, indices_16); |