mirror of
https://github.com/overte-org/overte.git
synced 2025-07-23 08:24:21 +02:00
Tracking down remaining SOX crashes
This commit is contained in:
parent
9f6c2c3cdd
commit
25b778be1d
3 changed files with 10 additions and 4 deletions
|
@ -611,7 +611,11 @@ void FBXReader::buildModelMesh(FBXMesh& extractedMesh, const QString& url) {
|
||||||
const int normalsSize = fbxMesh.normals.size() * sizeof(NormalType);
|
const int normalsSize = fbxMesh.normals.size() * sizeof(NormalType);
|
||||||
const int tangentsSize = fbxMesh.tangents.size() * sizeof(NormalType);
|
const int tangentsSize = fbxMesh.tangents.size() * sizeof(NormalType);
|
||||||
// If there are normals then there should be tangents
|
// If there are normals then there should be tangents
|
||||||
assert(normalsSize == tangentsSize);
|
|
||||||
|
assert(normalsSize <= tangentsSize);
|
||||||
|
if (tangentsSize > normalsSize) {
|
||||||
|
qWarning() << "Unexpected tangents in " << url;
|
||||||
|
}
|
||||||
const auto normalsAndTangentsSize = normalsSize + tangentsSize;
|
const auto normalsAndTangentsSize = normalsSize + tangentsSize;
|
||||||
const int normalsAndTangentsStride = 2 * sizeof(NormalType);
|
const int normalsAndTangentsStride = 2 * sizeof(NormalType);
|
||||||
const int colorsSize = fbxMesh.colors.size() * sizeof(ColorType);
|
const int colorsSize = fbxMesh.colors.size() * sizeof(ColorType);
|
||||||
|
|
|
@ -102,7 +102,7 @@ void GL41Backend::do_drawInstanced(const Batch& batch, size_t paramOffset) {
|
||||||
_stats._DSNumTriangles += (trueNumInstances * numVertices) / 3;
|
_stats._DSNumTriangles += (trueNumInstances * numVertices) / 3;
|
||||||
_stats._DSNumDrawcalls += trueNumInstances;
|
_stats._DSNumDrawcalls += trueNumInstances;
|
||||||
} else {
|
} else {
|
||||||
glDrawArraysInstancedARB(mode, startVertex, numVertices, numInstances);
|
glDrawArraysInstanced(mode, startVertex, numVertices, numInstances);
|
||||||
_stats._DSNumTriangles += (numInstances * numVertices) / 3;
|
_stats._DSNumTriangles += (numInstances * numVertices) / 3;
|
||||||
_stats._DSNumDrawcalls += numInstances;
|
_stats._DSNumDrawcalls += numInstances;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1098,7 +1098,9 @@ void Blender::run() {
|
||||||
int index = blendshape.indices.at(j);
|
int index = blendshape.indices.at(j);
|
||||||
meshVertices[index] += blendshape.vertices.at(j) * vertexCoefficient;
|
meshVertices[index] += blendshape.vertices.at(j) * vertexCoefficient;
|
||||||
meshNormals[index] += blendshape.normals.at(j) * normalCoefficient;
|
meshNormals[index] += blendshape.normals.at(j) * normalCoefficient;
|
||||||
meshTangents[index] += blendshape.tangents.at(j) * normalCoefficient;
|
if (blendshape.tangents.size() > j) {
|
||||||
|
meshTangents[index] += blendshape.tangents.at(j) * normalCoefficient;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1319,7 +1321,7 @@ void Model::setBlendedVertices(int blendNumber, const Geometry::WeakPointer& geo
|
||||||
|
|
||||||
normalsAndTangents.clear();
|
normalsAndTangents.clear();
|
||||||
normalsAndTangents.resize(normals.size()+tangents.size());
|
normalsAndTangents.resize(normals.size()+tangents.size());
|
||||||
assert(normalsAndTangents.size() == 2 * vertexCount);
|
// assert(normalsAndTangents.size() == 2 * vertexCount);
|
||||||
|
|
||||||
// Interleave normals and tangents
|
// Interleave normals and tangents
|
||||||
#if 0
|
#if 0
|
||||||
|
|
Loading…
Reference in a new issue