Browse Source

EXRLoader: fix decoding vertical indexing

Guilherme Avila 5 years ago
parent
commit
f12968c372
2 changed files with 2 additions and 2 deletions
  1. 1 1
      examples/js/loaders/EXRLoader.js
  2. 1 1
      examples/jsm/loaders/EXRLoader.js

+ 1 - 1
examples/js/loaders/EXRLoader.js

@@ -2160,7 +2160,7 @@ THREE.EXRLoader.prototype = Object.assign( Object.create( THREE.DataTextureLoade
 				for ( let w = 0; w < width; ++ w ) {
 
 					i = h * width * 4 + w * 4;
-					j = ( height - h ) * width * 4 + w * 4;
+					j = ( height - 1 - h ) * width * 4 + w * 4;
 
 					const red = byteArray[ j ];
 					const green = byteArray[ j + 1 ];

+ 1 - 1
examples/jsm/loaders/EXRLoader.js

@@ -2175,7 +2175,7 @@ EXRLoader.prototype = Object.assign( Object.create( DataTextureLoader.prototype
 				for ( let w = 0; w < width; ++ w ) {
 
 					i = h * width * 4 + w * 4;
-					j = ( height - h ) * width * 4 + w * 4;
+					j = ( height - 1 - h ) * width * 4 + w * 4;
 
 					const red = byteArray[ j ];
 					const green = byteArray[ j + 1 ];