MeshBasicMaterial.html 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  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. A material for drawing geometries in a simple shaded (flat or wireframe)
  14. way.<br /><br />
  15. This material is not affected by lights.
  16. </p>
  17. <iframe
  18. id="scene"
  19. src="scenes/material-browser.html#MeshBasicMaterial"
  20. ></iframe>
  21. <script>
  22. // iOS iframe auto-resize workaround
  23. if ( /(iPad|iPhone|iPod)/g.test( navigator.userAgent ) ) {
  24. const scene = document.getElementById( 'scene' );
  25. scene.style.width = getComputedStyle( scene ).width;
  26. scene.style.height = getComputedStyle( scene ).height;
  27. scene.setAttribute( 'scrolling', 'no' );
  28. }
  29. </script>
  30. <h2>Constructor</h2>
  31. <h3>[name]( [param:Object parameters] )</h3>
  32. <p>
  33. [page:Object parameters] - (optional) an object with one or more
  34. properties defining the material's appearance. Any property of the
  35. material (including any property inherited from [page:Material]) can be
  36. passed in here.<br /><br />
  37. The exception is the property [page:Hexadecimal color], which can be
  38. passed in as a hexadecimal string and is `0xffffff` (white) by default.
  39. [page:Color.set]( color ) is called internally.
  40. </p>
  41. <h2>Properties</h2>
  42. <p>See the base [page:Material] class for common properties.</p>
  43. <h3>[property:Texture alphaMap]</h3>
  44. <p>
  45. The alpha map is a grayscale texture that controls the opacity across the
  46. surface (black: fully transparent; white: fully opaque). Default is
  47. null.<br /><br />
  48. Only the color of the texture is used, ignoring the alpha channel if one
  49. exists. For RGB and RGBA textures, the [page:WebGLRenderer WebGL] renderer
  50. will use the green channel when sampling this texture due to the extra bit
  51. of precision provided for green in DXT-compressed and uncompressed RGB 565
  52. formats. Luminance-only and luminance/alpha textures will also still work
  53. as expected.
  54. </p>
  55. <h3>[property:Texture aoMap]</h3>
  56. <p>
  57. The red channel of this texture is used as the ambient occlusion map.
  58. Default is null. The aoMap requires a second set of UVs.
  59. </p>
  60. <h3>[property:Float aoMapIntensity]</h3>
  61. <p>
  62. Intensity of the ambient occlusion effect. Range is 0-1, where `0`
  63. disables ambient occlusion. Where intensity is `1` and the [page:.aoMap]
  64. red channel is also `1`, ambient light is fully occluded on a surface.
  65. Default is `1`.
  66. </p>
  67. <h3>[property:Color color]</h3>
  68. <p>[page:Color] of the material, by default set to white (0xffffff).</p>
  69. <h3>[property:Integer combine]</h3>
  70. <p>
  71. How to combine the result of the surface's color with the environment map,
  72. if any.<br /><br />
  73. Options are [page:Materials THREE.MultiplyOperation] (default),
  74. [page:Materials THREE.MixOperation], [page:Materials THREE.AddOperation].
  75. If mix is chosen, the [page:.reflectivity] is used to blend between the
  76. two colors.
  77. </p>
  78. <h3>[property:Texture envMap]</h3>
  79. <p>The environment map. Default is null.</p>
  80. <h3>[property:Euler envMapRotation]</h3>
  81. <p>
  82. The rotation of the environment map in radians. Default is `(0,0,0)`.
  83. </p>
  84. <h3>[property:Boolean fog]</h3>
  85. <p>Whether the material is affected by fog. Default is `true`.</p>
  86. <h3>[property:Texture lightMap]</h3>
  87. <p>
  88. The light map. Default is null. The lightMap requires a second set of UVs.
  89. </p>
  90. <h3>[property:Float lightMapIntensity]</h3>
  91. <p>Intensity of the baked light. Default is `1`.</p>
  92. <h3>[property:Texture map]</h3>
  93. <p>
  94. The color map. May optionally include an alpha channel, typically combined
  95. with [page:Material.transparent .transparent] or [page:Material.alphaTest .alphaTest]. Default is null.
  96. </p>
  97. <h3>[property:Float reflectivity]</h3>
  98. <p>
  99. How much the environment map affects the surface; also see
  100. [page:.combine]. The default value is `1` and the valid range is between `0`
  101. (no reflections) and `1` (full reflections).
  102. </p>
  103. <h3>[property:Float refractionRatio]</h3>
  104. <p>
  105. The index of refraction (IOR) of air (approximately 1) divided by the
  106. index of refraction of the material. It is used with environment mapping
  107. modes [page:Textures THREE.CubeRefractionMapping] and [page:Textures THREE.EquirectangularRefractionMapping].
  108. The refraction ratio should not exceed `1`. Default is `0.98`.
  109. </p>
  110. <h3>[property:Texture specularMap]</h3>
  111. <p>Specular map used by the material. Default is null.</p>
  112. <h3>[property:Boolean wireframe]</h3>
  113. <p>
  114. Render geometry as wireframe. Default is `false` (i.e. render as flat
  115. polygons).
  116. </p>
  117. <h3>[property:String wireframeLinecap]</h3>
  118. <p>
  119. Define appearance of line ends. Possible values are "butt", "round" and
  120. "square". Default is 'round'.<br /><br />
  121. This corresponds to the
  122. [link:https://developer.mozilla.org/en/docs/Web/API/CanvasRenderingContext2D/lineCap 2D Canvas lineCap]
  123. property and it is ignored by the [page:WebGLRenderer WebGL] renderer.
  124. </p>
  125. <h3>[property:String wireframeLinejoin]</h3>
  126. <p>
  127. Define appearance of line joints. Possible values are "round", "bevel" and
  128. "miter". Default is 'round'.<br /><br />
  129. This corresponds to the
  130. [link:https://developer.mozilla.org/en/docs/Web/API/CanvasRenderingContext2D/lineJoin 2D Canvas lineJoin]
  131. property and it is ignored by the [page:WebGLRenderer WebGL] renderer.
  132. </p>
  133. <h3>[property:Float wireframeLinewidth]</h3>
  134. <p>
  135. Controls wireframe thickness. Default is `1`.<br /><br />
  136. Due to limitations of the
  137. [link:https://www.khronos.org/registry/OpenGL/specs/gl/glspec46.core.pdf OpenGL Core Profile]
  138. with the [page:WebGLRenderer WebGL] renderer on most platforms linewidth will always be `1` regardless of the set value.
  139. </p>
  140. <h2>Methods</h2>
  141. <p>See the base [page:Material] class for common methods.</p>
  142. <h2>Source</h2>
  143. <p>
  144. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  145. </p>
  146. </body>
  147. </html>