自定义混合方程常量(Custom Blending Equation Constants)

这个常量可以用于所有的材质类型。首先将材质的混合模式设置为v3d.CustomBlending,然后设置所需要的混合方程、源因子和目标因子。

代码示例

const material = new v3d.MeshBasicMaterial({color: 0x00ff00}); material.blending = v3d.CustomBlending; material.blendEquation = v3d.AddEquation; //default material.blendSrc = v3d.SrcAlphaFactor; //default material.blendDst = v3d.OneMinusSrcAlphaFactor; //default

例子

materials / blending / custom

混合方程

v3d.AddEquation v3d.SubtractEquation v3d.ReverseSubtractEquation v3d.MinEquation v3d.MaxEquation

源因子

v3d.ZeroFactor v3d.OneFactor v3d.SrcColorFactor v3d.OneMinusSrcColorFactor v3d.SrcAlphaFactor v3d.OneMinusSrcAlphaFactor v3d.DstAlphaFactor v3d.OneMinusDstAlphaFactor v3d.DstColorFactor v3d.OneMinusDstColorFactor v3d.SrcAlphaSaturateFactor

目标因子

所有的源因子的值,在目标因子中都是有效的。除了:v3d.SrcAlphaSaturateFactor

源代码

src/constants.js