Textures.html 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8" />
  5. <base href="../../../" />
  6. <script src="list.js"></script>
  7. <script src="page.js"></script>
  8. <link type="text/css" rel="stylesheet" href="page.css" />
  9. </head>
  10. <body>
  11. <h1>Texture Constants</h1>
  12. <h2>Mapping Modes</h2>
  13. <code>
  14. THREE.UVMapping
  15. THREE.CubeReflectionMapping
  16. THREE.CubeRefractionMapping
  17. THREE.EquirectangularReflectionMapping
  18. THREE.EquirectangularRefractionMapping
  19. THREE.SphericalReflectionMapping
  20. THREE.CubeUVReflectionMapping
  21. THREE.CubeUVRefractionMapping
  22. </code>
  23. <p>
  24. These define the texture's mapping mode.<br />
  25. [page:Constant UVMapping] is the default, and maps the texture using the mesh's UV coordinates.<br /><br />
  26. The rest define environment mapping types.<br /><br />
  27. [page:Constant CubeReflectionMapping] and [page:Constant CubeRefractionMapping] are for
  28. use with a [page:CubeTexture CubeTexture], which is made up of six textures, one for each face of the cube.
  29. [page:Constant CubeReflectionMapping] is the default for a [page:CubeTexture CubeTexture]. <br /><br />
  30. [page:Constant EquirectangularReflectionMapping] and [page:Constant EquirectangularRefractionMapping]
  31. are for use with an equirectangular environment map. Also called a lat-long map, an equirectangular
  32. texture represents a 360-degree view along the horizontal centerline, and a 180-degree view along the
  33. vertical axis, with the top and bottom edges of the image corresponding to the north and south poles
  34. of a mapped sphere.<br /><br />
  35. [page:Constant SphericalReflectionMapping] is for use with a spherical reflection map such as may be obtained
  36. by cropping a photograph of a mirrored ball. Sphere maps will be rendered "facing" the camera, irrespective
  37. of the position of the camera relative to the cubemapped object or surface.<br /><br />
  38. See the [example:webgl_materials_envmaps materials / envmaps] example.
  39. </p>
  40. <h2>Wrapping Modes</h2>
  41. <code>
  42. THREE.RepeatWrapping
  43. THREE.ClampToEdgeWrapping
  44. THREE.MirroredRepeatWrapping
  45. </code>
  46. <p>
  47. These define the texture's [page:Texture.wrapS wrapS] and [page:Texture.wrapT wrapT] properties,
  48. which define horizontal and vertical texture wrapping.<br /><br />
  49. With [page:constant RepeatWrapping] the texture will simply repeat to infinity.<br /><br />
  50. [page:constant ClampToEdgeWrapping] is the default.
  51. The last pixel of the texture stretches to the edge of the mesh.<br /><br />
  52. With [page:constant MirroredRepeatWrapping] the texture will repeats to infinity, mirroring on each repeat.
  53. </p>
  54. <h2>Magnification Filters</h2>
  55. <code>
  56. THREE.NearestFilter
  57. THREE.LinearFilter
  58. </code>
  59. <p>
  60. For use with a texture's [page:Texture.magFilter magFilter] property,
  61. these define the texture magnification function to be used when the pixel being textured maps to an
  62. area less than or equal to one texture element (texel).<br /><br />
  63. [page:constant NearestFilter] returns the value of the texture element that is nearest
  64. (in Manhattan distance) to the specified texture coordinates.<br /><br />
  65. [page:constant LinearFilter] is the default and returns the weighted average
  66. of the four texture elements that are closest to the specified texture coordinates,
  67. and can include items wrapped or repeated from other parts of a texture,
  68. depending on the values of [page:Texture.wrapS wrapS] and [page:Texture.wrapT wrapT], and on the exact mapping.
  69. </p>
  70. <h2>Minification Filters</h2>
  71. <code>
  72. THREE.NearestFilter
  73. THREE.NearestMipmapNearestFilter
  74. THREE.NearestMipmapLinearFilter
  75. THREE.LinearFilter
  76. THREE.LinearMipmapNearestFilter
  77. THREE.LinearMipmapLinearFilter
  78. </code>
  79. <p>
  80. For use with a texture's [page:Texture.minFilter minFilter] property, these define
  81. the texture minifying function that is used whenever the pixel being textured maps
  82. to an area greater than one texture element (texel).<br /><br />
  83. In addition to [page:constant NearestFilter] and [page:constant LinearFilter],
  84. the following four functions can be used for minification:<br /><br />
  85. [page:constant NearestMipmapNearestFilter] chooses the mipmap that most closely
  86. matches the size of the pixel being textured
  87. and uses the [page:constant NearestFilter] criterion (the texel nearest to the
  88. center of the pixel) to produce a texture value.<br /><br />
  89. [page:constant NearestMipmapLinearFilter] chooses the two mipmaps that most closely
  90. match the size of the pixel being textured and uses the [page:constant NearestFilter] criterion to produce
  91. a texture value from each mipmap. The final texture value is a weighted average of those two values.<br /><br />
  92. [page:constant LinearMipmapNearestFilter] chooses the mipmap that most closely matches
  93. the size of the pixel being textured and uses the [page:constant LinearFilter] criterion
  94. (a weighted average of the four texels that are closest to the center of the pixel)
  95. to produce a texture value.<br /><br />
  96. [page:constant LinearMipmapLinearFilter] is the default and chooses the two mipmaps
  97. that most closely match the size of the pixel being textured and uses the [page:constant LinearFilter] criterion
  98. to produce a texture value from each mipmap. The final texture value is a weighted average of those two values.<br /><br />
  99. See the [example:webgl_materials_texture_filters materials / texture / filters] example.
  100. </p>
  101. <h2>Types</h2>
  102. <code>
  103. THREE.UnsignedByteType
  104. THREE.ByteType
  105. THREE.ShortType
  106. THREE.UnsignedShortType
  107. THREE.IntType
  108. THREE.UnsignedIntType
  109. THREE.FloatType
  110. THREE.HalfFloatType
  111. THREE.UnsignedShort4444Type
  112. THREE.UnsignedShort5551Type
  113. THREE.UnsignedShort565Type
  114. THREE.UnsignedInt248Type
  115. </code>
  116. <p>
  117. For use with a texture's [page:Texture.type type] property, which must correspond to the correct format. See below for details.<br /><br />
  118. [page:constant UnsignedByteType] is the default.
  119. </p>
  120. <h2>Formats</h2>
  121. <code>
  122. THREE.AlphaFormat
  123. THREE.RedFormat
  124. THREE.RedIntegerFormat
  125. THREE.RGFormat
  126. THREE.RGIntegerFormat
  127. THREE.RGBFormat
  128. THREE.RGBIntegerFormat
  129. THREE.RGBAFormat
  130. THREE.RGBAIntegerFormat
  131. THREE.LuminanceFormat
  132. THREE.LuminanceAlphaFormat
  133. THREE.RGBEFormat
  134. THREE.DepthFormat
  135. THREE.DepthStencilFormat
  136. </code>
  137. <p>
  138. For use with a texture's [page:Texture.format format] property, these define
  139. how elements of a 2d texture, or *texels*, are read by shaders.<br /><br />
  140. [page:constant AlphaFormat] discards the red, green and blue components and reads just the alpha component.<br /><br />
  141. [page:constant RedFormat] discards the green and blue components and reads just the red component.<br /><br />
  142. [page:constant RedIntegerFormat] discards the green and blue components and reads just the red component.
  143. The texels are read as integers instead of floating point.
  144. (can only be used with a WebGL 2 rendering context).
  145. <br /><br />
  146. [page:constant RGFormat] discards the alpha, and blue components and reads the red, and green components.
  147. (can only be used with a WebGL 2 rendering context).
  148. <br /><br />
  149. [page:constant RGIntegerFormat] discards the alpha, and blue components and reads the red, and green components.
  150. The texels are read as integers instead of floating point.
  151. (can only be used with a WebGL 2 rendering context).
  152. <br /><br />
  153. [page:constant RGBFormat] discards the alpha components and reads the red, green and blue components.<br /><br />
  154. [page:constant RGBIntegerFormat] discards the alpha components and reads the red, green and blue components.
  155. (can only be used with a WebGL 2 rendering context).
  156. <br /><br />
  157. [page:constant RGBAFormat] is the default and reads the red, green, blue and alpha components.<br /><br />
  158. [page:constant RGBAIntegerFormat] is the default and reads the red, green, blue and alpha components.
  159. The texels are read as integers instead of floating point.
  160. (can only be used with a WebGL 2 rendering context).
  161. <br /><br />
  162. [page:constant LuminanceFormat] reads each element as a single luminance component.
  163. This is then converted to a floating point, clamped to the range [0,1], and then assembled
  164. into an RGBA element by placing the luminance value in the red, green and blue channels,
  165. and attaching 1.0 to the alpha channel.<br /><br />
  166. [page:constant LuminanceAlphaFormat] reads each element as a luminance/alpha double.
  167. The same process occurs as for the [page:constant LuminanceFormat], except that the
  168. alpha channel may have values other than *1.0*.<br /><br />
  169. [page:constant RGBEFormat] is identical to [page:constant RGBAFormat].<br /><br />
  170. [page:constant DepthFormat] reads each element as a single depth value, converts it to floating point, and clamps to the range [0,1].
  171. This is the default for [page:DepthTexture DepthTexture].<br /><br />
  172. [page:constant DepthStencilFormat] reads each element is a pair of depth and stencil values.
  173. The depth component of the pair is interpreted as in [page:constant DepthFormat].
  174. The stencil component is interpreted based on the depth + stencil internal format.
  175. <br /><br />
  176. Note that the texture must have the correct [page:Texture.type type] set, as described above.
  177. See [link:https://developer.mozilla.org/en/docs/Web/API/WebGLRenderingContext/texImage2D WebGLRenderingContext.texImage2D] for details.
  178. </p>
  179. <h2>DDS / ST3C Compressed Texture Formats</h2>
  180. <code>
  181. THREE.RGB_S3TC_DXT1_Format
  182. THREE.RGBA_S3TC_DXT1_Format
  183. THREE.RGBA_S3TC_DXT3_Format
  184. THREE.RGBA_S3TC_DXT5_Format
  185. </code>
  186. <p>
  187. For use with a [page:CompressedTexture CompressedTexture]'s [page:Texture.format format] property,
  188. these require support for the
  189. [link:https://www.khronos.org/registry/webgl/extensions/WEBGL_compressed_texture_s3tc/ WEBGL_compressed_texture_s3tc]
  190. extension. <br /><br />
  191. There are four [link:https://en.wikipedia.org/wiki/S3_Texture_Compression S3TC] formats available via this extension. These are:<br />
  192. [page:constant RGB_S3TC_DXT1_Format]: A DXT1-compressed image in an RGB image format.<br />
  193. [page:constant RGBA_S3TC_DXT1_Format]: A DXT1-compressed image in an RGB image format with a simple on/off alpha value.<br />
  194. [page:constant RGBA_S3TC_DXT3_Format]: A DXT3-compressed image in an RGBA image format. Compared to a 32-bit RGBA texture, it offers 4:1 compression.<br />
  195. [page:constant RGBA_S3TC_DXT5_Format]: A DXT5-compressed image in an RGBA image format. It also provides a 4:1 compression, but differs to the DXT3 compression in how the alpha compression is done.<br />
  196. </p>
  197. <h2>PVRTC Compressed Texture Formats</h2>
  198. <code>
  199. THREE.RGB_PVRTC_4BPPV1_Format
  200. THREE.RGB_PVRTC_2BPPV1_Format
  201. THREE.RGBA_PVRTC_4BPPV1_Format
  202. THREE.RGBA_PVRTC_2BPPV1_Format
  203. </code>
  204. <p>
  205. For use with a [page:CompressedTexture CompressedTexture]'s [page:Texture.format format] property,
  206. these require support for the [link:https://www.khronos.org/registry/webgl/extensions/WEBGL_compressed_texture_pvrtc/ WEBGL_compressed_texture_pvrtc]
  207. extension. <br />
  208. PVRTC is typically only available on mobile devices with PowerVR chipsets, which are mainly Apple devices.<br /><br />
  209. There are four [link:https://en.wikipedia.org/wiki/PVRTC PVRTC] formats available via this extension. These are:<br />
  210. [page:constant RGB_PVRTC_4BPPV1_Format]: RGB compression in 4-bit mode. One block for each 4×4 pixels.<br />
  211. [page:constant RGB_PVRTC_2BPPV1_Format]: RGB compression in 2-bit mode. One block for each 8×4 pixels.<br />
  212. [page:constant RGBA_PVRTC_4BPPV1_Format]: RGBA compression in 4-bit mode. One block for each 4×4 pixels.<br />
  213. [page:constant RGBA_PVRTC_2BPPV1_Format]: RGBA compression in 2-bit mode. One block for each 8×4 pixels.<br />
  214. </p>
  215. <h2>ETC Compressed Texture Format</h2>
  216. <code>
  217. THREE.RGB_ETC1_Format
  218. THREE.RGB_ETC2_Format
  219. THREE.RGBA_ETC2_EAC_Format
  220. </code>
  221. <p>
  222. For use with a [page:CompressedTexture CompressedTexture]'s [page:Texture.format format] property,
  223. these require support for the [link:https://www.khronos.org/registry/webgl/extensions/WEBGL_compressed_texture_etc1/ WEBGL_compressed_texture_etc1]
  224. (ETC1) or [link:https://www.khronos.org/registry/webgl/extensions/WEBGL_compressed_texture_etc/ WEBGL_compressed_texture_etc]
  225. (ETC2) extensions. <br /><br />
  226. </p>
  227. <h2>ASTC Compressed Texture Format</h2>
  228. <code>
  229. THREE.RGBA_ASTC_4x4_Format
  230. THREE.RGBA_ASTC_5x4_Format
  231. THREE.RGBA_ASTC_5x5_Format
  232. THREE.RGBA_ASTC_6x5_Format
  233. THREE.RGBA_ASTC_6x6_Format
  234. THREE.RGBA_ASTC_8x5_Format
  235. THREE.RGBA_ASTC_8x6_Format
  236. THREE.RGBA_ASTC_8x8_Format
  237. THREE.RGBA_ASTC_10x5_Format
  238. THREE.RGBA_ASTC_10x6_Format
  239. THREE.RGBA_ASTC_10x8_Format
  240. THREE.RGBA_ASTC_10x10_Format
  241. THREE.RGBA_ASTC_12x10_Format
  242. THREE.RGBA_ASTC_12x12_Format
  243. THREE.SRGB8_ALPHA8_ASTC_4x4_Format
  244. THREE.SRGB8_ALPHA8_ASTC_5x4_Format
  245. THREE.SRGB8_ALPHA8_ASTC_5x5_Format
  246. THREE.SRGB8_ALPHA8_ASTC_6x5_Format
  247. THREE.SRGB8_ALPHA8_ASTC_6x6_Format
  248. THREE.SRGB8_ALPHA8_ASTC_8x5_Format
  249. THREE.SRGB8_ALPHA8_ASTC_8x6_Format
  250. THREE.SRGB8_ALPHA8_ASTC_8x8_Format
  251. THREE.SRGB8_ALPHA8_ASTC_10x5_Format
  252. THREE.SRGB8_ALPHA8_ASTC_10x6_Format
  253. THREE.SRGB8_ALPHA8_ASTC_10x8_Format
  254. THREE.SRGB8_ALPHA8_ASTC_10x10_Format
  255. THREE.SRGB8_ALPHA8_ASTC_12x10_Format
  256. THREE.SRGB8_ALPHA8_ASTC_12x12_Format
  257. </code>
  258. <p>
  259. For use with a [page:CompressedTexture CompressedTexture]'s [page:Texture.format format] property,
  260. these require support for the [link:https://www.khronos.org/registry/webgl/extensions/WEBGL_compressed_texture_astc/ WEBGL_compressed_texture_astc] extension. <br /><br />
  261. </p>
  262. <h2>Internal Formats</h2>
  263. <code>
  264. 'ALPHA'
  265. 'RGB'
  266. 'RGBA'
  267. 'LUMINANCE'
  268. 'LUMINANCE_ALPHA'
  269. 'RED_INTEGER'
  270. 'R8'
  271. 'R8_SNORM'
  272. 'R8I'
  273. 'R8UI'
  274. 'R16I'
  275. 'R16UI'
  276. 'R16F'
  277. 'R32I'
  278. 'R32UI'
  279. 'R32F'
  280. 'RG8'
  281. 'RG8_SNORM'
  282. 'RG8I'
  283. 'RG8UI'
  284. 'RG16I'
  285. 'RG16UI'
  286. 'RG16F'
  287. 'RG32I'
  288. 'RG32UI'
  289. 'RG32F'
  290. 'RGB565'
  291. 'RGB8'
  292. 'RGB8_SNORM'
  293. 'RGB8I'
  294. 'RGB8UI'
  295. 'RGB16I'
  296. 'RGB16UI'
  297. 'RGB16F'
  298. 'RGB32I'
  299. 'RGB32UI'
  300. 'RGB32F'
  301. 'RGB9_E5'
  302. 'SRGB8'
  303. 'R11F_G11F_B10F'
  304. 'RGBA4'
  305. 'RGBA8'
  306. 'RGBA8_SNORM'
  307. 'RGBA8I'
  308. 'RGBA8UI'
  309. 'RGBA16I'
  310. 'RGBA16UI'
  311. 'RGBA16F'
  312. 'RGBA32I'
  313. 'RGBA32UI'
  314. 'RGBA32F'
  315. 'RGB5_A1'
  316. 'RGB10_A2'
  317. 'RGB10_A2UI'
  318. 'SRGB8_ALPHA8'
  319. 'DEPTH_COMPONENT16'
  320. 'DEPTH_COMPONENT24'
  321. 'DEPTH_COMPONENT32F'
  322. 'DEPTH24_STENCIL8'
  323. 'DEPTH32F_STENCIL8'
  324. </code>
  325. <p>
  326. Heads up: changing the internal format of a texture will only affect the
  327. texture when using a WebGL 2 rendering context.<br /><br />
  328. For use with a texture's [page:Texture.internalFormat internalFormat] property,
  329. these define how elements of a texture, or *texels*, are stored on the GPU.<br /><br />
  330. [page:constant R8] stores the red component on 8 bits.<br /><br />
  331. [page:constant R8_SNORM] stores the red component on 8 bits. The component is stored as normalized. <br /><br />
  332. [page:constant R8I] stores the red component on 8 bits. The component is stored as an integer. <br /><br />
  333. [page:constant R8UI] stores the red component on 8 bits. The component is stored as an unsigned integer. <br /><br />
  334. [page:constant R16I] stores the red component on 16 bits. The component is stored as an integer. <br /><br />
  335. [page:constant R16UI] stores the red component on 16 bits. The component is stored as an unsigned integer. <br /><br />
  336. [page:constant R16F] stores the red component on 16 bits. The component is stored as floating point. <br /><br />
  337. [page:constant R32I] stores the red component on 32 bits. The component is stored as an integer. <br /><br />
  338. [page:constant R32UI] stores the red component on 32 bits. The component is stored as an unsigned integer. <br /><br />
  339. [page:constant R32F] stores the red component on 32 bits. The component is stored as floating point. <br /><br />
  340. [page:constant RG8] stores the red and green components on 8 bits each.<br /><br />
  341. [page:constant RG8_SNORM] stores the red and green components on 8 bits each.
  342. Every component is stored as normalized.
  343. <br /><br />
  344. [page:constant RG8I] stores the red and green components on 8 bits each.
  345. Every component is stored as an integer.
  346. <br /><br />
  347. [page:constant RG8UI] stores the red and green components on 8 bits each.
  348. Every component is stored as an unsigned integer.
  349. <br /><br />
  350. [page:constant RG16I] stores the red and green components on 16 bits each.
  351. Every component is stored as an integer.
  352. <br /><br />
  353. [page:constant RG16UI] stores the red and green components on 16 bits each.
  354. Every component is stored as an unsigned integer.
  355. <br /><br />
  356. [page:constant RG16F] stores the red and green components on 16 bits each.
  357. Every component is stored as floating point.
  358. <br /><br />
  359. [page:constant RG32I] stores the red and green components on 32 bits each.
  360. Every component is stored as an integer.
  361. <br /><br />
  362. [page:constant RG32UI] stores the red and green components on 32 bits.
  363. Every component is stored as an unsigned integer.
  364. <br /><br />
  365. [page:constant RG32F] stores the red and green components on 32 bits.
  366. Every component is stored as floating point.
  367. <br /><br />
  368. [page:constant RGB8] stores the red, green, and blue components on 8 bits each.
  369. [page:constant RGB8_SNORM] stores the red, green, and blue components on 8 bits each.
  370. Every component is stored as normalized.
  371. <br /><br />
  372. [page:constant RGB8I] stores the red, green, and blue components on 8 bits each.
  373. Every component is stored as an integer.
  374. <br /><br />
  375. [page:constant RGB8UI] stores the red, green, and blue components on 8 bits each.
  376. Every component is stored as an unsigned integer.
  377. <br /><br />
  378. [page:constant RGB16I] stores the red, green, and blue components on 16 bits each.
  379. Every component is stored as an integer.
  380. <br /><br />
  381. [page:constant RGB16UI] stores the red, green, and blue components on 16 bits each.
  382. Every component is stored as an unsigned integer.
  383. <br /><br />
  384. [page:constant RGB16F] stores the red, green, and blue components on 16 bits each.
  385. Every component is stored as floating point
  386. <br /><br />
  387. [page:constant RGB32I] stores the red, green, and blue components on 32 bits each.
  388. Every component is stored as an integer.
  389. <br /><br />
  390. [page:constant RGB32UI] stores the red, green, and blue components on 32 bits each.
  391. Every component is stored as an unsigned integer.
  392. <br /><br />
  393. [page:constant RGB32F] stores the red, green, and blue components on 32 bits each.
  394. Every component is stored as floating point
  395. <br /><br />
  396. [page:constant R11F_G11F_B10F] stores the red, green, and blue components respectively on 11 bits, 11 bits, and 10bits.
  397. Every component is stored as floating point.
  398. <br /><br />
  399. [page:constant RGB565] stores the red, green, and blue components respectively on 5 bits, 6 bits, and 5 bits.<br /><br />
  400. [page:constant RGB9_E5] stores the red, green, and blue components on 9 bits each.<br /><br />
  401. [page:constant RGBA8] stores the red, green, blue, and alpha components on 8 bits each.<br /><br />
  402. [page:constant RGBA8_SNORM] stores the red, green, blue, and alpha components on 8 bits.
  403. Every component is stored as normalized.
  404. <br /><br />
  405. [page:constant RGBA8I] stores the red, green, blue, and alpha components on 8 bits each.
  406. Every component is stored as an integer.
  407. <br /><br />
  408. [page:constant RGBA8UI] stores the red, green, blue, and alpha components on 8 bits.
  409. Every component is stored as an unsigned integer.
  410. <br /><br />
  411. [page:constant RGBA16I] stores the red, green, blue, and alpha components on 16 bits.
  412. Every component is stored as an integer.
  413. <br /><br />
  414. [page:constant RGBA16UI] stores the red, green, blue, and alpha components on 16 bits.
  415. Every component is stored as an unsigned integer.
  416. <br /><br />
  417. [page:constant RGBA16F] stores the red, green, blue, and alpha components on 16 bits.
  418. Every component is stored as floating point.
  419. <br /><br />
  420. [page:constant RGBA32I] stores the red, green, blue, and alpha components on 32 bits.
  421. Every component is stored as an integer.
  422. <br /><br />
  423. [page:constant RGBA32UI] stores the red, green, blue, and alpha components on 32 bits.
  424. Every component is stored as an unsigned integer.
  425. <br /><br />
  426. [page:constant RGBA32F] stores the red, green, blue, and alpha components on 32 bits.
  427. Every component is stored as floating point.
  428. <br /><br />
  429. [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 />
  430. [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 />
  431. [page:constant RGB10_A2UI] stores the red, green, blue, and alpha components respectively on 10 bits, 10 bits, 10 bits and 2 bits.
  432. Every component is stored as an unsigned integer.
  433. <br /><br />
  434. [page:constant SRGB8] stores the red, green, and blue components on 8 bits each.<br /><br />
  435. [page:constant SRGB8_ALPHA8] stores the red, green, blue, and alpha components on 8 bits each.<br /><br />
  436. [page:constant DEPTH_COMPONENT16] stores the depth component on 16bits.<br /><br />
  437. [page:constant DEPTH_COMPONENT24] stores the depth component on 24bits.<br /><br />
  438. [page:constant DEPTH_COMPONENT32F] stores the depth component on 32bits. The component is stored as floating point.<br /><br />
  439. [page:constant DEPTH24_STENCIL8] stores the depth, and stencil components respectively on 24 bits and 8 bits.
  440. The stencil component is stored as an unsigned integer.
  441. <br /><br />
  442. [page:constant DEPTH32F_STENCIL8] stores the depth, and stencil components respectively on 32 bits and 8 bits.
  443. The depth component is stored as floating point, and the stencil component as an unsigned integer.
  444. <br /><br />
  445. Note that the texture must have the correct [page:Texture.type type] set,
  446. as well as the correct [page:Texture.format format].
  447. See [link:https://developer.mozilla.org/en/docs/Web/API/WebGLRenderingContext/texImage2D WebGLRenderingContext.texImage2D], and
  448. [link:https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/texImage3D WebGL2RenderingContext.texImage3D],
  449. for more details regarding the possible combination of [page:Texture.format format], [page:Texture.internalFormat internalFormat],
  450. and [page:Texture.type type].<br /><br />
  451. For more in-depth information regarding internal formats, you can also refer directly
  452. to the [link:https://www.khronos.org/registry/webgl/specs/latest/2.0/ WebGL2 Specification] and
  453. to the [link:https://www.khronos.org/registry/OpenGL/specs/es/3.0/es_spec_3.0.pdf OpenGL ES 3.0 Specification].
  454. </p>
  455. <h2>Encoding</h2>
  456. <code>
  457. THREE.LinearEncoding
  458. THREE.sRGBEncoding
  459. THREE.GammaEncoding
  460. THREE.RGBEEncoding
  461. THREE.LogLuvEncoding
  462. THREE.RGBM7Encoding
  463. THREE.RGBM16Encoding
  464. THREE.RGBDEncoding
  465. THREE.BasicDepthPacking
  466. THREE.RGBADepthPacking
  467. </code>
  468. <p>
  469. For use with a Texture's [page:Texture.encoding encoding] property.<br /><br />
  470. If the encoding type is changed after the texture has already been used by a material,
  471. you will need to set [page:Material.needsUpdate Material.needsUpdate] to *true* to make the material recompile.<br /><br />
  472. [page:constant LinearEncoding] is the default.
  473. Values other than this are only valid for a material's map, envMap and emissiveMap.
  474. </p>
  475. <h2>Source</h2>
  476. <p>
  477. [link:https://github.com/mrdoob/three.js/blob/master/src/constants.js src/constants.js]
  478. </p>
  479. </body>
  480. </html>