MeshDistanceMaterial.html 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  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 translate="no">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><code>alphaMap</code> represents non-color data. Any texture assigned must have
  61. <code>texture.colorSpace = NoColorSpace</code> (default).</p>
  62. <p>Default is <code>null</code>.</p>
  63. </div>
  64. </div>
  65. <div class="member">
  66. <h3 class="name" id="displacementBias" translate="no">.<a href="#displacementBias">displacementBias</a><span class="type-signature"> : number</span> </h3>
  67. <div class="description">
  68. <p>The offset of the displacement map's values on the mesh's vertices.
  69. The bias is added to the scaled sample of the displacement map.
  70. Without a displacement map set, this value is not applied.</p>
  71. <p>Default is <code>0</code>.</p>
  72. </div>
  73. </div>
  74. <div class="member">
  75. <h3 class="name" id="displacementMap" translate="no">.<a href="#displacementMap">displacementMap</a><span class="type-signature"> : <a href="Texture.html">Texture</a></span> </h3>
  76. <div class="description">
  77. <p>The displacement map affects the position of the mesh's vertices. Unlike
  78. other maps which only affect the light and shade of the material the
  79. displaced vertices can cast shadows, block other objects, and otherwise
  80. act as real geometry. The displacement texture is an image where the value
  81. of each pixel (white being the highest) is mapped against, and
  82. repositions, the vertices of the mesh.</p>
  83. <p><code>displacementMap</code> represents non-color data. Any texture assigned must have
  84. <code>texture.colorSpace = NoColorSpace</code> (default).</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="isMeshDistanceMaterial" translate="no">.<a href="#isMeshDistanceMaterial">isMeshDistanceMaterial</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><code>map</code> represents color data, and the texture must be assigned a
  110. <a href="Texture.html#colorSpace">Texture#colorSpace</a>. Most <code>map</code> textures set
  111. <code>texture.colorSpace = SRGBColorSpace</code>.</p>
  112. <p>Default is <code>null</code>.</p>
  113. </div>
  114. </div>
  115. <h2 class="subsection-title">Source</h2>
  116. <p>
  117. <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>
  118. </p>
  119. </article>
  120. </section>
  121. <script src="../scripts/linenumber.js"></script>
  122. <script src="../scripts/page.js"></script>
  123. </body>
  124. </html>
粤ICP备19079148号