CustomBlendingEquations.html 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8" />
  5. <base href="../../" />
  6. <script src="list.js"></script>
  7. <script src="page.js"></script>
  8. <link type="text/css" rel="stylesheet" href="page.css" />
  9. </head>
  10. <body>
  11. <h1>Custom Blending Equation Constants</h1>
  12. <h2>Example</h2>
  13. <div>[example:webgl_materials_blending_custom materials / blending / custom ]</div>
  14. <h2>Usage</h2>
  15. 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.
  16. <code>
  17. var material = new THREE.MeshBasicMaterial( {color: 0x00ff00} );
  18. material.blending = THREE.CustomBlending;
  19. material.blendEquation = THREE.AddEquation; //default
  20. material.blendSrc = THREE.SrcAlphaFactor; //default
  21. material.blendDst = THREE.OneMinusDstAlphaFactor; //default
  22. </code>
  23. <h2>Blending Equations</h2>
  24. <code>
  25. THREE.AddEquation
  26. THREE.SubtractEquation
  27. THREE.ReverseSubtractEquation
  28. THREE.MinEquation
  29. THREE.MaxEquation
  30. </code>
  31. <h2>Source Factors</h2>
  32. <code>
  33. THREE.ZeroFactor
  34. THREE.OneFactor
  35. THREE.SrcColorFactor
  36. THREE.OneMinusSrcColorFactor
  37. THREE.SrcAlphaFactor
  38. THREE.OneMinusSrcAlphaFactor
  39. THREE.DstAlphaFactor
  40. THREE.OneMinusDstAlphaFactor
  41. THREE.DstColorFactor
  42. THREE.OneMinusDstColorFactor
  43. THREE.SrcAlphaSaturateFactor
  44. </code>
  45. <h2>Destination Factors</h2>
  46. <div>
  47. All of the Source Factors are valid as Destination Factors, except for <code>THREE.SrcAlphaSaturateFactor</code>
  48. </div>
  49. <h2>Source</h2>
  50. [link:https://github.com/mrdoob/three.js/blob/master/src/constants.js src/constants.js]
  51. </body>
  52. </html>