2
0
Mr.doob 3 жил өмнө
parent
commit
3a2f592fd5

+ 4 - 4
examples/jsm/loaders/RGBELoader.js

@@ -386,8 +386,8 @@ class RGBELoader extends DataTextureLoader {
 
 
 					case FloatType:
 					case FloatType:
 
 
-						numElements = ( image_rgba_data.length / 4 ) * 3;
-						const floatArray = new Float32Array( numElements );
+						numElements = image_rgba_data.length / 4;
+						const floatArray = new Float32Array( numElements * 3 );
 
 
 						for ( let j = 0; j < numElements; j ++ ) {
 						for ( let j = 0; j < numElements; j ++ ) {
 
 
@@ -402,8 +402,8 @@ class RGBELoader extends DataTextureLoader {
 
 
 					case HalfFloatType:
 					case HalfFloatType:
 
 
-						numElements = ( image_rgba_data.length / 4 ) * 3;
-						const halfArray = new Uint16Array( numElements );
+						numElements = image_rgba_data.length / 4;
+						const halfArray = new Uint16Array( numElements * 3 );
 
 
 						for ( let j = 0; j < numElements; j ++ ) {
 						for ( let j = 0; j < numElements; j ++ ) {