MeshMatcapMaterial.html 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>MeshMatcapMaterial - 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">MeshMatcapMaterial</h1>
  14. <section>
  15. <header>
  16. <div class="class-description"><p>This material is defined by a MatCap (or Lit Sphere) texture, which encodes the
  17. material color and shading.</p>
  18. <p><code>MeshMatcapMaterial</code> does not respond to lights since the matcap image file encodes
  19. baked lighting. It will cast a shadow onto an object that receives shadows
  20. (and shadow clipping works), but it will not self-shadow or receive
  21. shadows.</p></div>
  22. <iframe id="viewer" src="../scenes/material-browser.html#MeshMatcapMaterial"></iframe>
  23. </header>
  24. <article>
  25. <div class="container-overview">
  26. <h2>Constructor</h2>
  27. <h3 class="name name-method" id="MeshMatcapMaterial" translate="no">new <a href="#MeshMatcapMaterial">MeshMatcapMaterial</a><span class="signature">( parameters : <span class="param-type">Object</span> )</span> </h3>
  28. <div class="method">
  29. <div class="description">
  30. <p>Constructs a new mesh matcap material.</p>
  31. </div>
  32. <table class="params">
  33. <tbody>
  34. <tr>
  35. <td class="name">
  36. <strong translate="no">parameters</strong>
  37. </td>
  38. <td class="description last">
  39. <p>An object with one or more properties
  40. defining the material's appearance. Any property of the material
  41. (including any property from inherited materials) can be passed
  42. in here. Color values can be passed any type of value accepted
  43. by <a href="Color.html#set">Color#set</a>.</p>
  44. </td>
  45. </tr>
  46. </tbody>
  47. </table>
  48. </div>
  49. </div>
  50. <h2 class="subsection-title">Properties</h2>
  51. <div class="member">
  52. <h3 class="name" id="alphaMap" translate="no">.<a href="#alphaMap">alphaMap</a><span class="type-signature"> : <a href="Texture.html">Texture</a></span> </h3>
  53. <div class="description">
  54. <p>The alpha map is a grayscale texture that controls the opacity across the
  55. surface (black: fully transparent; white: fully opaque).</p>
  56. <p>Only the color of the texture is used, ignoring the alpha channel if one
  57. exists. For RGB and RGBA textures, the renderer will use the green channel
  58. when sampling this texture due to the extra bit of precision provided for
  59. green in DXT-compressed and uncompressed RGB 565 formats. Luminance-only and
  60. luminance/alpha textures will also still work as expected.</p>
  61. <p><code>alphaMap</code> represents non-color data. Any texture assigned must have
  62. <code>texture.colorSpace = NoColorSpace</code> (default).</p>
  63. <p>Default is <code>null</code>.</p>
  64. </div>
  65. </div>
  66. <div class="member">
  67. <h3 class="name" id="bumpMap" translate="no">.<a href="#bumpMap">bumpMap</a><span class="type-signature"> : <a href="Texture.html">Texture</a></span> </h3>
  68. <div class="description">
  69. <p>The texture to create a bump map. The black and white values map to the
  70. perceived depth in relation to the lights. Bump doesn't actually affect
  71. the geometry of the object, only the lighting. If a normal map is defined
  72. this will be ignored.</p>
  73. <p><code>bumpMap</code> represents non-color data. Any texture assigned must have
  74. <code>texture.colorSpace = NoColorSpace</code> (default).</p>
  75. <p>Default is <code>null</code>.</p>
  76. </div>
  77. </div>
  78. <div class="member">
  79. <h3 class="name" id="bumpScale" translate="no">.<a href="#bumpScale">bumpScale</a><span class="type-signature"> : number</span> </h3>
  80. <div class="description">
  81. <p>How much the bump map affects the material. Typical range is <code>[0,1]</code>.</p>
  82. <p>Default is <code>1</code>.</p>
  83. </div>
  84. </div>
  85. <div class="member">
  86. <h3 class="name" id="color" translate="no">.<a href="#color">color</a><span class="type-signature"> : <a href="Color.html">Color</a></span> </h3>
  87. <div class="description">
  88. <p>Color of the material.</p>
  89. <p>Default is <code>(1,1,1)</code>.</p>
  90. </div>
  91. </div>
  92. <div class="member">
  93. <h3 class="name" id="displacementBias" translate="no">.<a href="#displacementBias">displacementBias</a><span class="type-signature"> : number</span> </h3>
  94. <div class="description">
  95. <p>The offset of the displacement map's values on the mesh's vertices.
  96. The bias is added to the scaled sample of the displacement map.
  97. Without a displacement map set, this value is not applied.</p>
  98. <p>Default is <code>0</code>.</p>
  99. </div>
  100. </div>
  101. <div class="member">
  102. <h3 class="name" id="displacementMap" translate="no">.<a href="#displacementMap">displacementMap</a><span class="type-signature"> : <a href="Texture.html">Texture</a></span> </h3>
  103. <div class="description">
  104. <p>The displacement map affects the position of the mesh's vertices. Unlike
  105. other maps which only affect the light and shade of the material the
  106. displaced vertices can cast shadows, block other objects, and otherwise
  107. act as real geometry. The displacement texture is an image where the value
  108. of each pixel (white being the highest) is mapped against, and
  109. repositions, the vertices of the mesh. For best results, pair a
  110. displacement map with a matching normal map, since the renderer can
  111. not recompute surface normals from the displaced vertices.</p>
  112. <p><code>displacementMap</code> represents non-color data. Any texture assigned must have
  113. <code>texture.colorSpace = NoColorSpace</code> (default).</p>
  114. <p>Default is <code>null</code>.</p>
  115. </div>
  116. </div>
  117. <div class="member">
  118. <h3 class="name" id="displacementScale" translate="no">.<a href="#displacementScale">displacementScale</a><span class="type-signature"> : number</span> </h3>
  119. <div class="description">
  120. <p>How much the displacement map affects the mesh (where black is no
  121. displacement, and white is maximum displacement). Without a displacement
  122. map set, this value is not applied.</p>
  123. <p>Default is <code>0</code>.</p>
  124. </div>
  125. </div>
  126. <div class="member">
  127. <h3 class="name" id="flatShading" translate="no">.<a href="#flatShading">flatShading</a><span class="type-signature"> : boolean</span> </h3>
  128. <div class="description">
  129. <p>Whether the material is rendered with flat shading or not.</p>
  130. <p>Default is <code>false</code>.</p>
  131. </div>
  132. </div>
  133. <div class="member">
  134. <h3 class="name" id="fog" translate="no">.<a href="#fog">fog</a><span class="type-signature"> : boolean</span> </h3>
  135. <div class="description">
  136. <p>Whether the material is affected by fog or not.</p>
  137. <p>Default is <code>true</code>.</p>
  138. </div>
  139. </div>
  140. <div class="member">
  141. <h3 class="name" id="isMeshMatcapMaterial" translate="no">.<a href="#isMeshMatcapMaterial">isMeshMatcapMaterial</a><span class="type-signature"> : boolean</span> <span class="type-signature">(readonly) </span></h3>
  142. <div class="description">
  143. <p>This flag can be used for type testing.</p>
  144. <p>Default is <code>true</code>.</p>
  145. </div>
  146. </div>
  147. <div class="member">
  148. <h3 class="name" id="map" translate="no">.<a href="#map">map</a><span class="type-signature"> : <a href="Texture.html">Texture</a></span> </h3>
  149. <div class="description">
  150. <p>The color map. May optionally include an alpha channel, typically combined
  151. with <a href="Material.html#transparent">Material#transparent</a> or <a href="Material.html#alphaTest">Material#alphaTest</a>. The texture map
  152. color is modulated by the diffuse <code>color</code>.</p>
  153. <p><code>map</code> represents color data, and the texture must be assigned a
  154. <a href="Texture.html#colorSpace">Texture#colorSpace</a>. Most <code>map</code> textures set
  155. <code>texture.colorSpace = SRGBColorSpace</code>.</p>
  156. <p>Default is <code>null</code>.</p>
  157. </div>
  158. </div>
  159. <div class="member">
  160. <h3 class="name" id="matcap" translate="no">.<a href="#matcap">matcap</a><span class="type-signature"> : <a href="Texture.html">Texture</a></span> </h3>
  161. <div class="description">
  162. <p>The matcap map.</p>
  163. <p><code>matcap</code> represents luminance data, and the texture must be assigned
  164. a <a href="Texture.html#colorSpace">Texture#colorSpace</a>. HDR <code>matcap</code> textures (e.g. <code>.exr</code>)
  165. typically set <code>texture.colorSpace = LinearSRGBColorSpace</code>, while LDR
  166. <code>matcap</code> textures (e.g. <code>.png</code>, <code>.jpg</code>, <code>.webp</code>) typically set
  167. <code>texture.colorSpace = SRGBColorSpace</code>.</p>
  168. <p>Default is <code>null</code>.</p>
  169. </div>
  170. </div>
  171. <div class="member">
  172. <h3 class="name" id="normalMap" translate="no">.<a href="#normalMap">normalMap</a><span class="type-signature"> : <a href="Texture.html">Texture</a></span> </h3>
  173. <div class="description">
  174. <p>The texture to create a normal map. The RGB values affect the surface
  175. normal for each pixel fragment and change the way the color is lit. Normal
  176. maps do not change the actual shape of the surface, only the lighting. In
  177. case the material has a normal map authored using the left handed
  178. convention, the <code>y</code> component of <code>normalScale</code> should be negated to compensate
  179. for the different handedness.</p>
  180. <p><code>normalMap</code> represents non-color data. Any texture assigned must have
  181. <code>texture.colorSpace = NoColorSpace</code> (default).</p>
  182. <p>Default is <code>null</code>.</p>
  183. </div>
  184. </div>
  185. <div class="member">
  186. <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>
  187. <div class="description">
  188. <p>The type of normal map.</p>
  189. <p>Default is <code>TangentSpaceNormalMap</code>.</p>
  190. </div>
  191. </div>
  192. <div class="member">
  193. <h3 class="name" id="normalScale" translate="no">.<a href="#normalScale">normalScale</a><span class="type-signature"> : <a href="Vector2.html">Vector2</a></span> </h3>
  194. <div class="description">
  195. <p>How much the normal map affects the material. Typical value range is <code>[0,1]</code>.</p>
  196. <p>Default is <code>(1,1)</code>.</p>
  197. </div>
  198. </div>
  199. <div class="member">
  200. <h3 class="name" id="wireframe" translate="no">.<a href="#wireframe">wireframe</a><span class="type-signature"> : boolean</span> </h3>
  201. <div class="description">
  202. <p>Renders the geometry as a wireframe.</p>
  203. <p>Default is <code>false</code>.</p>
  204. </div>
  205. </div>
  206. <div class="member">
  207. <h3 class="name" id="wireframeLinewidth" translate="no">.<a href="#wireframeLinewidth">wireframeLinewidth</a><span class="type-signature"> : number</span> </h3>
  208. <div class="description">
  209. <p>Controls the thickness of the wireframe.</p>
  210. <p>Can only be used with <a href="SVGRenderer.html">SVGRenderer</a>.</p>
  211. <p>Default is <code>1</code>.</p>
  212. </div>
  213. </div>
  214. <h2 class="subsection-title">Source</h2>
  215. <p>
  216. <a href="https://github.com/mrdoob/three.js/blob/master/src/materials/MeshMatcapMaterial.js" translate="no" target="_blank" rel="noopener">src/materials/MeshMatcapMaterial.js</a>
  217. </p>
  218. </article>
  219. </section>
  220. <script src="../scripts/linenumber.js"></script>
  221. <script src="../scripts/page.js"></script>
  222. </body>
  223. </html>
粤ICP备19079148号