Material.html 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8" />
  5. <script src="../../list.js"></script>
  6. <script src="../../page.js"></script>
  7. <link type="text/css" rel="stylesheet" href="../../page.css" />
  8. </head>
  9. <body>
  10. <h1>[name]</h1>
  11. <div class="desc">Materials describe the appearance of [page:Object objects]. They are defined in a (mostly) renderer-independent way, so you don't have to rewrite materials if you decide to use a different renderer.</div>
  12. <h2>Constructor</h2>
  13. <h3>[name]()</h3>
  14. <div>
  15. todo
  16. </div>
  17. <h2>Properties</h2>
  18. <h3>.[page:Integer id]</h3>
  19. <div>
  20. Unique number of this material instance.
  21. </div>
  22. <h3>.[page:String name]</h3>
  23. <div>
  24. Material name. Default is an empty string.
  25. </div>
  26. <h3>.[page:Number opacity]</h3>
  27. <div>
  28. Opacity. Default is *1*.
  29. </div>
  30. <h3>.[page:Boolean transparent]</h3>
  31. <div>
  32. Defines whether this material is transparent. This has an effect on rendering, as transparent objects need an special treatment, and are rendered after the opaque (i.e. non transparent) objects. For a working example of this behaviour, check the [page:WebGLRenderer WebGLRenderer] code.
  33. </div>
  34. <div>Default is *false*.</div>
  35. <h3>.[page:Blending blending]</h3>
  36. <div>
  37. Which blending to use when displaying objects with this material. Default is [page:NormalBlending].
  38. </div>
  39. <h3>.[page:Integer blendSrc]</h3>
  40. <div>
  41. Blending source. It's one of the blending mode constants defined in [page:Three Three.js]. Default is *SrcAlphaFactor*.
  42. </div>
  43. <h3>.[page:Integer blendDst]</h3>
  44. <div>
  45. Blending destination. It's one of the blending mode constants defined in [page:Three Three.js]. Default is *OneMinusSrcAlphaFactor*.
  46. </div>
  47. <h3>.[page:Integer blendEquation]</h3>
  48. <div>
  49. Blending equation to use when applying blending. It's one of the constants defined in [page:Three Three.js]. Default is *AddEquation*.
  50. </div>
  51. <h3>.[page:Boolean depthTest]</h3>
  52. <div>
  53. Whether to have depth test enabled when rendering this material. Default is *true*.
  54. </div>
  55. <h3>.[page:Boolean depthWrite]</h3>
  56. <div>
  57. Whether rendering this material has any effect on the depth buffer. Default is *true*.
  58. </div>
  59. <div>
  60. When drawing 2D overlays it can be useful to disable the depth writing in order to layer several things together without creating z-index artifacts.
  61. </div>
  62. <h3>.[page:Boolean polygonOffset]</h3>
  63. <div>
  64. Whether to use polygon offset. Default is *false*. This corresponds to the *POLYGON_OFFSET_FILL* WebGL feature.
  65. </div>
  66. <h3>.[page:Integer polygonOffsetFactor]</h3>
  67. <div>
  68. Sets the polygon offset factor. Default is *0*.
  69. </div>
  70. <h3>.[page:Integer polygonOffsetUnits]</h3>
  71. <div>
  72. Sets the polygon offset units. Default is *0*.
  73. </div>
  74. <h3>.[page:Number alphaTest]</h3>
  75. <div>
  76. Sets the alpha value to be used when running an alpha test. Default is *0*.
  77. </div>
  78. <h3>.[page:Boolean overdraw]</h3>
  79. <div>
  80. Enables/disables overdraw. If enabled, polygons are drawn slightly bigger in order to fix antialiasing gaps when using the [page:CanvasRenderer]. Default is *false*.
  81. </div>
  82. <h3>.[page:Boolean visible]</h3>
  83. <div>
  84. Defines whether this material is visible. Default is *true*.
  85. </div>
  86. <h3>.[page:Enum side]</h3>
  87. <div>
  88. Defines which of the face sides will be rendered - front, back or both.
  89. </div>
  90. <div>
  91. Default is *THREE.FrontSide*. Other options are *THREE.BackSide* and *THREE.DoubleSide*.
  92. </div>
  93. <h3>.[page:Boolean needsUpdate]</h3>
  94. <div>
  95. Specifies that the material needs to be updated, WebGL wise. Set it to true if you made changes that need to be reflected in WebGL.
  96. </div>
  97. <div>
  98. This property is automatically set to *true* when instancing a new material.
  99. </div>
  100. <h2>Methods</h2>
  101. <h3>.clone([page:todo material]) [page:todo]</h3>
  102. <div>
  103. material -- todo
  104. </div>
  105. <div>
  106. todo
  107. </div>
  108. <h3>.removeEventListener([page:todo type], [page:todo listener]) [page:todo]</h3>
  109. <div>
  110. type -- todo <br />
  111. listener -- todo
  112. </div>
  113. <div>
  114. todo
  115. </div>
  116. <h3>.dispose() [page:todo]</h3>
  117. <div>
  118. todo
  119. </div>
  120. <h3>.dispatchEvent([page:todo event]) [page:todo]</h3>
  121. <div>
  122. event -- todo
  123. </div>
  124. <div>
  125. todo
  126. </div>
  127. <h3>.addEventListener([page:todo type], [page:todo listener]) [page:todo]</h3>
  128. <div>
  129. type -- todo <br />
  130. listener -- todo
  131. </div>
  132. <div>
  133. todo
  134. </div>
  135. <h3>.hasEventListener([page:todo type], [page:todo listener]) [page:todo]</h3>
  136. <div>
  137. type -- todo <br />
  138. listener -- todo
  139. </div>
  140. <div>
  141. todo
  142. </div>
  143. <h3>.setValues([page:todo values]) [page:todo]</h3>
  144. <div>
  145. values -- todo
  146. </div>
  147. <div>
  148. todo
  149. </div>
  150. <h2>Source</h2>
  151. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  152. </body>
  153. </html>