|
@@ -10,32 +10,48 @@
|
|
|
<body>
|
|
|
<h1>Custom Blending Equation Constants</h1>
|
|
|
|
|
|
- <h2>Equations</h2>
|
|
|
- <div>
|
|
|
- THREE.AddEquation<br />
|
|
|
- THREE.SubtractEquation<br />
|
|
|
- THREE.ReverseSubtractEquation<br />
|
|
|
- THREE.MinEquation<br />
|
|
|
+
|
|
|
+ <h2>Example</h2>
|
|
|
+ <div>[example:webgl_materials_blending_custom materials / blending / custom ]</div>
|
|
|
+
|
|
|
+ <h2>Usage</h2>
|
|
|
+ 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.
|
|
|
+
|
|
|
+ <code>
|
|
|
+ var material = new THREE.MeshBasicMaterial( {color: 0x00ff00} );
|
|
|
+ material.blending = THREE.CustomBlending;
|
|
|
+ material.blendEquation = THREE.AddEquation; //default
|
|
|
+ material.blendSrc = THREE.SrcAlphaFactor; //default
|
|
|
+ material.blendDst = THREE.OneMinusDstAlphaFactor; //default
|
|
|
+ </code>
|
|
|
+
|
|
|
+ <h2>Blending Equations</h2>
|
|
|
+ <code>
|
|
|
+ THREE.AddEquation
|
|
|
+ THREE.SubtractEquation
|
|
|
+ THREE.ReverseSubtractEquation
|
|
|
+ THREE.MinEquation
|
|
|
THREE.MaxEquation
|
|
|
- </div>
|
|
|
+ </code>
|
|
|
|
|
|
- <h2>Destination Factors</h2>
|
|
|
- <div>
|
|
|
- THREE.ZeroFactor<br />
|
|
|
- THREE.OneFactor<br />
|
|
|
- THREE.SrcColorFactor<br />
|
|
|
- THREE.OneMinusSrcColorFactor<br />
|
|
|
- THREE.SrcAlphaFactor<br />
|
|
|
- THREE.OneMinusSrcAlphaFactor<br />
|
|
|
- THREE.DstAlphaFactor<br />
|
|
|
+ <h2>Source Factors</h2>
|
|
|
+ <code>
|
|
|
+ THREE.ZeroFactor
|
|
|
+ THREE.OneFactor
|
|
|
+ THREE.SrcColorFactor
|
|
|
+ THREE.OneMinusSrcColorFactor
|
|
|
+ THREE.SrcAlphaFactor
|
|
|
+ THREE.OneMinusSrcAlphaFactor
|
|
|
+ THREE.DstAlphaFactor
|
|
|
THREE.OneMinusDstAlphaFactor
|
|
|
- </div>
|
|
|
+ THREE.DstColorFactor
|
|
|
+ THREE.OneMinusDstColorFactor
|
|
|
+ THREE.SrcAlphaSaturateFactor
|
|
|
+ </code>
|
|
|
|
|
|
- <h2>Source Factors</h2>
|
|
|
+ <h2>Destination Factors</h2>
|
|
|
<div>
|
|
|
- THREE.DstColorFactor<br />
|
|
|
- THREE.OneMinusDstColorFactor<br />
|
|
|
- THREE.SrcAlphaSaturateFactor
|
|
|
+ All of the Source Factors are valid as Destination Factors, except for <code>THREE.SrcAlphaSaturateFactor</code>
|
|
|
</div>
|
|
|
|
|
|
<h2>Source</h2>
|