فهرست منبع

WebGLUtils: Add WebGL constant fallback to convert(). (#23813)

Michael Herzog 3 سال پیش
والد
کامیت
fce7ca7e00
1فایلهای تغییر یافته به همراه4 افزوده شده و 0 حذف شده
  1. 4 0
      src/renderers/webgl/WebGLUtils.js

+ 4 - 0
src/renderers/webgl/WebGLUtils.js

@@ -250,6 +250,10 @@ function WebGLUtils( gl, extensions, capabilities ) {
 
 		}
 
+		// if "p" can't be resolved, assume the user defines a WebGL constant as a string (fallback/workaround for packed RGB formats)
+
+		return ( gl[ p ] !== undefined ) ? gl[ p ] : null;
+
 	}
 
 	return { convert: convert };