kzhsw
March 10, 2025, 5:35am
1
Not seems quite a bug , but the tanget
here might should be tangent
} else {
vertexData4.fromArray(values, 0);
vertexData4.toLinearSpaceToRef(vertexData4, useExactSrgbConversions);
vertexData4.toArray(values, 0);
}
});
}
}
}
// Performs coordinate conversion if needed (only for position, normal and tanget).
if (state.convertToRightHanded) {
for (const vertexBuffer of vertexBuffers) {
switch (vertexBuffer.getKind()) {
case VertexBuffer.PositionKind:
case VertexBuffer.NormalKind:
case VertexBuffer.TangentKind: {
for (const mesh of vertexBufferToMeshesMap.get(vertexBuffer)!) {
const { byteOffset, byteStride, type, normalized } = vertexBuffer;
const size = vertexBuffer.getSize();
EnumerateFloatValues(bytes, byteOffset, byteStride, size, type, mesh.getTotalVertices() * size, normalized, (values) => {
Cedric
March 10, 2025, 8:58am
2
2 Likes
kzhsw
March 12, 2025, 12:39am
3
tangets
also exist here, but it’s in code, not sure if this is trivial to change
if (binaryInfo.positionsAttrDesc && binaryInfo.positionsAttrDesc.count > 0) {
const positionsData = new Float32Array(parsedGeometry, binaryInfo.positionsAttrDesc.offset, binaryInfo.positionsAttrDesc.count);
mesh.setVerticesData(VertexBuffer.PositionKind, positionsData, false);
}
if (binaryInfo.normalsAttrDesc && binaryInfo.normalsAttrDesc.count > 0) {
const normalsData = new Float32Array(parsedGeometry, binaryInfo.normalsAttrDesc.offset, binaryInfo.normalsAttrDesc.count);
mesh.setVerticesData(VertexBuffer.NormalKind, normalsData, false);
}
if (binaryInfo.tangetsAttrDesc && binaryInfo.tangetsAttrDesc.count > 0) {
const tangentsData = new Float32Array(parsedGeometry, binaryInfo.tangetsAttrDesc.offset, binaryInfo.tangetsAttrDesc.count);
mesh.setVerticesData(VertexBuffer.TangentKind, tangentsData, false);
}
if (binaryInfo.uvsAttrDesc && binaryInfo.uvsAttrDesc.count > 0) {
const uvsData = new Float32Array(parsedGeometry, binaryInfo.uvsAttrDesc.offset, binaryInfo.uvsAttrDesc.count);
if (useOpenGLOrientationForUV) {
for (let index = 1; index < uvsData.length; index += 2) {
uvsData[index] = 1 - uvsData[index];
}
Cedric
March 12, 2025, 8:52am
4
This code is for geometry imports. It doesn’t seem to be used but I’m not sure. I can investigate more when 8.0 release is done. I won’t change that now
1 Like