MeshToonMaterial.html 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>MeshToonMaterial - 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">MeshToonMaterial</h1>
  14. <section>
  15. <header>
  16. <div class="class-description"><p>A material implementing toon shading.</p></div>
  17. <iframe id="viewer" src="../scenes/material-browser.html#MeshToonMaterial"></iframe>
  18. </header>
  19. <article>
  20. <div class="container-overview">
  21. <h2>Constructor</h2>
  22. <h3 class="name name-method" id="MeshToonMaterial" translate="no">new <a href="#MeshToonMaterial">MeshToonMaterial</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 toon 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="alphaMap" translate="no">.<a href="#alphaMap">alphaMap</a><span class="type-signature"> : <a href="Texture.html">Texture</a></span> </h3>
  48. <div class="description">
  49. <p>The alpha map is a grayscale texture that controls the opacity across the
  50. surface (black: fully transparent; white: fully opaque).</p>
  51. <p>Only the color of the texture is used, ignoring the alpha channel if one
  52. exists. For RGB and RGBA textures, the renderer will use the green channel
  53. when sampling this texture due to the extra bit of precision provided for
  54. green in DXT-compressed and uncompressed RGB 565 formats. Luminance-only and
  55. luminance/alpha textures will also still work as expected.</p>
  56. <p>Default is <code>null</code>.</p>
  57. </div>
  58. </div>
  59. <div class="member">
  60. <h3 class="name" id="aoMap" translate="no">.<a href="#aoMap">aoMap</a><span class="type-signature"> : <a href="Texture.html">Texture</a></span> </h3>
  61. <div class="description">
  62. <p>The red channel of this texture is used as the ambient occlusion map.
  63. Requires a second set of UVs.</p>
  64. <p>Default is <code>null</code>.</p>
  65. </div>
  66. </div>
  67. <div class="member">
  68. <h3 class="name" id="aoMapIntensity" translate="no">.<a href="#aoMapIntensity">aoMapIntensity</a><span class="type-signature"> : number</span> </h3>
  69. <div class="description">
  70. <p>Intensity of the ambient occlusion effect. Range is <code>[0,1]</code>, where <code>0</code>
  71. disables ambient occlusion. Where intensity is <code>1</code> and the AO map's
  72. red channel is also <code>1</code>, ambient light is fully occluded on a surface.</p>
  73. <p>Default is <code>1</code>.</p>
  74. </div>
  75. </div>
  76. <div class="member">
  77. <h3 class="name" id="bumpMap" translate="no">.<a href="#bumpMap">bumpMap</a><span class="type-signature"> : <a href="Texture.html">Texture</a></span> </h3>
  78. <div class="description">
  79. <p>The texture to create a bump map. The black and white values map to the
  80. perceived depth in relation to the lights. Bump doesn't actually affect
  81. the geometry of the object, only the lighting. If a normal map is defined
  82. this will be ignored.</p>
  83. <p>Default is <code>null</code>.</p>
  84. </div>
  85. </div>
  86. <div class="member">
  87. <h3 class="name" id="bumpScale" translate="no">.<a href="#bumpScale">bumpScale</a><span class="type-signature"> : number</span> </h3>
  88. <div class="description">
  89. <p>How much the bump map affects the material. Typical range is <code>[0,1]</code>.</p>
  90. <p>Default is <code>1</code>.</p>
  91. </div>
  92. </div>
  93. <div class="member">
  94. <h3 class="name" id="color" translate="no">.<a href="#color">color</a><span class="type-signature"> : <a href="Color.html">Color</a></span> </h3>
  95. <div class="description">
  96. <p>Color of the material.</p>
  97. <p>Default is <code>(1,1,1)</code>.</p>
  98. </div>
  99. </div>
  100. <div class="member">
  101. <h3 class="name" id="displacementBias" translate="no">.<a href="#displacementBias">displacementBias</a><span class="type-signature"> : number</span> </h3>
  102. <div class="description">
  103. <p>The offset of the displacement map's values on the mesh's vertices.
  104. The bias is added to the scaled sample of the displacement map.
  105. Without a displacement map set, this value is not applied.</p>
  106. <p>Default is <code>0</code>.</p>
  107. </div>
  108. </div>
  109. <div class="member">
  110. <h3 class="name" id="displacementMap" translate="no">.<a href="#displacementMap">displacementMap</a><span class="type-signature"> : <a href="Texture.html">Texture</a></span> </h3>
  111. <div class="description">
  112. <p>The displacement map affects the position of the mesh's vertices. Unlike
  113. other maps which only affect the light and shade of the material the
  114. displaced vertices can cast shadows, block other objects, and otherwise
  115. act as real geometry. The displacement texture is an image where the value
  116. of each pixel (white being the highest) is mapped against, and
  117. repositions, the vertices of the mesh.</p>
  118. <p>Default is <code>null</code>.</p>
  119. </div>
  120. </div>
  121. <div class="member">
  122. <h3 class="name" id="displacementScale" translate="no">.<a href="#displacementScale">displacementScale</a><span class="type-signature"> : number</span> </h3>
  123. <div class="description">
  124. <p>How much the displacement map affects the mesh (where black is no
  125. displacement, and white is maximum displacement). Without a displacement
  126. map set, this value is not applied.</p>
  127. <p>Default is <code>0</code>.</p>
  128. </div>
  129. </div>
  130. <div class="member">
  131. <h3 class="name" id="emissive" translate="no">.<a href="#emissive">emissive</a><span class="type-signature"> : <a href="Color.html">Color</a></span> </h3>
  132. <div class="description">
  133. <p>Emissive (light) color of the material, essentially a solid color
  134. unaffected by other lighting.</p>
  135. <p>Default is <code>(0,0,0)</code>.</p>
  136. </div>
  137. </div>
  138. <div class="member">
  139. <h3 class="name" id="emissiveIntensity" translate="no">.<a href="#emissiveIntensity">emissiveIntensity</a><span class="type-signature"> : number</span> </h3>
  140. <div class="description">
  141. <p>Intensity of the emissive light. Modulates the emissive color.</p>
  142. <p>Default is <code>1</code>.</p>
  143. </div>
  144. </div>
  145. <div class="member">
  146. <h3 class="name" id="emissiveMap" translate="no">.<a href="#emissiveMap">emissiveMap</a><span class="type-signature"> : <a href="Texture.html">Texture</a></span> </h3>
  147. <div class="description">
  148. <p>Set emissive (glow) map. The emissive map color is modulated by the
  149. emissive color and the emissive intensity. If you have an emissive map,
  150. be sure to set the emissive color to something other than black.</p>
  151. <p>Default is <code>null</code>.</p>
  152. </div>
  153. </div>
  154. <div class="member">
  155. <h3 class="name" id="fog" translate="no">.<a href="#fog">fog</a><span class="type-signature"> : boolean</span> </h3>
  156. <div class="description">
  157. <p>Whether the material is affected by fog or not.</p>
  158. <p>Default is <code>true</code>.</p>
  159. </div>
  160. </div>
  161. <div class="member">
  162. <h3 class="name" id="gradientMap" translate="no">.<a href="#gradientMap">gradientMap</a><span class="type-signature"> : <a href="Texture.html">Texture</a></span> </h3>
  163. <div class="description">
  164. <p>Gradient map for toon shading. It's required to set
  165. <a href="Texture.html#minFilter">Texture#minFilter</a> and <a href="Texture.html#magFilter">Texture#magFilter</a> to {@linkNearestFilter}
  166. when using this type of texture.</p>
  167. <p>Default is <code>null</code>.</p>
  168. </div>
  169. </div>
  170. <div class="member">
  171. <h3 class="name" id="isMeshToonMaterial" translate="no">.<a href="#isMeshToonMaterial">isMeshToonMaterial</a><span class="type-signature"> : boolean</span> <span class="type-signature">(readonly) </span></h3>
  172. <div class="description">
  173. <p>This flag can be used for type testing.</p>
  174. <p>Default is <code>true</code>.</p>
  175. </div>
  176. </div>
  177. <div class="member">
  178. <h3 class="name" id="lightMap" translate="no">.<a href="#lightMap">lightMap</a><span class="type-signature"> : <a href="Texture.html">Texture</a></span> </h3>
  179. <div class="description">
  180. <p>The light map. Requires a second set of UVs.</p>
  181. <p>Default is <code>null</code>.</p>
  182. </div>
  183. </div>
  184. <div class="member">
  185. <h3 class="name" id="lightMapIntensity" translate="no">.<a href="#lightMapIntensity">lightMapIntensity</a><span class="type-signature"> : number</span> </h3>
  186. <div class="description">
  187. <p>Intensity of the baked light.</p>
  188. <p>Default is <code>1</code>.</p>
  189. </div>
  190. </div>
  191. <div class="member">
  192. <h3 class="name" id="map" translate="no">.<a href="#map">map</a><span class="type-signature"> : <a href="Texture.html">Texture</a></span> </h3>
  193. <div class="description">
  194. <p>The color map. May optionally include an alpha channel, typically combined
  195. with <a href="Material.html#transparent">Material#transparent</a> or <a href="Material.html#alphaTest">Material#alphaTest</a>. The texture map
  196. color is modulated by the diffuse <code>color</code>.</p>
  197. <p>Default is <code>null</code>.</p>
  198. </div>
  199. </div>
  200. <div class="member">
  201. <h3 class="name" id="normalMap" translate="no">.<a href="#normalMap">normalMap</a><span class="type-signature"> : <a href="Texture.html">Texture</a></span> </h3>
  202. <div class="description">
  203. <p>The texture to create a normal map. The RGB values affect the surface
  204. normal for each pixel fragment and change the way the color is lit. Normal
  205. maps do not change the actual shape of the surface, only the lighting. In
  206. case the material has a normal map authored using the left handed
  207. convention, the <code>y</code> component of <code>normalScale</code> should be negated to compensate
  208. for the different handedness.</p>
  209. <p>Default is <code>null</code>.</p>
  210. </div>
  211. </div>
  212. <div class="member">
  213. <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>
  214. <div class="description">
  215. <p>The type of normal map.</p>
  216. <p>Default is <code>TangentSpaceNormalMap</code>.</p>
  217. </div>
  218. </div>
  219. <div class="member">
  220. <h3 class="name" id="normalScale" translate="no">.<a href="#normalScale">normalScale</a><span class="type-signature"> : <a href="Vector2.html">Vector2</a></span> </h3>
  221. <div class="description">
  222. <p>How much the normal map affects the material. Typical value range is <code>[0,1]</code>.</p>
  223. <p>Default is <code>(1,1)</code>.</p>
  224. </div>
  225. </div>
  226. <div class="member">
  227. <h3 class="name" id="wireframe" translate="no">.<a href="#wireframe">wireframe</a><span class="type-signature"> : boolean</span> </h3>
  228. <div class="description">
  229. <p>Renders the geometry as a wireframe.</p>
  230. <p>Default is <code>false</code>.</p>
  231. </div>
  232. </div>
  233. <div class="member">
  234. <h3 class="name" id="wireframeLinecap" translate="no">.<a href="#wireframeLinecap">wireframeLinecap</a><span class="type-signature"> : 'round' | 'bevel' | 'miter'</span> </h3>
  235. <div class="description">
  236. <p>Defines appearance of wireframe ends.</p>
  237. <p>Can only be used with <a href="SVGRenderer.html">SVGRenderer</a>.</p>
  238. <p>Default is <code>'round'</code>.</p>
  239. </div>
  240. </div>
  241. <div class="member">
  242. <h3 class="name" id="wireframeLinejoin" translate="no">.<a href="#wireframeLinejoin">wireframeLinejoin</a><span class="type-signature"> : 'round' | 'bevel' | 'miter'</span> </h3>
  243. <div class="description">
  244. <p>Defines appearance of wireframe joints.</p>
  245. <p>Can only be used with <a href="SVGRenderer.html">SVGRenderer</a>.</p>
  246. <p>Default is <code>'round'</code>.</p>
  247. </div>
  248. </div>
  249. <div class="member">
  250. <h3 class="name" id="wireframeLinewidth" translate="no">.<a href="#wireframeLinewidth">wireframeLinewidth</a><span class="type-signature"> : number</span> </h3>
  251. <div class="description">
  252. <p>Controls the thickness of the wireframe.</p>
  253. <p>Can only be used with <a href="SVGRenderer.html">SVGRenderer</a>.</p>
  254. <p>Default is <code>1</code>.</p>
  255. </div>
  256. </div>
  257. <h2 class="subsection-title">Source</h2>
  258. <p>
  259. <a href="https://github.com/mrdoob/three.js/blob/master/src/materials/MeshToonMaterial.js" translate="no" target="_blank" rel="noopener">src/materials/MeshToonMaterial.js</a>
  260. </p>
  261. </article>
  262. </section>
  263. <script src="../scripts/linenumber.js"></script>
  264. <script src="../scripts/page.js"></script>
  265. </body>
  266. </html>
粤ICP备19079148号