Textures.html 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629
  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. THREE.UnsignedInt5999Type
  124. </code>
  125. <p>
  126. For use with a texture's [page:Texture.type type] property, which must
  127. correspond to the correct format. See below for details.<br /><br />
  128. [page:constant UnsignedByteType] is the default.
  129. </p>
  130. <h2>Formats</h2>
  131. <code>
  132. THREE.AlphaFormat
  133. THREE.RedFormat
  134. THREE.RedIntegerFormat
  135. THREE.RGFormat
  136. THREE.RGIntegerFormat
  137. THREE.RGBFormat
  138. THREE.RGBAFormat
  139. THREE.RGBAIntegerFormat
  140. THREE.LuminanceFormat
  141. THREE.LuminanceAlphaFormat
  142. THREE.DepthFormat
  143. THREE.DepthStencilFormat
  144. </code>
  145. <p>
  146. For use with a texture's [page:Texture.format format] property, these
  147. define how elements of a 2d texture, or `texels`, are read by shaders.<br /><br />
  148. [page:constant AlphaFormat] discards the red, green and blue components
  149. and reads just the alpha component.<br /><br />
  150. [page:constant RedFormat] discards the green and blue components and reads
  151. just the red component.
  152. <br /><br />
  153. [page:constant RedIntegerFormat] discards the green and blue components
  154. and reads just the red component. The texels are read as integers instead
  155. of floating point.
  156. <br /><br />
  157. [page:constant RGFormat] discards the alpha, and blue components and reads
  158. the red, and green components.
  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.
  163. <br /><br />
  164. [page:constant RGBAFormat] is the default and reads the red, green, blue
  165. and alpha components.<br /><br />
  166. [page:constant RGBAIntegerFormat] is the default and reads the red, green,
  167. blue and alpha components. The texels are read as integers instead of
  168. floating point.
  169. <br /><br />
  170. [page:constant LuminanceFormat] reads each element as a single luminance
  171. component. This is then converted to a floating point, clamped to the
  172. range [0,1], and then assembled into an RGBA element by placing the
  173. luminance value in the red, green and blue channels, and attaching 1.0 to
  174. the alpha channel.<br /><br />
  175. [page:constant LuminanceAlphaFormat] reads each element as a
  176. luminance/alpha double. The same process occurs as for the [page:constant LuminanceFormat], except that the alpha channel may have values other than
  177. `1.0`.<br /><br />
  178. [page:constant DepthFormat] reads each element as a single depth value,
  179. converts it to floating point, and clamps to the range [0,1]. This is the
  180. default for [page:DepthTexture DepthTexture].<br /><br />
  181. [page:constant DepthStencilFormat] reads each element is a pair of depth
  182. and stencil values. The depth component of the pair is interpreted as in
  183. [page:constant DepthFormat]. The stencil component is interpreted based on
  184. the depth + stencil internal format.
  185. <br /><br />
  186. Note that the texture must have the correct [page:Texture.type type] set,
  187. as described above. See
  188. [link:https://developer.mozilla.org/en/docs/Web/API/WebGLRenderingContext/texImage2D WebGLRenderingContext.texImage2D] for details.
  189. </p>
  190. <h2>DDS / ST3C Compressed Texture Formats</h2>
  191. <code>
  192. THREE.RGB_S3TC_DXT1_Format
  193. THREE.RGBA_S3TC_DXT1_Format
  194. THREE.RGBA_S3TC_DXT3_Format
  195. THREE.RGBA_S3TC_DXT5_Format
  196. </code>
  197. <p>
  198. For use with a [page:CompressedTexture CompressedTexture]'s
  199. [page:Texture.format format] property, these require support for the
  200. [link:https://www.khronos.org/registry/webgl/extensions/WEBGL_compressed_texture_s3tc/ WEBGL_compressed_texture_s3tc] extension. <br /><br />
  201. There are four [link:https://en.wikipedia.org/wiki/S3_Texture_Compression S3TC] formats available via this extension. These are:<br />
  202. [page:constant RGB_S3TC_DXT1_Format]: A DXT1-compressed image in an RGB
  203. image format.<br />
  204. [page:constant RGBA_S3TC_DXT1_Format]: A DXT1-compressed image in an RGB
  205. image format with a simple on/off alpha value.<br />
  206. [page:constant RGBA_S3TC_DXT3_Format]: A DXT3-compressed image in an RGBA
  207. image format. Compared to a 32-bit RGBA texture, it offers 4:1
  208. compression.<br />
  209. [page:constant RGBA_S3TC_DXT5_Format]: A DXT5-compressed image in an RGBA
  210. image format. It also provides a 4:1 compression, but differs to the DXT3
  211. compression in how the alpha compression is done.<br />
  212. </p>
  213. <h2>PVRTC Compressed Texture Formats</h2>
  214. <code>
  215. THREE.RGB_PVRTC_4BPPV1_Format
  216. THREE.RGB_PVRTC_2BPPV1_Format
  217. THREE.RGBA_PVRTC_4BPPV1_Format
  218. THREE.RGBA_PVRTC_2BPPV1_Format
  219. </code>
  220. <p>
  221. For use with a [page:CompressedTexture CompressedTexture]'s
  222. [page:Texture.format format] property, these require support for the
  223. [link:https://www.khronos.org/registry/webgl/extensions/WEBGL_compressed_texture_pvrtc/ WEBGL_compressed_texture_pvrtc] extension. <br />
  224. PVRTC is typically only available on mobile devices with PowerVR chipsets,
  225. which are mainly Apple devices.<br /><br />
  226. There are four [link:https://en.wikipedia.org/wiki/PVRTC PVRTC] formats
  227. available via this extension. These are:<br />
  228. [page:constant RGB_PVRTC_4BPPV1_Format]: RGB compression in 4-bit mode.
  229. One block for each 4×4 pixels.<br />
  230. [page:constant RGB_PVRTC_2BPPV1_Format]: RGB compression in 2-bit mode.
  231. One block for each 8×4 pixels.<br />
  232. [page:constant RGBA_PVRTC_4BPPV1_Format]: RGBA compression in 4-bit mode.
  233. One block for each 4×4 pixels.<br />
  234. [page:constant RGBA_PVRTC_2BPPV1_Format]: RGBA compression in 2-bit mode.
  235. One block for each 8×4 pixels.<br />
  236. </p>
  237. <h2>ETC Compressed Texture Format</h2>
  238. <code>
  239. THREE.RGB_ETC1_Format
  240. THREE.RGB_ETC2_Format
  241. THREE.RGBA_ETC2_EAC_Format
  242. </code>
  243. <p>
  244. For use with a [page:CompressedTexture CompressedTexture]'s
  245. [page:Texture.format format] property, these require support for the
  246. [link:https://www.khronos.org/registry/webgl/extensions/WEBGL_compressed_texture_etc1/ WEBGL_compressed_texture_etc1] (ETC1) or
  247. [link:https://www.khronos.org/registry/webgl/extensions/WEBGL_compressed_texture_etc/ WEBGL_compressed_texture_etc] (ETC2) extensions. <br /><br />
  248. </p>
  249. <h2>ASTC Compressed Texture Format</h2>
  250. <code>
  251. THREE.RGBA_ASTC_4x4_Format
  252. THREE.RGBA_ASTC_5x4_Format
  253. THREE.RGBA_ASTC_5x5_Format
  254. THREE.RGBA_ASTC_6x5_Format
  255. THREE.RGBA_ASTC_6x6_Format
  256. THREE.RGBA_ASTC_8x5_Format
  257. THREE.RGBA_ASTC_8x6_Format
  258. THREE.RGBA_ASTC_8x8_Format
  259. THREE.RGBA_ASTC_10x5_Format
  260. THREE.RGBA_ASTC_10x6_Format
  261. THREE.RGBA_ASTC_10x8_Format
  262. THREE.RGBA_ASTC_10x10_Format
  263. THREE.RGBA_ASTC_12x10_Format
  264. THREE.RGBA_ASTC_12x12_Format
  265. </code>
  266. <p>
  267. For use with a [page:CompressedTexture CompressedTexture]'s
  268. [page:Texture.format format] property, these require support for the
  269. [link:https://www.khronos.org/registry/webgl/extensions/WEBGL_compressed_texture_astc/ WEBGL_compressed_texture_astc] extension. <br /><br />
  270. </p>
  271. <h2>BPTC Compressed Texture Format</h2>
  272. <code>
  273. THREE.RGBA_BPTC_Format
  274. </code>
  275. <p>
  276. For use with a [page:CompressedTexture CompressedTexture]'s
  277. [page:Texture.format format] property, these require support for the
  278. [link:https://www.khronos.org/registry/webgl/extensions/EXT_texture_compression_bptc/ EXT_texture_compression_bptc] extension. <br /><br />
  279. </p>
  280. <h2>Texture Comparison functions</h2>
  281. <code>
  282. THREE.NeverCompare
  283. THREE.LessCompare
  284. THREE.EqualCompare
  285. THREE.LessEqualCompare
  286. THREE.GreaterCompare
  287. THREE.NotEqualCompare
  288. THREE.GreaterEqualCompare
  289. THREE.AlwaysCompare
  290. </code>
  291. <h2>Internal Formats</h2>
  292. <code>
  293. 'ALPHA'
  294. 'RGB'
  295. 'RGBA'
  296. 'LUMINANCE'
  297. 'LUMINANCE_ALPHA'
  298. 'RED_INTEGER'
  299. 'R8'
  300. 'R8_SNORM'
  301. 'R8I'
  302. 'R8UI'
  303. 'R16I'
  304. 'R16UI'
  305. 'R16F'
  306. 'R32I'
  307. 'R32UI'
  308. 'R32F'
  309. 'RG8'
  310. 'RG8_SNORM'
  311. 'RG8I'
  312. 'RG8UI'
  313. 'RG16I'
  314. 'RG16UI'
  315. 'RG16F'
  316. 'RG32I'
  317. 'RG32UI'
  318. 'RG32F'
  319. 'RGB565'
  320. 'RGB8'
  321. 'RGB8_SNORM'
  322. 'RGB8I'
  323. 'RGB8UI'
  324. 'RGB16I'
  325. 'RGB16UI'
  326. 'RGB16F'
  327. 'RGB32I'
  328. 'RGB32UI'
  329. 'RGB32F'
  330. 'RGB9_E5'
  331. 'SRGB8'
  332. 'R11F_G11F_B10F'
  333. 'RGBA4'
  334. 'RGBA8'
  335. 'RGBA8_SNORM'
  336. 'RGBA8I'
  337. 'RGBA8UI'
  338. 'RGBA16I'
  339. 'RGBA16UI'
  340. 'RGBA16F'
  341. 'RGBA32I'
  342. 'RGBA32UI'
  343. 'RGBA32F'
  344. 'RGB5_A1'
  345. 'RGB10_A2'
  346. 'RGB10_A2UI'
  347. 'SRGB8_ALPHA8'
  348. 'DEPTH_COMPONENT16'
  349. 'DEPTH_COMPONENT24'
  350. 'DEPTH_COMPONENT32F'
  351. 'DEPTH24_STENCIL8'
  352. 'DEPTH32F_STENCIL8'
  353. </code>
  354. <p>
  355. For use with a texture's [page:Texture.internalFormat internalFormat]
  356. property, these define how elements of a texture, or `texels`, are stored
  357. on the GPU.<br /><br />
  358. [page:constant R8] stores the red component on 8 bits.<br /><br />
  359. [page:constant R8_SNORM] stores the red component on 8 bits. The component
  360. is stored as normalized. <br /><br />
  361. [page:constant R8I] stores the red component on 8 bits. The component is
  362. stored as an integer. <br /><br />
  363. [page:constant R8UI] stores the red component on 8 bits. The component is
  364. stored as an unsigned integer. <br /><br />
  365. [page:constant R16I] stores the red component on 16 bits. The component is
  366. stored as an integer. <br /><br />
  367. [page:constant R16UI] stores the red component on 16 bits. The component
  368. is stored as an unsigned integer. <br /><br />
  369. [page:constant R16F] stores the red component on 16 bits. The component is
  370. stored as floating point. <br /><br />
  371. [page:constant R32I] stores the red component on 32 bits. The component is
  372. stored as an integer. <br /><br />
  373. [page:constant R32UI] stores the red component on 32 bits. The component
  374. is stored as an unsigned integer. <br /><br />
  375. [page:constant R32F] stores the red component on 32 bits. The component is
  376. stored as floating point. <br /><br />
  377. [page:constant RG8] stores the red and green components on 8 bits each.<br /><br />
  378. [page:constant RG8_SNORM] stores the red and green components on 8 bits
  379. each. Every component is stored as normalized.
  380. <br /><br />
  381. [page:constant RG8I] stores the red and green components on 8 bits each.
  382. Every component is stored as an integer.
  383. <br /><br />
  384. [page:constant RG8UI] stores the red and green components on 8 bits each.
  385. Every component is stored as an unsigned integer.
  386. <br /><br />
  387. [page:constant RG16I] stores the red and green components on 16 bits each.
  388. Every component is stored as an integer.
  389. <br /><br />
  390. [page:constant RG16UI] stores the red and green components on 16 bits
  391. each. Every component is stored as an unsigned integer.
  392. <br /><br />
  393. [page:constant RG16F] stores the red and green components on 16 bits each.
  394. Every component is stored as floating point.
  395. <br /><br />
  396. [page:constant RG32I] stores the red and green components on 32 bits each.
  397. Every component is stored as an integer.
  398. <br /><br />
  399. [page:constant RG32UI] stores the red and green components on 32 bits.
  400. Every component is stored as an unsigned integer.
  401. <br /><br />
  402. [page:constant RG32F] stores the red and green components on 32 bits.
  403. Every component is stored as floating point.
  404. <br /><br />
  405. [page:constant RGB8] stores the red, green, and blue components on 8 bits
  406. each. [page:constant RGB8_SNORM] stores the red, green, and blue
  407. components on 8 bits each. Every component is stored as normalized.
  408. <br /><br />
  409. [page:constant RGB8I] stores the red, green, and blue components on 8 bits
  410. each. Every component is stored as an integer.
  411. <br /><br />
  412. [page:constant RGB8UI] stores the red, green, and blue components on 8
  413. bits each. Every component is stored as an unsigned integer.
  414. <br /><br />
  415. [page:constant RGB16I] stores the red, green, and blue components on 16
  416. bits each. Every component is stored as an integer.
  417. <br /><br />
  418. [page:constant RGB16UI] stores the red, green, and blue components on 16
  419. bits each. Every component is stored as an unsigned integer.
  420. <br /><br />
  421. [page:constant RGB16F] stores the red, green, and blue components on 16
  422. bits each. Every component is stored as floating point
  423. <br /><br />
  424. [page:constant RGB32I] stores the red, green, and blue components on 32
  425. bits each. Every component is stored as an integer.
  426. <br /><br />
  427. [page:constant RGB32UI] stores the red, green, and blue components on 32
  428. bits each. Every component is stored as an unsigned integer.
  429. <br /><br />
  430. [page:constant RGB32F] stores the red, green, and blue components on 32
  431. bits each. Every component is stored as floating point
  432. <br /><br />
  433. [page:constant R11F_G11F_B10F] stores the red, green, and blue components
  434. respectively on 11 bits, 11 bits, and 10bits. Every component is stored as
  435. floating point.
  436. <br /><br />
  437. [page:constant RGB565] stores the red, green, and blue components
  438. respectively on 5 bits, 6 bits, and 5 bits.<br /><br />
  439. [page:constant RGB9_E5] stores the red, green, and blue components on 9
  440. bits each.<br /><br />
  441. [page:constant RGBA8] stores the red, green, blue, and alpha components on
  442. 8 bits each.<br /><br />
  443. [page:constant RGBA8_SNORM] stores the red, green, blue, and alpha
  444. components on 8 bits. Every component is stored as normalized.
  445. <br /><br />
  446. [page:constant RGBA8I] stores the red, green, blue, and alpha components
  447. on 8 bits each. Every component is stored as an integer.
  448. <br /><br />
  449. [page:constant RGBA8UI] stores the red, green, blue, and alpha components
  450. on 8 bits. Every component is stored as an unsigned integer.
  451. <br /><br />
  452. [page:constant RGBA16I] stores the red, green, blue, and alpha components
  453. on 16 bits. Every component is stored as an integer.
  454. <br /><br />
  455. [page:constant RGBA16UI] stores the red, green, blue, and alpha components
  456. on 16 bits. Every component is stored as an unsigned integer.
  457. <br /><br />
  458. [page:constant RGBA16F] stores the red, green, blue, and alpha components
  459. on 16 bits. Every component is stored as floating point.
  460. <br /><br />
  461. [page:constant RGBA32I] stores the red, green, blue, and alpha components
  462. on 32 bits. Every component is stored as an integer.
  463. <br /><br />
  464. [page:constant RGBA32UI] stores the red, green, blue, and alpha components
  465. on 32 bits. Every component is stored as an unsigned integer.
  466. <br /><br />
  467. [page:constant RGBA32F] stores the red, green, blue, and alpha components
  468. on 32 bits. Every component is stored as floating point.
  469. <br /><br />
  470. [page:constant RGB5_A1] stores the red, green, blue, and alpha components
  471. respectively on 5 bits, 5 bits, 5 bits, and 1 bit.<br /><br />
  472. [page:constant RGB10_A2] stores the red, green, blue, and alpha components
  473. respectively on 10 bits, 10 bits, 10 bits and 2 bits.<br /><br />
  474. [page:constant RGB10_A2UI] stores the red, green, blue, and alpha
  475. components respectively on 10 bits, 10 bits, 10 bits and 2 bits. Every
  476. component is stored as an unsigned integer.
  477. <br /><br />
  478. [page:constant SRGB8] stores the red, green, and blue components on 8 bits
  479. each.<br /><br />
  480. [page:constant SRGB8_ALPHA8] stores the red, green, blue, and alpha
  481. components on 8 bits each.<br /><br />
  482. [page:constant DEPTH_COMPONENT16] stores the depth component on 16bits.<br /><br />
  483. [page:constant DEPTH_COMPONENT24] stores the depth component on 24bits.<br /><br />
  484. [page:constant DEPTH_COMPONENT32F] stores the depth component on 32bits.
  485. The component is stored as floating point.<br /><br />
  486. [page:constant DEPTH24_STENCIL8] stores the depth, and stencil components
  487. respectively on 24 bits and 8 bits. The stencil component is stored as an
  488. unsigned integer.
  489. <br /><br />
  490. [page:constant DEPTH32F_STENCIL8] stores the depth, and stencil components
  491. respectively on 32 bits and 8 bits. The depth component is stored as
  492. floating point, and the stencil component as an unsigned integer.
  493. <br /><br />
  494. Note that the texture must have the correct [page:Texture.type type] set,
  495. as well as the correct [page:Texture.format format]. See
  496. [link:https://developer.mozilla.org/en/docs/Web/API/WebGLRenderingContext/texImage2D WebGLRenderingContext.texImage2D], and
  497. [link:https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/texImage3D WebGL2RenderingContext.texImage3D], for more details regarding the
  498. possible combination of [page:Texture.format format],
  499. [page:Texture.internalFormat internalFormat], and [page:Texture.type type].<br /><br />
  500. For more in-depth information regarding internal formats, you can also
  501. refer directly to the
  502. [link:https://www.khronos.org/registry/webgl/specs/latest/2.0/ WebGL2 Specification] and to the
  503. [link:https://www.khronos.org/registry/OpenGL/specs/es/3.0/es_spec_3.0.pdf OpenGL ES 3.0 Specification].
  504. </p>
  505. <h2>Depth Packing</h2>
  506. <code>
  507. THREE.BasicDepthPacking
  508. THREE.RGBADepthPacking
  509. </code>
  510. <p>
  511. For use with the [page:MeshDepthMaterial.depthPacking depthPacking]
  512. property of `MeshDepthMaterial`.
  513. </p>
  514. <h2>Color Space</h2>
  515. <code>
  516. THREE.NoColorSpace = ""
  517. THREE.SRGBColorSpace = "srgb"
  518. THREE.LinearSRGBColorSpace = "srgb-linear"
  519. </code>
  520. <p>
  521. Used to define the color space of textures (and the output color space of
  522. the renderer).<br /><br />
  523. If the color space type is changed after the texture has already been used
  524. by a material, you will need to set [page:Material.needsUpdate Material.needsUpdate] to `true` to make the material recompile.<br /><br />
  525. </p>
  526. <h2>Source</h2>
  527. <p>
  528. [link:https://github.com/mrdoob/three.js/blob/master/src/constants.js src/constants.js]
  529. </p>
  530. </body>
  531. </html>