three.js CustomBlendingEquation

2023-02-16 17:30 更新

這個常量可以用于所有的材質類型。首先將材質的混合模式設置為THREE.CustomBlending,然后設置所需要的混合方程、源因子和目標因子。

代碼示例

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

例子

materials / blending / custom

混合方程

THREE.AddEquation
THREE.SubtractEquation
THREE.ReverseSubtractEquation
THREE.MinEquation
THREE.MaxEquation

源因子

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

目標因子

所有的源因子的值,在目標因子中都是有效的。除了:

THREE.SrcAlphaSaturateFactor

源代碼

src/constants.js


以上內容是否對您有幫助:
在線筆記
App下載
App下載

掃描二維碼

下載編程獅App

公眾號
微信公眾號

編程獅公眾號