Textures.html 23 KB

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