Material.html 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  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]( [page:Object parameters] )</h3>
  14. <h2>Properties</h2>
  15. <h3>.[page:Integer id]</h3>
  16. <div>
  17. Unique number of this material instance.
  18. </div>
  19. <h3>.[page:String name]</h3>
  20. <div>
  21. Material name. Default is an empty string.
  22. </div>
  23. <h3>.[page:Number opacity]</h3>
  24. <div>
  25. Opacity. Default is *1*.
  26. </div>
  27. <h3>.[page:Boolean transparent]</h3>
  28. <div>
  29. 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.
  30. </div>
  31. <div>Default is *false*.</div>
  32. <h3>.[page:Blending blending]</h3>
  33. <div>
  34. Which blending to use when displaying objects with this material. Default is [page:NormalBlending].
  35. </div>
  36. <h3>.[page:Integer blendSrc]</h3>
  37. <div>
  38. Blending source. It's one of the blending mode constants defined in [page:Three Three.js]. Default is *SrcAlphaFactor*.
  39. </div>
  40. <h3>.[page:Integer blendDst]</h3>
  41. <div>
  42. Blending destination. It's one of the blending mode constants defined in [page:Three Three.js]. Default is *OneMinusSrcAlphaFactor*.
  43. </div>
  44. <h3>.[page:Integer blendEquation]</h3>
  45. <div>
  46. Blending equation to use when applying blending. It's one of the constants defined in [page:Three Three.js]. Default is *AddEquation*.
  47. </div>
  48. <h3>.[page:Boolean depthTest]</h3>
  49. <div>
  50. Whether to have depth test enabled when rendering this material. Default is *true*.
  51. </div>
  52. <h3>.[page:Boolean depthWrite]</h3>
  53. <div>
  54. Whether rendering this material has any effect on the depth buffer. Default is *true*.
  55. </div>
  56. <div>
  57. 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.
  58. </div>
  59. <h3>.[page:Boolean polygonOffset]</h3>
  60. <div>
  61. Whether to use polygon offset. Default is *false*. This corresponds to the *POLYGON_OFFSET_FILL* WebGL feature.
  62. </div>
  63. <h3>.[page:Integer polygonOffsetFactor]</h3>
  64. <div>
  65. Sets the polygon offset factor. Default is *0*.
  66. </div>
  67. <h3>.[page:Integer polygonOffsetUnits]</h3>
  68. <div>
  69. Sets the polygon offset units. Default is *0*.
  70. </div>
  71. <h3>.[page:Number alphaTest]</h3>
  72. <div>
  73. Sets the alpha value to be used when running an alpha test. Default is *0*.
  74. </div>
  75. <h3>.[page:Boolean overdraw]</h3>
  76. <div>
  77. Enables/disables overdraw. If enabled, polygons are drawn slightly bigger in order to fix antialiasing gaps when using the [page:CanvasRenderer]. Default is *false*.
  78. </div>
  79. <h3>.[page:Boolean visible]</h3>
  80. <div>
  81. Defines whether this material is visible. Default is *true*.
  82. </div>
  83. <h3>.[page:Enum side]</h3>
  84. <div>
  85. Defines which of the face sides will be rendered - front, back or both.
  86. </div>
  87. <div>
  88. Default is *THREE.FrontSide*. Other options are *THREE.BackSide* and *THREE.DoubleSide*.
  89. </div>
  90. <h3>.[page:Boolean needsUpdate]</h3>
  91. <div>
  92. 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.
  93. </div>
  94. <div>
  95. This property is automatically set to *true* when instancing a new material.
  96. </div>
  97. <h2>Methods</h2>
  98. <h2>Source</h2>
  99. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  100. </body>
  101. </html>