MeshDepthMaterial.html 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>MeshDepthMaterial - Three.js Docs</title>
  6. <meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
  7. <script src="../scripts/highlight.min.js"></script>
  8. <link type="text/css" rel="stylesheet" href="../styles/highlight-three.css">
  9. <link type="text/css" rel="stylesheet" href="../styles/page.css">
  10. </head>
  11. <body>
  12. <p class="inheritance" translate="no"><a href="EventDispatcher.html">EventDispatcher</a> → <a href="Material.html">Material</a> → </p>
  13. <h1 translate="no">MeshDepthMaterial</h1>
  14. <section>
  15. <header>
  16. <div class="class-description"><p>A material for drawing geometry by depth. Depth is based off of the camera
  17. near and far plane. White is nearest, black is farthest.</p></div>
  18. <iframe id="viewer" src="../scenes/material-browser.html#MeshDepthMaterial"></iframe>
  19. </header>
  20. <article>
  21. <div class="container-overview">
  22. <h2>Constructor</h2>
  23. <h3 class="name name-method" id="MeshDepthMaterial" translate="no">new <a href="#MeshDepthMaterial">MeshDepthMaterial</a><span class="signature">( parameters : <span class="param-type">Object</span> )</span> </h3>
  24. <div class="method">
  25. <div class="description">
  26. <p>Constructs a new mesh depth material.</p>
  27. </div>
  28. <table class="params">
  29. <tbody>
  30. <tr>
  31. <td class="name">
  32. <strong>parameters</strong>
  33. </td>
  34. <td class="description last">
  35. <p>An object with one or more properties
  36. defining the material's appearance. Any property of the material
  37. (including any property from inherited materials) can be passed
  38. in here. Color values can be passed any type of value accepted
  39. by <a href="Color.html#set">Color#set</a>.</p>
  40. </td>
  41. </tr>
  42. </tbody>
  43. </table>
  44. </div>
  45. </div>
  46. <h2 class="subsection-title">Properties</h2>
  47. <div class="member">
  48. <h3 class="name" id="alphaMap" translate="no">.<a href="#alphaMap">alphaMap</a><span class="type-signature"> : <a href="Texture.html">Texture</a></span> </h3>
  49. <div class="description">
  50. <p>The alpha map is a grayscale texture that controls the opacity across the
  51. surface (black: fully transparent; white: fully opaque).</p>
  52. <p>Only the color of the texture is used, ignoring the alpha channel if one
  53. exists. For RGB and RGBA textures, the renderer will use the green channel
  54. when sampling this texture due to the extra bit of precision provided for
  55. green in DXT-compressed and uncompressed RGB 565 formats. Luminance-only and
  56. luminance/alpha textures will also still work as expected.</p>
  57. <p>Default is <code>null</code>.</p>
  58. </div>
  59. </div>
  60. <div class="member">
  61. <h3 class="name" id="depthPacking" translate="no">.<a href="#depthPacking">depthPacking</a><span class="type-signature"> : <a href="global.html#BasicDepthPacking">BasicDepthPacking</a> | <a href="global.html#RGBADepthPacking">RGBADepthPacking</a> | <a href="global.html#RGBDepthPacking">RGBDepthPacking</a> | <a href="global.html#RGDepthPacking">RGDepthPacking</a></span> </h3>
  62. <div class="description">
  63. <p>Type for depth packing.</p>
  64. <p>Default is <code>BasicDepthPacking</code>.</p>
  65. </div>
  66. </div>
  67. <div class="member">
  68. <h3 class="name" id="displacementBias" translate="no">.<a href="#displacementBias">displacementBias</a><span class="type-signature"> : number</span> </h3>
  69. <div class="description">
  70. <p>The offset of the displacement map's values on the mesh's vertices.
  71. The bias is added to the scaled sample of the displacement map.
  72. Without a displacement map set, this value is not applied.</p>
  73. <p>Default is <code>0</code>.</p>
  74. </div>
  75. </div>
  76. <div class="member">
  77. <h3 class="name" id="displacementMap" translate="no">.<a href="#displacementMap">displacementMap</a><span class="type-signature"> : <a href="Texture.html">Texture</a></span> </h3>
  78. <div class="description">
  79. <p>The displacement map affects the position of the mesh's vertices. Unlike
  80. other maps which only affect the light and shade of the material the
  81. displaced vertices can cast shadows, block other objects, and otherwise
  82. act as real geometry. The displacement texture is an image where the value
  83. of each pixel (white being the highest) is mapped against, and
  84. repositions, the vertices of the mesh.</p>
  85. <p>Default is <code>null</code>.</p>
  86. </div>
  87. </div>
  88. <div class="member">
  89. <h3 class="name" id="displacementScale" translate="no">.<a href="#displacementScale">displacementScale</a><span class="type-signature"> : number</span> </h3>
  90. <div class="description">
  91. <p>How much the displacement map affects the mesh (where black is no
  92. displacement, and white is maximum displacement). Without a displacement
  93. map set, this value is not applied.</p>
  94. <p>Default is <code>0</code>.</p>
  95. </div>
  96. </div>
  97. <div class="member">
  98. <h3 class="name" id="isMeshDepthMaterial" translate="no">.<a href="#isMeshDepthMaterial">isMeshDepthMaterial</a><span class="type-signature"> : boolean</span> <span class="type-signature">(readonly) </span></h3>
  99. <div class="description">
  100. <p>This flag can be used for type testing.</p>
  101. <p>Default is <code>true</code>.</p>
  102. </div>
  103. </div>
  104. <div class="member">
  105. <h3 class="name" id="map" translate="no">.<a href="#map">map</a><span class="type-signature"> : <a href="Texture.html">Texture</a></span> </h3>
  106. <div class="description">
  107. <p>The color map. May optionally include an alpha channel, typically combined
  108. with <a href="Material.html#transparent">Material#transparent</a> or <a href="Material.html#alphaTest">Material#alphaTest</a>.</p>
  109. <p>Default is <code>null</code>.</p>
  110. </div>
  111. </div>
  112. <div class="member">
  113. <h3 class="name" id="wireframe" translate="no">.<a href="#wireframe">wireframe</a><span class="type-signature"> : boolean</span> </h3>
  114. <div class="description">
  115. <p>Renders the geometry as a wireframe.</p>
  116. <p>Default is <code>false</code>.</p>
  117. </div>
  118. </div>
  119. <div class="member">
  120. <h3 class="name" id="wireframeLinewidth" translate="no">.<a href="#wireframeLinewidth">wireframeLinewidth</a><span class="type-signature"> : number</span> </h3>
  121. <div class="description">
  122. <p>Controls the thickness of the wireframe.</p>
  123. <p>WebGL and WebGPU ignore this property and always render
  124. 1 pixel wide lines.</p>
  125. <p>Default is <code>1</code>.</p>
  126. </div>
  127. </div>
  128. <h2 class="subsection-title">Source</h2>
  129. <p>
  130. <a href="https://github.com/mrdoob/three.js/blob/master/src/materials/MeshDepthMaterial.js" translate="no" target="_blank" rel="noopener">src/materials/MeshDepthMaterial.js</a>
  131. </p>
  132. </article>
  133. </section>
  134. <script src="../scripts/linenumber.js"></script>
  135. <script src="../scripts/page.js"></script>
  136. </body>
  137. </html>
粤ICP备19079148号