DepthTexture.html 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. <!DOCTYPE html>
  2. <html lang="zh">
  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>例子</h2>
  17. <p>
  18. [example:webgl_depth_texture depth / texture]
  19. </p>
  20. <h2>构造函数</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] -- 纹理的宽度。<br />
  24. [page:Number height] -- 纹理的高度。<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. 请参阅[page:Textures type constants](类型常量)来了解其他选项。<br />
  27. [page:Constant mapping] --
  28. 请参阅[page:Textures mapping mode constants](映射模式常量)来了解其他选项。<br />
  29. [page:Constant wrapS] -- 默认值是[page:Textures THREE.ClampToEdgeWrapping].
  30. 请参阅[page:Textures wrap mode constants](包裹模式常量)来了解其他选项。<br />
  31. [page:Constant wrapT] -- 默认值是[page:Textures THREE.ClampToEdgeWrapping].
  32. 请参阅[page:Textures wrap mode constants](包裹模式常量)来了解其他选项。<br />
  33. [page:Constant magFilter] -- 当一个纹素覆盖大于一个像素时,贴图将如何采样。
  34. 其默认值为[page:Textures THREE.LinearFilter]。请参阅[page:Textures magnification filter constants](放大滤镜常量)来了解其它选项。<br />
  35. [page:Constant minFilter] -- 当一个纹素覆盖小于一个像素时,贴图将如何采样。
  36. 其默认值为[page:Textures THREE.LinearMipMapLinearFilter]。请参阅[page:Textures minification filter constants](缩小滤镜常量)来了解其它选项。<br />
  37. [page:Number anisotropy] -- 沿着轴,通过具有最高纹素密度的像素的样本数。
  38. 默认情况下,这个值为1。设置一个较高的值将会产生比基本的mipmap更清晰的效果,代价是需要使用更多纹理样本。
  39. 使用[page:WebGLrenderer.getMaxAnisotropy renderer.getMaxAnisotropy]() 来查询GPU中各向异性的最大有效值;这个值通常是2的幂。<br /><br />
  40. [page:Constant format] -- 这个值必须是[page:Textures DepthFormat](默认值)或者[page:Textures DepthStencilFormat]。
  41. 请参阅[page:Textures format constants](格式常量)来了解详细信息。<br />
  42. </p>
  43. <h2>属性</h2>
  44. <p>
  45. 共有属性请参见其基类[page:Texture Texture]。
  46. —— 以下属性也是texture类中的一部分,但在这里默认值不同。
  47. </p>
  48. <h3>[page:Texture.format .format]</h3>
  49. <p>
  50. [page:Textures DepthFormat](默认值)或者[page:Textures DepthStencilFormat]中的一个。
  51. 请参阅[page:Textures format constants]来了解详细信息。<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. 请参阅[page:Textures format constants]来了解详细信息。<br />
  57. </p>
  58. <h3>[page:Texture.magFilter .magFilter]</h3>
  59. <p>
  60. 当一个纹素覆盖大于一个像素时,贴图将如何采样。
  61. 其默认值为[page:Textures THREE.NearestFilter]。
  62. 请参阅[page:Textures magnification filter constants](放大滤镜常量)来了解其他选项。
  63. </p>
  64. <h3>[page:Texture.minFilter .minFilter]</h3>
  65. <p>
  66. 当一个纹素覆盖小于一个像素时,贴图将如何采样。
  67. 其默认值为[page:Textures THREE.NearestFilter]。
  68. 请参阅[page:Textures minification filter constants](缩小滤镜常量)来了解其他选项。
  69. </p>
  70. <h3>[page:Texture.flipY .flipY]</h3>
  71. <p>
  72. 深度贴图不需要被翻转,因此其默认值为*false*。
  73. </p>
  74. <h3>[page:Texture.generateMipmaps .generateMipmaps]</h3>
  75. <p>
  76. 深度贴图不使用mipmap。
  77. </p>
  78. <h2>方法</h2>
  79. <p>
  80. 共有方法请参见其基类[page:Texture Texture]。
  81. </p>
  82. <h2>源代码</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>