Textures.html 22 KB

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