DepthTexture.html 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  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
  14. rendering into a texture. When using a WebGL 1 rendering context, [name]
  15. requires support for the
  16. [link:https://www.khronos.org/registry/webgl/extensions/WEBGL_depth_texture/ WEBGL_depth_texture] extension.
  17. </p>
  18. <h2>Examples</h2>
  19. <p>[example:webgl_depth_texture depth / texture]</p>
  20. <h2>Constructor</h2>
  21. <h3>
  22. [name]( [param:Number width], [param:Number height], [param:Constant type],
  23. [param:Constant mapping], [param:Constant wrapS], [param:Constant wrapT],
  24. [param:Constant magFilter], [param:Constant minFilter],
  25. [param:Number anisotropy], [param:Constant format] )
  26. </h3>
  27. <p>
  28. [page:Number width] -- width of the texture.<br />
  29. [page:Number height] -- height of the texture.<br />
  30. [page:Constant type] -- Default is [page:Textures THREE.UnsignedIntType]
  31. when using [page:Textures DepthFormat] and [page:Textures THREE.UnsignedInt248Type]
  32. when using [page:Textures DepthStencilFormat].
  33. See [page:Textures type constants] for other choices.<br />
  34. [page:Constant mapping] -- See [page:Textures mapping mode constants] for
  35. details.<br />
  36. [page:Constant wrapS] -- The default is [page:Textures THREE.ClampToEdgeWrapping].
  37. See [page:Textures wrap mode constants] for
  38. other choices.<br />
  39. [page:Constant wrapT] -- The default is [page:Textures THREE.ClampToEdgeWrapping].
  40. See [page:Textures wrap mode constants] for
  41. other choices.<br />
  42. [page:Constant magFilter] -- How the texture is sampled when a texel
  43. covers more than one pixel. The default is [page:Textures THREE.NearestFilter].
  44. See [page:Textures magnification filter constants]
  45. for other choices.<br />
  46. [page:Constant minFilter] -- How the texture is sampled when a texel
  47. covers less than one pixel. The default is [page:Textures THREE.NearestFilter].
  48. See [page:Textures minification filter constants]
  49. for other choices.<br />
  50. [page:Number anisotropy] -- The number of samples taken along the axis
  51. through the pixel that has the highest density of texels. By default, this
  52. value is 1. A higher value gives a less blurry result than a basic mipmap,
  53. at the cost of more texture samples being used. Use
  54. [page:WebGLrenderer.getMaxAnisotropy renderer.getMaxAnisotropy]() to find
  55. the maximum valid anisotropy value for the GPU; this value is usually a
  56. power of 2.<br />
  57. [page:Constant format] -- must be either [page:Textures DepthFormat]
  58. (default) or [page:Textures DepthStencilFormat]. See [page:Textures format constants] for details.<br />
  59. </p>
  60. <h2>Properties</h2>
  61. <p>
  62. See the base [page:Texture Texture] class for common properties - the
  63. following are also part of the texture class, but have different defaults
  64. here.
  65. </p>
  66. <h3>[page:Texture.format format]</h3>
  67. <p>
  68. Either [page:Textures DepthFormat] (default) or [page:Textures DepthStencilFormat].
  69. See [page:Textures format constants] for details.<br />
  70. </p>
  71. <h3>[page:Texture.type type]</h3>
  72. <p>
  73. Default is [page:Textures THREE.UnsignedIntType] when using [page:Textures DepthFormat]
  74. and [page:Textures THREE.UnsignedInt248Type] when using
  75. [page:Textures DepthStencilFormat]. See [page:Textures format constants]
  76. for details.<br />
  77. </p>
  78. <h3>[page:Texture.magFilter magFilter]</h3>
  79. <p>
  80. How the texture is sampled when a texel covers more than one pixel. The
  81. default is [page:Textures THREE.NearestFilter]. See [page:Textures magnification filter constants] for other choices.
  82. </p>
  83. <h3>[page:Texture.minFilter minFilter]</h3>
  84. <p>
  85. How the texture is sampled when a texel covers less than one pixel. The
  86. default is [page:Textures THREE.NearestFilter]. See [page:Textures magnification filter constants]
  87. for other choices.
  88. </p>
  89. <h3>[page:Texture.flipY flipY]</h3>
  90. <p>
  91. Depth textures do not need to be flipped so this is `false` by default.
  92. </p>
  93. <h3>[page:Texture.generateMipmaps .generateMipmaps]</h3>
  94. <p>Depth textures do not use mipmaps.</p>
  95. <h3>[property:Boolean isDepthTexture]</h3>
  96. <p>Read-only flag to check if a given object is of type [name].</p>
  97. <h3>[property:number compareFunction]</h3>
  98. <p>
  99. This is used to define the comparison function used when comparing texels in the depth texture to the value in the depth buffer.
  100. Default is *null* which means comparison is disabled.<br /><br/>
  101. See the [page:Textures texture constants] page for details of other functions.
  102. </p>
  103. <h2>Methods</h2>
  104. <p>See the base [page:Texture Texture] class for common methods.</p>
  105. <h2>Source</h2>
  106. <p>
  107. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  108. </p>
  109. </body>
  110. </html>