|
@@ -136,28 +136,57 @@
|
|
|
<h2>格式</h2>
|
|
|
<code>
|
|
|
THREE.AlphaFormat
|
|
|
+ THREE.RedFormat
|
|
|
+ THREE.RedIntegerFormat
|
|
|
+ THREE.RGFormat
|
|
|
+ THREE.RGIntegerFormat
|
|
|
THREE.RGBFormat
|
|
|
+ THREE.RGBIntegerFormat
|
|
|
THREE.RGBAFormat
|
|
|
+ THREE.RGBAIntegerFormat
|
|
|
THREE.LuminanceFormat
|
|
|
THREE.LuminanceAlphaFormat
|
|
|
THREE.RGBEFormat
|
|
|
THREE.DepthFormat
|
|
|
THREE.DepthStencilFormat
|
|
|
- </code>
|
|
|
+ </code>
|
|
|
<p>
|
|
|
这些常量用于纹理的[page:Texture.format format]属性,它们定义了shader(着色器)将如何读取的2D纹理或者*texels*(纹理元素)的元素。.<br /><br />
|
|
|
|
|
|
[page:constant AlphaFormat] 丢弃红、绿、蓝分量,仅读取Alpha分量。<br /><br />
|
|
|
|
|
|
+ [page:constant RedFormat] discards the green and blue components and reads just the red component.<br /><br />
|
|
|
+
|
|
|
+ [page:constant RedIntegerFormat] discards the green and blue components and reads just the red component.
|
|
|
+ The texels are read as integers instead of floating point.
|
|
|
+ (can only be used with a WebGL 2 rendering context).
|
|
|
+ <br /><br />
|
|
|
+
|
|
|
+ [page:constant RGFormat] discards the alpha, and blue components and reads the red, and green components.
|
|
|
+ (can only be used with a WebGL 2 rendering context).
|
|
|
+ <br /><br />
|
|
|
+
|
|
|
+ [page:constant RGIntegerFormat] discards the alpha, and blue components and reads the red, and green components.
|
|
|
+ The texels are read as integers instead of floating point.
|
|
|
+ (can only be used with a WebGL 2 rendering context).
|
|
|
+ <br /><br />
|
|
|
+
|
|
|
[page:constant RGBFormat] 丢弃Alpha分量,仅读取红、绿、蓝分量。<br /><br />
|
|
|
|
|
|
+ [page:constant RGBIntegerFormat] discards the alpha components and reads the red, green and blue components.
|
|
|
+ (can only be used with a WebGL 2 rendering context).
|
|
|
+ <br /><br />
|
|
|
+
|
|
|
[page:constant RGBAFormat] 是默认值,它将读取红、绿、蓝和Alpha分量。<br /><br />
|
|
|
|
|
|
+ [page:constant RGBAIntegerFormat] is the default and reads the red, green, blue and alpha components.
|
|
|
+ The texels are read as integers instead of floating point.
|
|
|
+ (can only be used with a WebGL 2 rendering context).
|
|
|
+ <br /><br />
|
|
|
|
|
|
[page:constant LuminanceFormat] 将每个元素作为单独的亮度分量来读取。
|
|
|
将其转换为范围限制在[0,1]区间的浮点数,然后通过将亮度值放入红、绿、蓝通道,并将1.0赋给Alpha通道,来组装成一个RGBA元素。<br /><br />
|
|
|
|
|
|
-
|
|
|
[page:constant LuminanceAlphaFormat] 将每个元素同时作为亮度分量和Alpha分量来读取。
|
|
|
和上面[page:constant LuminanceFormat]的处理过程是一致的,除了Alpha分量具有除了*1.0*以外的值。<br /><br />
|
|
|
|
|
@@ -228,6 +257,259 @@
|
|
|
扩展的支持。<br /><br />
|
|
|
</p>
|
|
|
|
|
|
+ <h2>Internal Formats</h2>
|
|
|
+ <code>
|
|
|
+ 'ALPHA'
|
|
|
+ 'RGB'
|
|
|
+ 'RGBA'
|
|
|
+ 'LUMINANCE'
|
|
|
+ 'LUMINANCE_ALPHA'
|
|
|
+ 'RED_INTEGER'
|
|
|
+ 'R8'
|
|
|
+ 'R8_SNORM'
|
|
|
+ 'R8I'
|
|
|
+ 'R8UI'
|
|
|
+ 'R16I'
|
|
|
+ 'R16UI'
|
|
|
+ 'R16F'
|
|
|
+ 'R32I'
|
|
|
+ 'R32UI'
|
|
|
+ 'R32F'
|
|
|
+ 'RG8'
|
|
|
+ 'RG8_SNORM'
|
|
|
+ 'RG8I'
|
|
|
+ 'RG8UI'
|
|
|
+ 'RG16I'
|
|
|
+ 'RG16UI'
|
|
|
+ 'RG16F'
|
|
|
+ 'RG32I'
|
|
|
+ 'RG32UI'
|
|
|
+ 'RG32F'
|
|
|
+ 'RGB565'
|
|
|
+ 'RGB8'
|
|
|
+ 'RGB8_SNORM'
|
|
|
+ 'RGB8I'
|
|
|
+ 'RGB8UI'
|
|
|
+ 'RGB16I'
|
|
|
+ 'RGB16UI'
|
|
|
+ 'RGB16F'
|
|
|
+ 'RGB32I'
|
|
|
+ 'RGB32UI'
|
|
|
+ 'RGB32F'
|
|
|
+ 'RGB9_E5'
|
|
|
+ 'SRGB8'
|
|
|
+ 'R11F_G11F_B10F'
|
|
|
+ 'RGBA4'
|
|
|
+ 'RGBA8'
|
|
|
+ 'RGBA8_SNORM'
|
|
|
+ 'RGBA8I'
|
|
|
+ 'RGBA8UI'
|
|
|
+ 'RGBA16I'
|
|
|
+ 'RGBA16UI'
|
|
|
+ 'RGBA16F'
|
|
|
+ 'RGBA32I'
|
|
|
+ 'RGBA32UI'
|
|
|
+ 'RGBA32F'
|
|
|
+ 'RGB5_A1'
|
|
|
+ 'RGB10_A2'
|
|
|
+ 'RGB10_A2UI'
|
|
|
+ 'SRGB8_ALPHA8'
|
|
|
+ 'DEPTH_COMPONENT16'
|
|
|
+ 'DEPTH_COMPONENT24'
|
|
|
+ 'DEPTH_COMPONENT32F'
|
|
|
+ 'DEPTH24_STENCIL8'
|
|
|
+ 'DEPTH32F_STENCIL8'
|
|
|
+ </code>
|
|
|
+
|
|
|
+ <p>
|
|
|
+
|
|
|
+ Heads up: changing the internal format of a texture will only affect the
|
|
|
+ texture when using a WebGL 2 rendering context.<br /><br />
|
|
|
+
|
|
|
+ For use with a texture's [page:Texture.internalFormat internalFormat] property,
|
|
|
+ these define how elements of a texture, or *texels*, are stored on the GPU.<br /><br />
|
|
|
+
|
|
|
+ [page:constant R8] stores the red component on 8 bits.<br /><br />
|
|
|
+
|
|
|
+ [page:constant R8_SNORM] stores the red component on 8 bits. The component is stored as normalized. <br /><br />
|
|
|
+
|
|
|
+ [page:constant R8I] stores the red component on 8 bits. The component is stored as an integer. <br /><br />
|
|
|
+
|
|
|
+ [page:constant R8UI] stores the red component on 8 bits. The component is stored as an unsigned integer. <br /><br />
|
|
|
+
|
|
|
+ [page:constant R16I] stores the red component on 16 bits. The component is stored as an integer. <br /><br />
|
|
|
+
|
|
|
+ [page:constant R16UI] stores the red component on 16 bits. The component is stored as an unsigned integer. <br /><br />
|
|
|
+
|
|
|
+ [page:constant R16F] stores the red component on 16 bits. The component is stored as floating point. <br /><br />
|
|
|
+
|
|
|
+ [page:constant R32I] stores the red component on 32 bits. The component is stored as an integer. <br /><br />
|
|
|
+
|
|
|
+ [page:constant R32UI] stores the red component on 32 bits. The component is stored as an unsigned integer. <br /><br />
|
|
|
+
|
|
|
+ [page:constant R32F] stores the red component on 32 bits. The component is stored as floating point. <br /><br />
|
|
|
+
|
|
|
+ [page:constant RG8] stores the red and green components on 8 bits each.<br /><br />
|
|
|
+
|
|
|
+ [page:constant RG8_SNORM] stores the red and green components on 8 bits each.
|
|
|
+ Every component is stored as normalized.
|
|
|
+ <br /><br />
|
|
|
+
|
|
|
+ [page:constant RG8I] stores the red and green components on 8 bits each.
|
|
|
+ Every component is stored as an integer.
|
|
|
+ <br /><br />
|
|
|
+
|
|
|
+ [page:constant RG8UI] stores the red and green components on 8 bits each.
|
|
|
+ Every component is stored as an unsigned integer.
|
|
|
+ <br /><br />
|
|
|
+
|
|
|
+ [page:constant RG16I] stores the red and green components on 16 bits each.
|
|
|
+ Every component is stored as an integer.
|
|
|
+ <br /><br />
|
|
|
+
|
|
|
+ [page:constant RG16UI] stores the red and green components on 16 bits each.
|
|
|
+ Every component is stored as an unsigned integer.
|
|
|
+ <br /><br />
|
|
|
+
|
|
|
+ [page:constant RG16F] stores the red and green components on 16 bits each.
|
|
|
+ Every component is stored as floating point.
|
|
|
+ <br /><br />
|
|
|
+
|
|
|
+ [page:constant RG32I] stores the red and green components on 32 bits each.
|
|
|
+ Every component is stored as an integer.
|
|
|
+ <br /><br />
|
|
|
+
|
|
|
+ [page:constant RG32UI] stores the red and green components on 32 bits.
|
|
|
+ Every component is stored as an unsigned integer.
|
|
|
+ <br /><br />
|
|
|
+
|
|
|
+ [page:constant RG32F] stores the red and green components on 32 bits.
|
|
|
+ Every component is stored as floating point.
|
|
|
+ <br /><br />
|
|
|
+
|
|
|
+ [page:constant RGB8] stores the red, green, and blue components on 8 bits each.
|
|
|
+
|
|
|
+ [page:constant RGB8_SNORM] stores the red, green, and blue components on 8 bits each.
|
|
|
+ Every component is stored as normalized.
|
|
|
+ <br /><br />
|
|
|
+
|
|
|
+ [page:constant RGB8I] stores the red, green, and blue components on 8 bits each.
|
|
|
+ Every component is stored as an integer.
|
|
|
+ <br /><br />
|
|
|
+
|
|
|
+ [page:constant RGB8UI] stores the red, green, and blue components on 8 bits each.
|
|
|
+ Every component is stored as an unsigned integer.
|
|
|
+ <br /><br />
|
|
|
+
|
|
|
+ [page:constant RGB16I] stores the red, green, and blue components on 16 bits each.
|
|
|
+ Every component is stored as an integer.
|
|
|
+ <br /><br />
|
|
|
+
|
|
|
+ [page:constant RGB16UI] stores the red, green, and blue components on 16 bits each.
|
|
|
+ Every component is stored as an unsigned integer.
|
|
|
+ <br /><br />
|
|
|
+
|
|
|
+ [page:constant RGB16F] stores the red, green, and blue components on 16 bits each.
|
|
|
+ Every component is stored as floating point
|
|
|
+ <br /><br />
|
|
|
+
|
|
|
+ [page:constant RGB32I] stores the red, green, and blue components on 32 bits each.
|
|
|
+ Every component is stored as an integer.
|
|
|
+ <br /><br />
|
|
|
+
|
|
|
+ [page:constant RGB32UI] stores the red, green, and blue components on 32 bits each.
|
|
|
+ Every component is stored as an unsigned integer.
|
|
|
+ <br /><br />
|
|
|
+
|
|
|
+ [page:constant RGB32F] stores the red, green, and blue components on 32 bits each.
|
|
|
+ Every component is stored as floating point
|
|
|
+ <br /><br />
|
|
|
+
|
|
|
+ [page:constant R11F_G11F_B10F] stores the red, green, and blue components respectively on 11 bits, 11 bits, and 10bits.
|
|
|
+ Every component is stored as floating point.
|
|
|
+ <br /><br />
|
|
|
+
|
|
|
+ [page:constant RGB565] stores the red, green, and blue components respectively on 5 bits, 6 bits, and 5 bits.<br /><br />
|
|
|
+
|
|
|
+ [page:constant RGB9_E5] stores the red, green, and blue components on 9 bits each.<br /><br />
|
|
|
+
|
|
|
+ [page:constant RGBA8] stores the red, green, blue, and alpha components on 8 bits each.<br /><br />
|
|
|
+
|
|
|
+ [page:constant RGBA8_SNORM] stores the red, green, blue, and alpha components on 8 bits.
|
|
|
+ Every component is stored as normalized.
|
|
|
+ <br /><br />
|
|
|
+
|
|
|
+ [page:constant RGBA8I] stores the red, green, blue, and alpha components on 8 bits each.
|
|
|
+ Every component is stored as an integer.
|
|
|
+ <br /><br />
|
|
|
+
|
|
|
+ [page:constant RGBA8UI] stores the red, green, blue, and alpha components on 8 bits.
|
|
|
+ Every component is stored as an unsigned integer.
|
|
|
+ <br /><br />
|
|
|
+
|
|
|
+ [page:constant RGBA16I] stores the red, green, blue, and alpha components on 16 bits.
|
|
|
+ Every component is stored as an integer.
|
|
|
+ <br /><br />
|
|
|
+
|
|
|
+ [page:constant RGBA16UI] stores the red, green, blue, and alpha components on 16 bits.
|
|
|
+ Every component is stored as an unsigned integer.
|
|
|
+ <br /><br />
|
|
|
+
|
|
|
+ [page:constant RGBA16F] stores the red, green, blue, and alpha components on 16 bits.
|
|
|
+ Every component is stored as floating point.
|
|
|
+ <br /><br />
|
|
|
+
|
|
|
+ [page:constant RGBA32I] stores the red, green, blue, and alpha components on 32 bits.
|
|
|
+ Every component is stored as an integer.
|
|
|
+ <br /><br />
|
|
|
+
|
|
|
+ [page:constant RGBA32UI] stores the red, green, blue, and alpha components on 32 bits.
|
|
|
+ Every component is stored as an unsigned integer.
|
|
|
+ <br /><br />
|
|
|
+
|
|
|
+ [page:constant RGBA32F] stores the red, green, blue, and alpha components on 32 bits.
|
|
|
+ Every component is stored as floating point.
|
|
|
+ <br /><br />
|
|
|
+
|
|
|
+ [page:constant RGB5_A1] stores the red, green, blue, and alpha components respectively on 5 bits, 5 bits, 5 bits, and 1 bit.<br /><br />
|
|
|
+
|
|
|
+ [page:constant RGB10_A2] stores the red, green, blue, and alpha components respectively on 10 bits, 10 bits, 10 bits and 2 bits.<br /><br />
|
|
|
+
|
|
|
+ [page:constant RGB10_A2UI] stores the red, green, blue, and alpha components respectively on 10 bits, 10 bits, 10 bits and 2 bits.
|
|
|
+ Every component is stored as an unsigned integer.
|
|
|
+ <br /><br />
|
|
|
+
|
|
|
+ [page:constant SRGB8] stores the red, green, and blue components on 8 bits each.<br /><br />
|
|
|
+
|
|
|
+ [page:constant SRGB8_ALPHA8] stores the red, green, blue, and alpha components on 8 bits each.<br /><br />
|
|
|
+
|
|
|
+ [page:constant DEPTH_COMPONENT16] stores the depth component on 16bits.<br /><br />
|
|
|
+
|
|
|
+ [page:constant DEPTH_COMPONENT24] stores the depth component on 24bits.<br /><br />
|
|
|
+
|
|
|
+ [page:constant DEPTH_COMPONENT32F] stores the depth component on 32bits. The component is stored as floating point.<br /><br />
|
|
|
+
|
|
|
+ [page:constant DEPTH24_STENCIL8] stores the depth, and stencil components respectively on 24 bits and 8 bits.
|
|
|
+ The stencil component is stored as an unsigned integer.
|
|
|
+ <br /><br />
|
|
|
+
|
|
|
+ [page:constant DEPTH32F_STENCIL8] stores the depth, and stencil components respectively on 32 bits and 8 bits.
|
|
|
+ The depth component is stored as floating point, and the stencil component as an unsigned integer.
|
|
|
+ <br /><br />
|
|
|
+
|
|
|
+ Note that the texture must have the correct [page:Texture.type type] set,
|
|
|
+ as well as the correct [page:Texture.format format].
|
|
|
+
|
|
|
+ See [link:https://developer.mozilla.org/en/docs/Web/API/WebGLRenderingContext/texImage2D WebGLRenderingContext.texImage2D], and
|
|
|
+ [link:https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/texImage3D WebGL2RenderingContext.texImage3D],
|
|
|
+ for more details regarding the possible combination of [page:Texture.format format], [page:Texture.internalFormat internalFormat],
|
|
|
+ and [page:Texture.type type].<br /><br />
|
|
|
+
|
|
|
+ For more in-depth information regarding internal formats, you can also refer directly
|
|
|
+ to the [link:https://www.khronos.org/registry/webgl/specs/latest/2.0/ WebGL2 Specification] and
|
|
|
+ to the [link:https://www.khronos.org/registry/OpenGL/specs/es/3.0/es_spec_3.0.pdf OpenGL ES 3.0 Specification].
|
|
|
+ </p>
|
|
|
+
|
|
|
<h2>编码</h2>
|
|
|
<code>
|
|
|
THREE.LinearEncoding
|