Textures.html 23 KB

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