Threejs 中的纹理格式

Texture Format In Threejs

threejs Docs中Texture.Format的概念我其实没看懂, 发光格式和YCbCr格式有关系吗? 当我尝试调试它时,我得到了一个类似于 1025 的格式数值, 这个数字究竟意味着什么?

THREE.LuminanceFormatTHREE.LuminanceAlphaFormat表示贴图的internalformat。根据 MDN 的文档,internalformat 指定纹理中的颜色分量(颜色通道数量和每个像素的字节数)。

When I tried debugging this I got a numerical value like 1025 for format, What does that actually means?

常量THREE.LuminanceFormat的值为1024THREE.LuminanceAlphaFormat的值为1025。这些值没有进一步的意义,因为它可以是任何东西。 three.js 在内部将它们转换为实际的 WebGL 常量,如下所示:

if ( p === LuminanceFormat ) return gl.LUMINANCE; // assuming p is a concrete value of a texture