2
0

CustomBlendingEquations.html 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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. <h1>Custom Blending Equation Constants</h1>
  11. <p>
  12. These work with all material types. First set the material's blending mode to THREE.CustomBlending, then set the desired Blending Equation, Source Factor and Destination Factor.
  13. </p>
  14. <h2>Code Example</h2>
  15. <code>
  16. const material = new THREE.MeshBasicMaterial( {color: 0x00ff00} );
  17. material.blending = THREE.CustomBlending;
  18. material.blendEquation = THREE.AddEquation; //default
  19. material.blendSrc = THREE.SrcAlphaFactor; //default
  20. material.blendDst = THREE.OneMinusSrcAlphaFactor; //default
  21. </code>
  22. <h2>Examples</h2>
  23. <p>[example:webgl_materials_blending_custom materials / blending / custom ]</p>
  24. <h2>Blending Equations</h2>
  25. <code>
  26. THREE.AddEquation
  27. THREE.SubtractEquation
  28. THREE.ReverseSubtractEquation
  29. THREE.MinEquation
  30. THREE.MaxEquation
  31. </code>
  32. <h2>Source Factors</h2>
  33. <code>
  34. THREE.ZeroFactor
  35. THREE.OneFactor
  36. THREE.SrcColorFactor
  37. THREE.OneMinusSrcColorFactor
  38. THREE.SrcAlphaFactor
  39. THREE.OneMinusSrcAlphaFactor
  40. THREE.DstAlphaFactor
  41. THREE.OneMinusDstAlphaFactor
  42. THREE.DstColorFactor
  43. THREE.OneMinusDstColorFactor
  44. THREE.SrcAlphaSaturateFactor
  45. </code>
  46. <h2>Destination Factors</h2>
  47. <p>
  48. All of the Source Factors are valid as Destination Factors, except for <code>THREE.SrcAlphaSaturateFactor</code>
  49. </p>
  50. <h2>Source</h2>
  51. <p>
  52. [link:https://github.com/mrdoob/three.js/blob/master/src/constants.js src/constants.js]
  53. </p>
  54. </body>
  55. </html>