Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions examples/jsm/loaders/usd/USDComposer.js
Original file line number Diff line number Diff line change
Expand Up @@ -1998,10 +1998,17 @@ class USDComposer {

// Triangulate original data using consistent pattern
const { indices: origIndices, pattern: triPattern } = this._triangulateIndicesWithPattern( faceVertexIndices, faceVertexCounts, points, holeMap );
const origUvIndices = uvIndices ? this._applyTriangulationPattern( uvIndices, triPattern ) : null;
const origUv2Indices = uv2Indices ? this._applyTriangulationPattern( uv2Indices, triPattern ) : null;

const numFaceVertices = faceVertexCounts.reduce( ( a, b ) => a + b, 0 );
const faceVaryingIdentity = ( uvs && ! uvIndices && uvs.length / 2 === numFaceVertices ) ||
( uvs2 && ! uv2Indices && uvs2.length / 2 === numFaceVertices )
? this._applyTriangulationPattern( Array.from( { length: numFaceVertices }, ( _, i ) => i ), triPattern )
: null;
const origUvIndices = uvIndices
? this._applyTriangulationPattern( uvIndices, triPattern )
: ( uvs && uvs.length / 2 === numFaceVertices ? faceVaryingIdentity : null );
const origUv2Indices = uv2Indices
? this._applyTriangulationPattern( uv2Indices, triPattern )
: ( uvs2 && uvs2.length / 2 === numFaceVertices ? faceVaryingIdentity : null );
const hasIndexedNormals = normals && normalIndicesRaw && normalIndicesRaw.length > 0;
const hasFaceVaryingNormals = normals && normals.length / 3 === numFaceVertices;
const origNormalIndices = hasIndexedNormals
Expand Down
Loading