MeshMatcapMaterial.html 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8" />
  5. <base href="../../../" />
  6. <script src="page.js"></script>
  7. <link type="text/css" rel="stylesheet" href="page.css" />
  8. </head>
  9. <body>
  10. [page:Material] &rarr;
  11. <h1>[name]</h1>
  12. <p class="desc">
  13. [name] is defined by a MatCap (or Lit Sphere) texture, which encodes the
  14. material color and shading.<br /><br />
  15. [name] does not respond to lights since the matcap image file encodes
  16. baked lighting. It will cast a shadow onto an object that receives shadows
  17. (and shadow clipping works), but it will not self-shadow or receive
  18. shadows.
  19. </p>
  20. <iframe
  21. id="scene"
  22. src="scenes/material-browser.html#MeshMatcapMaterial"
  23. ></iframe>
  24. <script>
  25. // iOS iframe auto-resize workaround
  26. if ( /(iPad|iPhone|iPod)/g.test( navigator.userAgent ) ) {
  27. const scene = document.getElementById( 'scene' );
  28. scene.style.width = getComputedStyle( scene ).width;
  29. scene.style.height = getComputedStyle( scene ).height;
  30. scene.setAttribute( 'scrolling', 'no' );
  31. }
  32. </script>
  33. <h2>Constructor</h2>
  34. <h3>[name]( [param:Object parameters] )</h3>
  35. <p>
  36. [page:Object parameters] - (optional) an object with one or more
  37. properties defining the material's appearance. Any property of the
  38. material (including any property inherited from [page:Material]) can be
  39. passed in here.<br /><br />
  40. The exception is the property [page:Hexadecimal color], which can be
  41. passed in as a hexadecimal string and is `0xffffff` (white) by default.
  42. [page:Color.set]( color ) is called internally.
  43. </p>
  44. <h2>Properties</h2>
  45. <p>See the base [page:Material] class for common properties.</p>
  46. <h3>[property:Texture alphaMap]</h3>
  47. <p>
  48. The alpha map is a grayscale texture that controls the opacity across the
  49. surface (black: fully transparent; white: fully opaque). Default is
  50. null.<br /><br />
  51. Only the color of the texture is used, ignoring the alpha channel if one
  52. exists. For RGB and RGBA textures, the [page:WebGLRenderer WebGL] renderer
  53. will use the green channel when sampling this texture due to the extra bit
  54. of precision provided for green in DXT-compressed and uncompressed RGB 565
  55. formats. Luminance-only and luminance/alpha textures will also still work
  56. as expected.
  57. </p>
  58. <h3>[property:Texture bumpMap]</h3>
  59. <p>
  60. The texture to create a bump map. The black and white values map to the
  61. perceived depth in relation to the lights. Bump doesn't actually affect
  62. the geometry of the object, only the lighting. If a normal map is defined
  63. this will be ignored.
  64. </p>
  65. <h3>[property:Float bumpScale]</h3>
  66. <p>
  67. How much the bump map affects the material. Typical ranges are 0-1.
  68. Default is `1`.
  69. </p>
  70. <h3>[property:Color color]</h3>
  71. <p>[page:Color] of the material, by default set to white (0xffffff).</p>
  72. <h3>[property:Texture displacementMap]</h3>
  73. <p>
  74. The displacement map affects the position of the mesh's vertices. Unlike
  75. other maps which only affect the light and shade of the material the
  76. displaced vertices can cast shadows, block other objects, and otherwise
  77. act as real geometry. The displacement texture is an image where the value
  78. of each pixel (white being the highest) is mapped against, and
  79. repositions, the vertices of the mesh.
  80. </p>
  81. <h3>[property:Float displacementScale]</h3>
  82. <p>
  83. How much the displacement map affects the mesh (where black is no
  84. displacement, and white is maximum displacement). Without a displacement
  85. map set, this value is not applied. Default is `1`.
  86. </p>
  87. <h3>[property:Float displacementBias]</h3>
  88. <p>
  89. The offset of the displacement map's values on the mesh's vertices.
  90. Without a displacement map set, this value is not applied. Default is `0`.
  91. </p>
  92. <h3>[property:Boolean flatShading]</h3>
  93. <p>
  94. Define whether the material is rendered with flat shading. Default is
  95. false.
  96. </p>
  97. <h3>[property:Boolean fog]</h3>
  98. <p>Whether the material is affected by fog. Default is `true`.</p>
  99. <h3>[property:Texture map]</h3>
  100. <p>
  101. The color map. May optionally include an alpha channel, typically combined
  102. with [page:Material.transparent .transparent] or [page:Material.alphaTest .alphaTest].
  103. Default is null. The texture map color is modulated by the
  104. diffuse [page:.color].
  105. </p>
  106. <h3>[property:Texture matcap]</h3>
  107. <p>The matcap map. Default is null.</p>
  108. <h3>[property:Texture normalMap]</h3>
  109. <p>
  110. 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 y component of normalScale should be negated to compensate
  115. for the different handedness.
  116. </p>
  117. <h3>[property:Integer normalMapType]</h3>
  118. <p>
  119. The type of normal map.<br /><br />
  120. Options are [page:constant THREE.TangentSpaceNormalMap] (default), and
  121. [page:constant THREE.ObjectSpaceNormalMap].
  122. </p>
  123. <h3>[property:Vector2 normalScale]</h3>
  124. <p>
  125. How much the normal map affects the material. Typical ranges are 0-1.
  126. Default is a [page:Vector2] set to (1,1).
  127. </p>
  128. <h2>Methods</h2>
  129. <p>See the base [page:Material] class for common methods.</p>
  130. <h2>Source</h2>
  131. <p>
  132. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  133. </p>
  134. </body>
  135. </html>