DepthTexture.html 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8" />
  5. <base href="../../" />
  6. <script src="list.js"></script>
  7. <script src="page.js"></script>
  8. <link type="text/css" rel="stylesheet" href="page.css" />
  9. </head>
  10. <body>
  11. [page:Texture] &rarr;
  12. <h1>[name]</h1>
  13. <div class="desc">
  14. Creates a texture for use as a Depth Texture. Require support for the
  15. <a href="https://www.khronos.org/registry/webgl/extensions/WEBGL_depth_texture/">WEBGL_depth_texture</a>
  16. extension. According to <a href="https://webglstats.com/">WebGLStats</a>, as of February 2016 around 85%
  17. of WebGL enabled devices support this.
  18. <br /><br />
  19. </div>
  20. <h2>Example</h2>
  21. [example:webgl_depth_texture depth / texture]
  22. <h2>Constructor</h2>
  23. <h3>[name]( [page:Number width], [page:Number height], [page:Constant type], [page:Constant wrapS], [page:Constant wrapT], [page:Constant magFilter], [page:Constant minFilter], [page:Number anisotropy], [page:Constant format] )</h3>
  24. <div>
  25. [page:Number width] -- width of the texture.<br />
  26. [page:Number height] -- height of the texture.<br />
  27. [page:Constant type] -- Default is [page:Textures THREE.UnsignedShortType].
  28. See [page:Textures type constants] for other choices.<br />
  29. [page:Constant mapping] --
  30. See [page:Textures type constants] for details.<br />
  31. [page:Constant wrapS] -- The default is [page:Textures THREE.ClampToEdgeWrapping].
  32. See [page:Textures wrap mode constants] for other choices.<br />
  33. [page:Constant wrapT] -- The default is [page:Textures THREE.ClampToEdgeWrapping].
  34. See [page:Textures wrap mode constants] for other choices.<br />
  35. [page:Constant magFilter] -- How the texture is sampled when a texel covers more than one pixel.
  36. The default is [page:Textures THREE.NearestFilter]. See [page:Textures magnification filter constants] for other choices.<br />
  37. [page:Constant minFilter] -- How the texture is sampled when a texel covers less than one pixel.
  38. The default is [page:Textures THREE.NearestFilter]. See [page:Textures minification filter constants] for other choices.<br />
  39. [page:Number anisotropy] -- The number of samples taken along the axis through the pixel that has the highest density of texels.
  40. By default, this value is 1. A higher value gives a less blurry result than a basic mipmap, at the cost of more texture samples being used.
  41. Use [page:WebGLrenderer.getMaxAnisotropy renderer.getMaxAnisotropy]() to find the maximum valid anisotropy value for the GPU; this value is usually a power of 2.<br />
  42. [page:Constant format] -- must be either [page:Textures DepthFormat] (default) or [page:Textures DepthStencilFormat].
  43. See [page:Textures format constants] for details.<br />
  44. </div>
  45. <h2>Properties</h2>
  46. <div>
  47. See the base [page:Texture Texture] class for common properties
  48. - the following are also part of the texture class, but have different defaults here.
  49. </div>
  50. <h3>[page:Texture.format .format]</h3>
  51. <div>
  52. Either [page:Textures DepthFormat] (default) or [page:Textures DepthStencilFormat].
  53. See [page:Textures format constants] for details.<br />
  54. </div>
  55. <h3>[page:Texture.type .type]</h3>
  56. <div>
  57. Default is [page:Textures THREE.UnsignedShortType].
  58. See [page:Textures format constants] for details.<br />
  59. </div>
  60. <h3>[page:Texture.magFilter .magFilter]</h3>
  61. <div>
  62. How the texture is sampled when a texel covers more than one pixel.
  63. The default is [page:Textures THREE.NearestFilter].
  64. See [page:Textures magnification filter constants] for other choices.
  65. </div>
  66. <h3>[page:Texture.minFilter .minFilter]</h3>
  67. <div>
  68. How the texture is sampled when a texel covers less than one pixel.
  69. The default is [page:Textures THREE.NearestFilter].
  70. See [page:Textures magnification filter constants] for other choices.
  71. </div>
  72. <h3>[page:Texture.flipY .flipY]</h3>
  73. <div>
  74. Depth textures do not need to be flipped so this is *false* by default.
  75. </div>
  76. <h3>[page:Texture.generateMipmaps .generateMipmaps]</h3>
  77. <div>
  78. Depth textures do not use mipmaps.
  79. </div>
  80. <h2>Methods</h2>
  81. <div>
  82. See the base [page:Texture Texture] class for common methods.
  83. </div>
  84. <h2>Source</h2>
  85. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  86. </body>
  87. </html>