MeshDistanceMaterial.html 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>MeshDistanceMaterial - 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">MeshDistanceMaterial</h1>
  14. <section>
  15. <header>
  16. <div class="class-description"><p>A material used internally for implementing shadow mapping with
  17. point lights.</p>
  18. <p>Can also be used to customize the shadow casting of an object by assigning
  19. an instance of <code>MeshDistanceMaterial</code> to <a href="Object3D.html#customDistanceMaterial">Object3D#customDistanceMaterial</a>.
  20. The following examples demonstrates this approach in order to ensure
  21. transparent parts of objects do not cast shadows.</p></div>
  22. </header>
  23. <article>
  24. <div class="container-overview">
  25. <h2>Constructor</h2>
  26. <h3 class="name name-method" id="MeshDistanceMaterial" translate="no">new <a href="#MeshDistanceMaterial">MeshDistanceMaterial</a><span class="signature">( parameters : <span class="param-type">Object</span> )</span> </h3>
  27. <div class="method">
  28. <div class="description">
  29. <p>Constructs a new mesh distance material.</p>
  30. </div>
  31. <table class="params">
  32. <tbody>
  33. <tr>
  34. <td class="name">
  35. <strong>parameters</strong>
  36. </td>
  37. <td class="description last">
  38. <p>An object with one or more properties
  39. defining the material's appearance. Any property of the material
  40. (including any property from inherited materials) can be passed
  41. in here. Color values can be passed any type of value accepted
  42. by <a href="Color.html#set">Color#set</a>.</p>
  43. </td>
  44. </tr>
  45. </tbody>
  46. </table>
  47. </div>
  48. </div>
  49. <h2 class="subsection-title">Properties</h2>
  50. <div class="member">
  51. <h3 class="name" id="alphaMap" translate="no">.<a href="#alphaMap">alphaMap</a><span class="type-signature"> : <a href="Texture.html">Texture</a></span> </h3>
  52. <div class="description">
  53. <p>The alpha map is a grayscale texture that controls the opacity across the
  54. surface (black: fully transparent; white: fully opaque).</p>
  55. <p>Only the color of the texture is used, ignoring the alpha channel if one
  56. exists. For RGB and RGBA textures, the renderer will use the green channel
  57. when sampling this texture due to the extra bit of precision provided for
  58. green in DXT-compressed and uncompressed RGB 565 formats. Luminance-only and
  59. luminance/alpha textures will also still work as expected.</p>
  60. <p>Default is <code>null</code>.</p>
  61. </div>
  62. </div>
  63. <div class="member">
  64. <h3 class="name" id="displacementBias" translate="no">.<a href="#displacementBias">displacementBias</a><span class="type-signature"> : number</span> </h3>
  65. <div class="description">
  66. <p>The offset of the displacement map's values on the mesh's vertices.
  67. The bias is added to the scaled sample of the displacement map.
  68. Without a displacement map set, this value is not applied.</p>
  69. <p>Default is <code>0</code>.</p>
  70. </div>
  71. </div>
  72. <div class="member">
  73. <h3 class="name" id="displacementMap" translate="no">.<a href="#displacementMap">displacementMap</a><span class="type-signature"> : <a href="Texture.html">Texture</a></span> </h3>
  74. <div class="description">
  75. <p>The displacement map affects the position of the mesh's vertices. Unlike
  76. other maps which only affect the light and shade of the material the
  77. displaced vertices can cast shadows, block other objects, and otherwise
  78. act as real geometry. The displacement texture is an image where the value
  79. of each pixel (white being the highest) is mapped against, and
  80. repositions, the vertices of the mesh.</p>
  81. <p>Default is <code>null</code>.</p>
  82. </div>
  83. </div>
  84. <div class="member">
  85. <h3 class="name" id="displacementScale" translate="no">.<a href="#displacementScale">displacementScale</a><span class="type-signature"> : number</span> </h3>
  86. <div class="description">
  87. <p>How much the displacement map affects the mesh (where black is no
  88. displacement, and white is maximum displacement). Without a displacement
  89. map set, this value is not applied.</p>
  90. <p>Default is <code>0</code>.</p>
  91. </div>
  92. </div>
  93. <div class="member">
  94. <h3 class="name" id="isMeshDistanceMaterial" translate="no">.<a href="#isMeshDistanceMaterial">isMeshDistanceMaterial</a><span class="type-signature"> : boolean</span> <span class="type-signature">(readonly) </span></h3>
  95. <div class="description">
  96. <p>This flag can be used for type testing.</p>
  97. <p>Default is <code>true</code>.</p>
  98. </div>
  99. </div>
  100. <div class="member">
  101. <h3 class="name" id="map" translate="no">.<a href="#map">map</a><span class="type-signature"> : <a href="Texture.html">Texture</a></span> </h3>
  102. <div class="description">
  103. <p>The color map. May optionally include an alpha channel, typically combined
  104. with <a href="Material.html#transparent">Material#transparent</a> or <a href="Material.html#alphaTest">Material#alphaTest</a>.</p>
  105. <p>Default is <code>null</code>.</p>
  106. </div>
  107. </div>
  108. <h2 class="subsection-title">Source</h2>
  109. <p>
  110. <a href="https://github.com/mrdoob/three.js/blob/master/src/materials/MeshDistanceMaterial.js" translate="no" target="_blank" rel="noopener">src/materials/MeshDistanceMaterial.js</a>
  111. </p>
  112. </article>
  113. </section>
  114. <script src="../scripts/linenumber.js"></script>
  115. <script src="../scripts/page.js"></script>
  116. </body>
  117. </html>
粤ICP备19079148号