Skip to content

Commit

Permalink
THREE textures have flipY set to true by default. By setting to false…
Browse files Browse the repository at this point in the history
… we can remove double flip from GLTFLoader
  • Loading branch information
richtr committed Oct 3, 2016
1 parent 4e5a7d2 commit 2fcc931
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions examples/js/loaders/GLTFLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -966,8 +966,7 @@ GLTFParser.prototype.loadTextures = function() {

textureLoader.load( resolveURL( source.uri, path ), function( _texture ) {

// UV buffer attributes are also flipped
_texture.flipY = true;
_texture.flipY = false;

if ( texture.sampler ) {

Expand Down Expand Up @@ -1338,15 +1337,6 @@ GLTFParser.prototype.loadMeshes = function() {
case 'TEXCOORD_0':
case 'TEXCOORD0':
case 'TEXCOORD':
// Flip Y value for UVs
var floatArray = bufferAttribute.array;
for ( var i = 0; i < floatArray.length / 2; i ++ ) {

floatArray[ i * 2 + 1 ] = 1.0 - floatArray[ i * 2 + 1 ];

}
bufferAttribute.array = floatArray;

geometry.addAttribute( 'uv', bufferAttribute );
break;

Expand Down

0 comments on commit 2fcc931

Please sign in to comment.