MeshNormalMaterial.html 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>MeshNormalMaterial - 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">MeshNormalMaterial</h1>
  14. <section>
  15. <header>
  16. <div class="class-description"><p>A material that maps the normal vectors to RGB colors.</p></div>
  17. <iframe id="viewer" src="../scenes/material-browser.html#MeshNormalMaterial"></iframe>
  18. </header>
  19. <article>
  20. <div class="container-overview">
  21. <h2>Constructor</h2>
  22. <h3 class="name name-method" id="MeshNormalMaterial" translate="no">new <a href="#MeshNormalMaterial">MeshNormalMaterial</a><span class="signature">( parameters : <span class="param-type">Object</span> )</span> </h3>
  23. <div class="method">
  24. <div class="description">
  25. <p>Constructs a new mesh normal material.</p>
  26. </div>
  27. <table class="params">
  28. <tbody>
  29. <tr>
  30. <td class="name">
  31. <strong>parameters</strong>
  32. </td>
  33. <td class="description last">
  34. <p>An object with one or more properties
  35. defining the material's appearance. Any property of the material
  36. (including any property from inherited materials) can be passed
  37. in here. Color values can be passed any type of value accepted
  38. by <a href="Color.html#set">Color#set</a>.</p>
  39. </td>
  40. </tr>
  41. </tbody>
  42. </table>
  43. </div>
  44. </div>
  45. <h2 class="subsection-title">Properties</h2>
  46. <div class="member">
  47. <h3 class="name" id="bumpMap" translate="no">.<a href="#bumpMap">bumpMap</a><span class="type-signature"> : <a href="Texture.html">Texture</a></span> </h3>
  48. <div class="description">
  49. <p>The texture to create a bump map. The black and white values map to the
  50. perceived depth in relation to the lights. Bump doesn't actually affect
  51. the geometry of the object, only the lighting. If a normal map is defined
  52. this will be ignored.</p>
  53. <p>Default is <code>null</code>.</p>
  54. </div>
  55. </div>
  56. <div class="member">
  57. <h3 class="name" id="bumpScale" translate="no">.<a href="#bumpScale">bumpScale</a><span class="type-signature"> : number</span> </h3>
  58. <div class="description">
  59. <p>How much the bump map affects the material. Typical range is <code>[0,1]</code>.</p>
  60. <p>Default is <code>1</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="flatShading" translate="no">.<a href="#flatShading">flatShading</a><span class="type-signature"> : boolean</span> </h3>
  95. <div class="description">
  96. <p>Whether the material is rendered with flat shading or not.</p>
  97. <p>Default is <code>false</code>.</p>
  98. </div>
  99. </div>
  100. <div class="member">
  101. <h3 class="name" id="isMeshNormalMaterial" translate="no">.<a href="#isMeshNormalMaterial">isMeshNormalMaterial</a><span class="type-signature"> : boolean</span> <span class="type-signature">(readonly) </span></h3>
  102. <div class="description">
  103. <p>This flag can be used for type testing.</p>
  104. <p>Default is <code>true</code>.</p>
  105. </div>
  106. </div>
  107. <div class="member">
  108. <h3 class="name" id="normalMap" translate="no">.<a href="#normalMap">normalMap</a><span class="type-signature"> : <a href="Texture.html">Texture</a></span> </h3>
  109. <div class="description">
  110. <p>The texture to create a normal map. The RGB values affect the surface
  111. normal for each pixel fragment and change the way the color is lit. Normal
  112. maps do not change the actual shape of the surface, only the lighting. In
  113. case the material has a normal map authored using the left handed
  114. convention, the <code>y</code> component of <code>normalScale</code> should be negated to compensate
  115. for the different handedness.</p>
  116. <p>Default is <code>null</code>.</p>
  117. </div>
  118. </div>
  119. <div class="member">
  120. <h3 class="name" id="normalMapType" translate="no">.<a href="#normalMapType">normalMapType</a><span class="type-signature"> : <a href="global.html#TangentSpaceNormalMap">TangentSpaceNormalMap</a> | <a href="global.html#ObjectSpaceNormalMap">ObjectSpaceNormalMap</a></span> </h3>
  121. <div class="description">
  122. <p>The type of normal map.</p>
  123. <p>Default is <code>TangentSpaceNormalMap</code>.</p>
  124. </div>
  125. </div>
  126. <div class="member">
  127. <h3 class="name" id="normalScale" translate="no">.<a href="#normalScale">normalScale</a><span class="type-signature"> : <a href="Vector2.html">Vector2</a></span> </h3>
  128. <div class="description">
  129. <p>How much the normal map affects the material. Typical value range is <code>[0,1]</code>.</p>
  130. <p>Default is <code>(1,1)</code>.</p>
  131. </div>
  132. </div>
  133. <div class="member">
  134. <h3 class="name" id="wireframe" translate="no">.<a href="#wireframe">wireframe</a><span class="type-signature"> : boolean</span> </h3>
  135. <div class="description">
  136. <p>Renders the geometry as a wireframe.</p>
  137. <p>Default is <code>false</code>.</p>
  138. </div>
  139. </div>
  140. <div class="member">
  141. <h3 class="name" id="wireframeLinewidth" translate="no">.<a href="#wireframeLinewidth">wireframeLinewidth</a><span class="type-signature"> : number</span> </h3>
  142. <div class="description">
  143. <p>Controls the thickness of the wireframe.</p>
  144. <p>WebGL and WebGPU ignore this property and always render
  145. 1 pixel wide lines.</p>
  146. <p>Default is <code>1</code>.</p>
  147. </div>
  148. </div>
  149. <h2 class="subsection-title">Source</h2>
  150. <p>
  151. <a href="https://github.com/mrdoob/three.js/blob/master/src/materials/MeshNormalMaterial.js" translate="no" target="_blank" rel="noopener">src/materials/MeshNormalMaterial.js</a>
  152. </p>
  153. </article>
  154. </section>
  155. <script src="../scripts/linenumber.js"></script>
  156. <script src="../scripts/page.js"></script>
  157. </body>
  158. </html>
粤ICP备19079148号