12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="utf-8" />
- <base href="../../../" />
- <script src="page.js"></script>
- <link type="text/css" rel="stylesheet" href="page.css" />
- </head>
- <body>
- <h1>Custom Blending Equation Constants</h1>
- <p>
- 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.
- </p>
- <h2>Code Example</h2>
- <code>
- const material = new THREE.MeshBasicMaterial( {color: 0x00ff00} );
- material.blending = THREE.CustomBlending;
- material.blendEquation = THREE.AddEquation; //default
- material.blendSrc = THREE.SrcAlphaFactor; //default
- material.blendDst = THREE.OneMinusSrcAlphaFactor; //default
- </code>
- <h2>Examples</h2>
- <p>
- [example:webgl_materials_blending_custom materials / blending / custom ]
- </p>
- <h2>Blending Equations</h2>
- <code>
- THREE.AddEquation
- THREE.SubtractEquation
- THREE.ReverseSubtractEquation
- THREE.MinEquation
- THREE.MaxEquation
- </code>
- <h2>Source Factors</h2>
- <code>
- THREE.ZeroFactor
- THREE.OneFactor
- THREE.SrcColorFactor
- THREE.OneMinusSrcColorFactor
- THREE.SrcAlphaFactor
- THREE.OneMinusSrcAlphaFactor
- THREE.DstAlphaFactor
- THREE.OneMinusDstAlphaFactor
- THREE.DstColorFactor
- THREE.OneMinusDstColorFactor
- THREE.SrcAlphaSaturateFactor
- THREE.ConstantColorFactor
- THREE.OneMinusConstantColorFactor
- THREE.ConstantAlphaFactor
- THREE.OneMinusConstantAlphaFactor
- </code>
- <h2>Destination Factors</h2>
- <p>
- All of the Source Factors are valid as Destination Factors, except for
- <code>THREE.SrcAlphaSaturateFactor</code>
- </p>
- <h2>Source</h2>
- <p>
- [link:https://github.com/mrdoob/three.js/blob/master/src/constants.js src/constants.js]
- </p>
- </body>
- </html>
|