DepthTexture.html 4.7 KB

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