MeshMatcapMaterial.html 5.4 KB

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