瀏覽代碼

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 };