DepthTexture.html 4.4 KB

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