BlendMode.html 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>BlendMode - Three.js Docs</title>
  6. <meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
  7. <script src="../scripts/highlight.min.js"></script>
  8. <link type="text/css" rel="stylesheet" href="../styles/highlight-three.css">
  9. <link type="text/css" rel="stylesheet" href="../styles/page.css">
  10. </head>
  11. <body>
  12. <h1 translate="no">BlendMode</h1>
  13. <section>
  14. <header>
  15. <div class="class-description"><p>Represents blending configuration.</p>
  16. <p>This class encapsulates all blending-related properties that control how
  17. a material's colors are combined with the colors already in the frame buffer.</p></div>
  18. </header>
  19. <article>
  20. <div class="container-overview">
  21. <h2>Constructor</h2>
  22. <h3 class="name name-method" id="BlendMode" translate="no">new <a href="#BlendMode">BlendMode</a><span class="signature">( blending : <span class="param-type"><a href="global.html#NoBlending">NoBlending</a> | <a href="global.html#NormalBlending">NormalBlending</a> | <a href="global.html#AdditiveBlending">AdditiveBlending</a> | <a href="global.html#SubtractiveBlending">SubtractiveBlending</a> | <a href="global.html#MultiplyBlending">MultiplyBlending</a> | <a href="global.html#CustomBlending">CustomBlending</a> | <a href="global.html#MaterialBlending">MaterialBlending</a></span> )</span> </h3>
  23. <div class="method">
  24. <div class="description">
  25. <p>Constructs a new blending configuration.</p>
  26. </div>
  27. <table class="params">
  28. <tbody>
  29. <tr>
  30. <td class="name">
  31. <strong translate="no">blending</strong>
  32. </td>
  33. <td class="description last">
  34. <p>The blending mode.</p>
  35. <p>Default is <code>NormalBlending</code>.</p>
  36. </td>
  37. </tr>
  38. </tbody>
  39. </table>
  40. </div>
  41. </div>
  42. <h2 class="subsection-title">Properties</h2>
  43. <div class="member">
  44. <h3 class="name" id="blendDst" translate="no">.<a href="#blendDst">blendDst</a><span class="type-signature"> : <a href="global.html#ZeroFactor">ZeroFactor</a> | <a href="global.html#OneFactor">OneFactor</a> | <a href="global.html#SrcColorFactor">SrcColorFactor</a> | <a href="global.html#OneMinusSrcColorFactor">OneMinusSrcColorFactor</a> | <a href="global.html#SrcAlphaFactor">SrcAlphaFactor</a> | <a href="global.html#OneMinusSrcAlphaFactor">OneMinusSrcAlphaFactor</a> | <a href="global.html#DstAlphaFactor">DstAlphaFactor</a> | <a href="global.html#OneMinusDstAlphaFactor">OneMinusDstAlphaFactor</a> | <a href="global.html#DstColorFactor">DstColorFactor</a> | <a href="global.html#OneMinusDstColorFactor">OneMinusDstColorFactor</a> | <a href="global.html#SrcAlphaSaturateFactor">SrcAlphaSaturateFactor</a> | <a href="global.html#ConstantColorFactor">ConstantColorFactor</a> | <a href="global.html#OneMinusConstantColorFactor">OneMinusConstantColorFactor</a> | <a href="global.html#ConstantAlphaFactor">ConstantAlphaFactor</a> | <a href="global.html#OneMinusConstantAlphaFactor">OneMinusConstantAlphaFactor</a></span> </h3>
  45. <div class="description">
  46. <p>Defines the blending destination factor.</p>
  47. <p>This determines how the destination (existing) fragment color in the frame buffer
  48. is factored before being combined with the source (incoming) fragment color.</p>
  49. <p>Default is <code>OneMinusSrcAlphaFactor</code>.</p>
  50. </div>
  51. </div>
  52. <div class="member">
  53. <h3 class="name" id="blendDstAlpha" translate="no">.<a href="#blendDstAlpha">blendDstAlpha</a><span class="type-signature"> : <a href="global.html#ZeroFactor">ZeroFactor</a> | <a href="global.html#OneFactor">OneFactor</a> | <a href="global.html#SrcColorFactor">SrcColorFactor</a> | <a href="global.html#OneMinusSrcColorFactor">OneMinusSrcColorFactor</a> | <a href="global.html#SrcAlphaFactor">SrcAlphaFactor</a> | <a href="global.html#OneMinusSrcAlphaFactor">OneMinusSrcAlphaFactor</a> | <a href="global.html#DstAlphaFactor">DstAlphaFactor</a> | <a href="global.html#OneMinusDstAlphaFactor">OneMinusDstAlphaFactor</a> | <a href="global.html#DstColorFactor">DstColorFactor</a> | <a href="global.html#OneMinusDstColorFactor">OneMinusDstColorFactor</a> | <a href="global.html#SrcAlphaSaturateFactor">SrcAlphaSaturateFactor</a> | <a href="global.html#ConstantColorFactor">ConstantColorFactor</a> | <a href="global.html#OneMinusConstantColorFactor">OneMinusConstantColorFactor</a> | <a href="global.html#ConstantAlphaFactor">ConstantAlphaFactor</a> | <a href="global.html#OneMinusConstantAlphaFactor">OneMinusConstantAlphaFactor</a></span> </h3>
  54. <div class="description">
  55. <p>Defines the blending destination alpha factor.</p>
  56. <p>When set, this allows separate control of the alpha channel's destination blending factor.
  57. If <code>null</code>, <a href="BlendMode.html#blendDst">BlendMode#blendDst</a> is used for the alpha channel as well.</p>
  58. <p>Default is <code>null</code>.</p>
  59. </div>
  60. </div>
  61. <div class="member">
  62. <h3 class="name" id="blendEquation" translate="no">.<a href="#blendEquation">blendEquation</a><span class="type-signature"> : <a href="global.html#AddEquation">AddEquation</a> | <a href="global.html#SubtractEquation">SubtractEquation</a> | <a href="global.html#ReverseSubtractEquation">ReverseSubtractEquation</a> | <a href="global.html#MinEquation">MinEquation</a> | <a href="global.html#MaxEquation">MaxEquation</a></span> </h3>
  63. <div class="description">
  64. <p>Defines the blending equation.</p>
  65. <p>This determines how the source and destination colors are combined.</p>
  66. <p>Default is <code>AddEquation</code>.</p>
  67. </div>
  68. </div>
  69. <div class="member">
  70. <h3 class="name" id="blendEquationAlpha" translate="no">.<a href="#blendEquationAlpha">blendEquationAlpha</a><span class="type-signature"> : <a href="global.html#AddEquation">AddEquation</a> | <a href="global.html#SubtractEquation">SubtractEquation</a> | <a href="global.html#ReverseSubtractEquation">ReverseSubtractEquation</a> | <a href="global.html#MinEquation">MinEquation</a> | <a href="global.html#MaxEquation">MaxEquation</a></span> </h3>
  71. <div class="description">
  72. <p>Defines the blending equation of the alpha channel.</p>
  73. <p>When set, this allows separate control of the alpha channel's blending equation.
  74. If <code>null</code>, <a href="BlendMode.html#blendEquation">BlendMode#blendEquation</a> is used for the alpha channel as well.</p>
  75. <p>Default is <code>null</code>.</p>
  76. </div>
  77. </div>
  78. <div class="member">
  79. <h3 class="name" id="blendSrc" translate="no">.<a href="#blendSrc">blendSrc</a><span class="type-signature"> : <a href="global.html#ZeroFactor">ZeroFactor</a> | <a href="global.html#OneFactor">OneFactor</a> | <a href="global.html#SrcColorFactor">SrcColorFactor</a> | <a href="global.html#OneMinusSrcColorFactor">OneMinusSrcColorFactor</a> | <a href="global.html#SrcAlphaFactor">SrcAlphaFactor</a> | <a href="global.html#OneMinusSrcAlphaFactor">OneMinusSrcAlphaFactor</a> | <a href="global.html#DstAlphaFactor">DstAlphaFactor</a> | <a href="global.html#OneMinusDstAlphaFactor">OneMinusDstAlphaFactor</a> | <a href="global.html#DstColorFactor">DstColorFactor</a> | <a href="global.html#OneMinusDstColorFactor">OneMinusDstColorFactor</a> | <a href="global.html#SrcAlphaSaturateFactor">SrcAlphaSaturateFactor</a> | <a href="global.html#ConstantColorFactor">ConstantColorFactor</a> | <a href="global.html#OneMinusConstantColorFactor">OneMinusConstantColorFactor</a> | <a href="global.html#ConstantAlphaFactor">ConstantAlphaFactor</a> | <a href="global.html#OneMinusConstantAlphaFactor">OneMinusConstantAlphaFactor</a></span> </h3>
  80. <div class="description">
  81. <p>Defines the blending source factor.</p>
  82. <p>This determines how the source (incoming) fragment color is factored before being added
  83. to the destination (existing) fragment color in the frame buffer.</p>
  84. <p>Default is <code>SrcAlphaFactor</code>.</p>
  85. </div>
  86. </div>
  87. <div class="member">
  88. <h3 class="name" id="blendSrcAlpha" translate="no">.<a href="#blendSrcAlpha">blendSrcAlpha</a><span class="type-signature"> : <a href="global.html#ZeroFactor">ZeroFactor</a> | <a href="global.html#OneFactor">OneFactor</a> | <a href="global.html#SrcColorFactor">SrcColorFactor</a> | <a href="global.html#OneMinusSrcColorFactor">OneMinusSrcColorFactor</a> | <a href="global.html#SrcAlphaFactor">SrcAlphaFactor</a> | <a href="global.html#OneMinusSrcAlphaFactor">OneMinusSrcAlphaFactor</a> | <a href="global.html#DstAlphaFactor">DstAlphaFactor</a> | <a href="global.html#OneMinusDstAlphaFactor">OneMinusDstAlphaFactor</a> | <a href="global.html#DstColorFactor">DstColorFactor</a> | <a href="global.html#OneMinusDstColorFactor">OneMinusDstColorFactor</a> | <a href="global.html#SrcAlphaSaturateFactor">SrcAlphaSaturateFactor</a> | <a href="global.html#ConstantColorFactor">ConstantColorFactor</a> | <a href="global.html#OneMinusConstantColorFactor">OneMinusConstantColorFactor</a> | <a href="global.html#ConstantAlphaFactor">ConstantAlphaFactor</a> | <a href="global.html#OneMinusConstantAlphaFactor">OneMinusConstantAlphaFactor</a></span> </h3>
  89. <div class="description">
  90. <p>Defines the blending source alpha factor.</p>
  91. <p>When set, this allows separate control of the alpha channel's source blending factor.
  92. If <code>null</code>, <a href="BlendMode.html#blendSrc">BlendMode#blendSrc</a> is used for the alpha channel as well.</p>
  93. <p>Default is <code>null</code>.</p>
  94. </div>
  95. </div>
  96. <div class="member">
  97. <h3 class="name" id="blending" translate="no">.<a href="#blending">blending</a><span class="type-signature"> : <a href="global.html#NoBlending">NoBlending</a> | <a href="global.html#NormalBlending">NormalBlending</a> | <a href="global.html#AdditiveBlending">AdditiveBlending</a> | <a href="global.html#SubtractiveBlending">SubtractiveBlending</a> | <a href="global.html#MultiplyBlending">MultiplyBlending</a> | <a href="global.html#CustomBlending">CustomBlending</a> | <a href="global.html#MaterialBlending">MaterialBlending</a></span> </h3>
  98. <div class="description">
  99. <p>Defines the blending type.</p>
  100. <p>It must be set to <code>CustomBlending</code> if custom blending properties like
  101. <a href="BlendMode.html#blendSrc">BlendMode#blendSrc</a>, <a href="BlendMode.html#blendDst">BlendMode#blendDst</a> or <a href="BlendMode.html#blendEquation">BlendMode#blendEquation</a>
  102. should have any effect.</p>
  103. <p>Default is <code>NormalBlending</code>.</p>
  104. </div>
  105. </div>
  106. <div class="member">
  107. <h3 class="name" id="premultiplyAlpha" translate="no">.<a href="#premultiplyAlpha">premultiplyAlpha</a><span class="type-signature"> : boolean</span> </h3>
  108. <div class="description">
  109. <p>Defines whether to premultiply the alpha (transparency) value.</p>
  110. <p>If <code>true</code>, the RGB color of the texture or material is multiplied by its alpha value.
  111. This is useful for transparent textures/materials where the color data
  112. should already include the transparency information.</p>
  113. <p>Default is <code>false</code>.</p>
  114. </div>
  115. </div>
  116. <h2 class="subsection-title">Methods</h2>
  117. <h3 class="name name-method" id="clone" translate="no">.<a href="#clone">clone</a><span class="signature">()</span><span class="type-signature"> : <a href="BlendMode.html">BlendMode</a></span> </h3>
  118. <div class="method">
  119. <div class="description">
  120. <p>Returns a clone of this blending configuration.</p>
  121. </div>
  122. <dl class="details">
  123. <dt class="tag-returns"><strong>Returns:</strong> A new Blending instance with the same properties.</dt>
  124. </dl>
  125. </div>
  126. <h3 class="name name-method" id="copy" translate="no">.<a href="#copy">copy</a><span class="signature">( source : <span class="param-type"><a href="BlendMode.html">BlendMode</a></span> )</span><span class="type-signature"> : <a href="BlendMode.html">BlendMode</a></span> </h3>
  127. <div class="method">
  128. <div class="description">
  129. <p>Copies the blending properties from the given source to this instance.</p>
  130. </div>
  131. <table class="params">
  132. <tbody>
  133. <tr>
  134. <td class="name">
  135. <strong translate="no">source</strong>
  136. </td>
  137. <td class="description last">
  138. <p>The blending configuration to copy from.</p>
  139. </td>
  140. </tr>
  141. </tbody>
  142. </table>
  143. <dl class="details">
  144. <dt class="tag-returns"><strong>Returns:</strong> A reference to this instance.</dt>
  145. </dl>
  146. </div>
  147. <h2 class="subsection-title">Source</h2>
  148. <p>
  149. <a href="https://github.com/mrdoob/three.js/blob/master/src/renderers/common/BlendMode.js" translate="no" target="_blank" rel="noopener">src/renderers/common/BlendMode.js</a>
  150. </p>
  151. </article>
  152. </section>
  153. <script src="../scripts/linenumber.js"></script>
  154. <script src="../scripts/page.js"></script>
  155. </body>
  156. </html>
粤ICP备19079148号