DepthTexture.html 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  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. <p class="desc">
  14. Creates a texture for use as a Depth Texture. Require support for the
  15. [link:https://www.khronos.org/registry/webgl/extensions/WEBGL_depth_texture/ WEBGL_depth_texture] extension.
  16. </p>
  17. <h2>Examples</h2>
  18. <p>
  19. [example:webgl_depth_texture depth / texture]
  20. </p>
  21. <h2>Constructor</h2>
  22. <h3>[name]( [param:Number width], [param:Number height], [param:Constant type], [param:Constant wrapS], [param:Constant wrapT], [param:Constant magFilter], [param:Constant minFilter], [param:Number anisotropy], [param:Constant format] )</h3>
  23. <p>
  24. [page:Number width] -- width of the texture.<br />
  25. [page:Number height] -- height of the texture.<br />
  26. [page:Constant type] -- Default is [page:Textures THREE.UnsignedShortType].
  27. See [page:Textures type constants] for other choices.<br />
  28. [page:Constant mapping] --
  29. See [page:Textures type constants] for details.<br />
  30. [page:Constant wrapS] -- The default is [page:Textures THREE.ClampToEdgeWrapping].
  31. See [page:Textures wrap mode constants] for other choices.<br />
  32. [page:Constant wrapT] -- The default is [page:Textures THREE.ClampToEdgeWrapping].
  33. See [page:Textures wrap mode constants] for other choices.<br />
  34. [page:Constant magFilter] -- How the texture is sampled when a texel covers more than one pixel.
  35. The default is [page:Textures THREE.NearestFilter]. See [page:Textures magnification filter constants] for other choices.<br />
  36. [page:Constant minFilter] -- How the texture is sampled when a texel covers less than one pixel.
  37. The default is [page:Textures THREE.NearestFilter]. See [page:Textures minification filter constants] for other choices.<br />
  38. [page:Number anisotropy] -- The number of samples taken along the axis through the pixel that has the highest density of texels.
  39. 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.
  40. 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 />
  41. [page:Constant format] -- must be either [page:Textures DepthFormat] (default) or [page:Textures DepthStencilFormat].
  42. See [page:Textures format constants] for details.<br />
  43. </p>
  44. <h2>Properties</h2>
  45. <p>
  46. See the base [page:Texture Texture] class for common properties
  47. - the following are also part of the texture class, but have different defaults here.
  48. </p>
  49. <h3>[page:Texture.format .format]</h3>
  50. <p>
  51. Either [page:Textures DepthFormat] (default) or [page:Textures DepthStencilFormat].
  52. See [page:Textures format constants] for details.<br />
  53. </p>
  54. <h3>[page:Texture.type .type]</h3>
  55. <p>
  56. Default is [page:Textures THREE.UnsignedShortType].
  57. See [page:Textures format constants] for details.<br />
  58. </p>
  59. <h3>[page:Texture.magFilter .magFilter]</h3>
  60. <p>
  61. How the texture is sampled when a texel covers more than one pixel.
  62. The default is [page:Textures THREE.NearestFilter].
  63. See [page:Textures magnification filter constants] for other choices.
  64. </p>
  65. <h3>[page:Texture.minFilter .minFilter]</h3>
  66. <p>
  67. How the texture is sampled when a texel covers less than one pixel.
  68. The default is [page:Textures THREE.NearestFilter].
  69. See [page:Textures magnification filter constants] for other choices.
  70. </p>
  71. <h3>[page:Texture.flipY .flipY]</h3>
  72. <p>
  73. Depth textures do not need to be flipped so this is *false* by default.
  74. </p>
  75. <h3>[page:Texture.generateMipmaps .generateMipmaps]</h3>
  76. <p>
  77. Depth textures do not use mipmaps.
  78. </p>
  79. <h2>Methods</h2>
  80. <p>
  81. See the base [page:Texture Texture] class for common methods.
  82. </p>
  83. <h2>Source</h2>
  84. <p>
  85. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  86. </p>
  87. </body>
  88. </html>