MeshNormalMaterial.html 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  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"><code>parameters</code></td>
  31. <td class="description last"><p>An object with one or more properties
  32. defining the material's appearance. Any property of the material
  33. (including any property from inherited materials) can be passed
  34. in here. Color values can be passed any type of value accepted
  35. by <a href="Color.html#set">Color#set</a>.</p></td>
  36. </tr>
  37. </tbody>
  38. </table>
  39. </div>
  40. </div>
  41. <h2 class="subsection-title">Properties</h2>
  42. <div class="member">
  43. <h3 class="name" id="bumpMap" translate="no">.<a href="#bumpMap">bumpMap</a><span class="type-signature"> : <a href="Texture.html">Texture</a></span> </h3>
  44. <div class="description">
  45. <p>The texture to create a bump map. The black and white values map to the
  46. perceived depth in relation to the lights. Bump doesn't actually affect
  47. the geometry of the object, only the lighting. If a normal map is defined
  48. this will be ignored.<br/>Default is <code>null</code>.</p>
  49. </div>
  50. </div>
  51. <div class="member">
  52. <h3 class="name" id="bumpScale" translate="no">.<a href="#bumpScale">bumpScale</a><span class="type-signature"> : number</span> </h3>
  53. <div class="description">
  54. <p>How much the bump map affects the material. Typical range is <code>[0,1]</code>.<br/>Default is <code>1</code>.</p>
  55. </div>
  56. </div>
  57. <div class="member">
  58. <h3 class="name" id="displacementBias" translate="no">.<a href="#displacementBias">displacementBias</a><span class="type-signature"> : number</span> </h3>
  59. <div class="description">
  60. <p>The offset of the displacement map's values on the mesh's vertices.
  61. The bias is added to the scaled sample of the displacement map.
  62. Without a displacement map set, this value is not applied.<br/>Default is <code>0</code>.</p>
  63. </div>
  64. </div>
  65. <div class="member">
  66. <h3 class="name" id="displacementMap" translate="no">.<a href="#displacementMap">displacementMap</a><span class="type-signature"> : <a href="Texture.html">Texture</a></span> </h3>
  67. <div class="description">
  68. <p>The displacement map affects the position of the mesh's vertices. Unlike
  69. other maps which only affect the light and shade of the material the
  70. displaced vertices can cast shadows, block other objects, and otherwise
  71. act as real geometry. The displacement texture is an image where the value
  72. of each pixel (white being the highest) is mapped against, and
  73. repositions, the vertices of the mesh.<br/>Default is <code>null</code>.</p>
  74. </div>
  75. </div>
  76. <div class="member">
  77. <h3 class="name" id="displacementScale" translate="no">.<a href="#displacementScale">displacementScale</a><span class="type-signature"> : number</span> </h3>
  78. <div class="description">
  79. <p>How much the displacement map affects the mesh (where black is no
  80. displacement, and white is maximum displacement). Without a displacement
  81. map set, this value is not applied.<br/>Default is <code>0</code>.</p>
  82. </div>
  83. </div>
  84. <div class="member">
  85. <h3 class="name" id="flatShading" translate="no">.<a href="#flatShading">flatShading</a><span class="type-signature"> : boolean</span> </h3>
  86. <div class="description">
  87. <p>Whether the material is rendered with flat shading or not.<br/>Default is <code>false</code>.</p>
  88. </div>
  89. </div>
  90. <div class="member">
  91. <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>
  92. <div class="description">
  93. <p>This flag can be used for type testing.<br/>Default is <code>true</code>.</p>
  94. </div>
  95. </div>
  96. <div class="member">
  97. <h3 class="name" id="normalMap" translate="no">.<a href="#normalMap">normalMap</a><span class="type-signature"> : <a href="Texture.html">Texture</a></span> </h3>
  98. <div class="description">
  99. <p>The texture to create a normal map. The RGB values affect the surface
  100. normal for each pixel fragment and change the way the color is lit. Normal
  101. maps do not change the actual shape of the surface, only the lighting. In
  102. case the material has a normal map authored using the left handed
  103. convention, the <code>y</code> component of <code>normalScale</code> should be negated to compensate
  104. for the different handedness.<br/>Default is <code>null</code>.</p>
  105. </div>
  106. </div>
  107. <div class="member">
  108. <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>
  109. <div class="description">
  110. <p>The type of normal map.<br/>Default is <code>TangentSpaceNormalMap</code>.</p>
  111. </div>
  112. </div>
  113. <div class="member">
  114. <h3 class="name" id="normalScale" translate="no">.<a href="#normalScale">normalScale</a><span class="type-signature"> : <a href="Vector2.html">Vector2</a></span> </h3>
  115. <div class="description">
  116. <p>How much the normal map affects the material. Typical value range is <code>[0,1]</code>.<br/>Default is <code>(1,1)</code>.</p>
  117. </div>
  118. </div>
  119. <div class="member">
  120. <h3 class="name" id="wireframe" translate="no">.<a href="#wireframe">wireframe</a><span class="type-signature"> : boolean</span> </h3>
  121. <div class="description">
  122. <p>Renders the geometry as a wireframe.<br/>Default is <code>false</code>.</p>
  123. </div>
  124. </div>
  125. <div class="member">
  126. <h3 class="name" id="wireframeLinewidth" translate="no">.<a href="#wireframeLinewidth">wireframeLinewidth</a><span class="type-signature"> : number</span> </h3>
  127. <div class="description">
  128. <p>Controls the thickness of the wireframe.</p>
  129. <p>WebGL and WebGPU ignore this property and always render
  130. 1 pixel wide lines.<br/>Default is <code>1</code>.</p>
  131. </div>
  132. </div>
  133. <h2 class="subsection-title">Source</h2>
  134. <p>
  135. <a href="https://github.com/mrdoob/three.js/blob/master/src/materials/MeshNormalMaterial.js" target="_blank" rel="noopener" translate="no">src/materials/MeshNormalMaterial.js</a>
  136. </p>
  137. </article>
  138. </section>
  139. <script src="../scripts/linenumber.js"></script>
  140. <script src="../scripts/page.js"></script>
  141. </body>
  142. </html>
粤ICP备19079148号