WebGLState

优质
小牛编辑
134浏览
2023-12-01

方法

.enable ( id : Integer, boolean : Boolean ) : null

TODO

.disable ( id : Integer, boolean : Boolean ) : null

TODO

.setDepthTest ( depthTest : Boolean ) : null

depthTest -- 决定是否需要基于深度缓存对片元进行深度测试的布尔值

该方法设置了depthTest的值,故可决定是否需要基于深度缓存测试深度数据

.setDepthWrite ( depthWrite : Boolean ) : null

depthWrite -- 决定是否需要保持片元深度的布尔值

该方法设置depthWrite的值,故可决定是否要将深度数据写入深度缓存中

.setBlending ( blending : number, blendEquation : number, blendSrc : number, blendDst : number ) : null

blending -- 一个表示混合模式的数字。可能的值有THREE.NoBlending, THREE.NormalBlending, THREE.AdditiveBlending, THREE.SubtractiveBlending, THREE.MultiplyBlending 和 THREE.CustomBlending
blendEquation -- 如果blending的值是THREE.CustomBlending,那么你可以设置blendEquation. 可能的值有THREE.AddEquation, THREE.SubtractEquation 和 THREE.ReverseSubtractEquation.
blendSrc -- 如果blending的值是THREE.CustomBlending, 那么你可以设置blendSrc.可能的值有THREE.ZeroFactor, THREE.OneFactor,THREE.SrcColorFactor, THREE.OneMinusSrcColorFactor, THREE.SrcAlphaFactor, THREE.OneMinusSrcAlphaFactor, THREE.DstAlphaFactor, THREE.OneMinusDstAlphaFactor, THREE.DstColorFactor,THREE.OneMinusDstColorFactor 和 THREE.SrcAlphaSaturateFactor
blendDst -- 如果blending的值是THREE.CustomBlending, 那么你可以设置blendDst. 可能的值有THREE.ZeroFactor, THREE.OneFactor,THREE.SrcColorFactor, THREE.OneMinusSrcColorFactor, THREE.SrcAlphaFactor, THREE.OneMinusSrcAlphaFactor, THREE.DstAlphaFactor, THREE.OneMinusDstAlphaFactor, THREE.DstColorFactor,THREE.OneMinusDstColorFactor or THREE.SrcAlphaSaturateFactor

该方法设置正确的混合

源码

src/renderers/webgl/WebGLState.js