Explorar el Código

Fix HalfFloatType bug in WebGLUtils

Takahiro hace 7 años
padre
commit
51dad3fe38
Se han modificado 1 ficheros con 3 adiciones y 1 borrados
  1. 3 1
      src/renderers/webgl/WebGLUtils.js

+ 3 - 1
src/renderers/webgl/WebGLUtils.js

@@ -38,9 +38,11 @@ function WebGLUtils( gl, extensions ) {
 
 
 		if ( p === HalfFloatType ) {
 		if ( p === HalfFloatType ) {
 
 
+			if ( isWebGL2 ) return gl.HALF_FLOAT;
+
 			extension = extensions.get( 'OES_texture_half_float' );
 			extension = extensions.get( 'OES_texture_half_float' );
 
 
-			return isWebGL2 ? gl.HALF_FLOAT : extension.HALF_FLOAT_OES;
+			if ( extension !== null ) return extension.HALF_FLOAT_OES;
 
 
 		}
 		}