Skip to content

Commit

Permalink
Merge pull request #11295 from donmccurdy/feat-duplicate-uvs-for-aomap
Browse files Browse the repository at this point in the history
[glTF] Duplicate UVs when aoMap is present.
  • Loading branch information
mrdoob authored May 14, 2017
2 parents 5d6ddb5 + dc3a469 commit 9f10176
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions examples/js/loaders/GLTF2Loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -2093,6 +2093,15 @@ THREE.GLTF2Loader = ( function () {

}

if ( material.aoMap !== undefined
&& geometry.attributes.uv2 === undefined
&& geometry.attributes.uv !== undefined ) {

console.log( 'GLTF2Loader: Duplicating UVs to support aoMap.' );
geometry.addAttribute( 'uv2', new THREE.BufferAttribute( geometry.attributes.uv.array, 2 ) );

}

meshNode = new THREE.Mesh( geometry, material );
meshNode.castShadow = true;

Expand Down

0 comments on commit 9f10176

Please sign in to comment.