we
    Preparing search index...

    Interface I_AlphaTransparentOfMaterial

    透明材质的初始化参数 1、适配三种模式:alphaTest, blend、testAndBlend

    interface I_AlphaTransparentOfMaterial {
        alphaCutOff?: number;
        blendParams?: {
            blend?: GPUBlendState;
            blendConstants?: number[];
            opacity?: number;
        };
    }
    Index

    Properties

    alphaCutOff?: number

    透明阈值 1、alphaTest模式下,alphaCutOff为透明阈值,大于该值的像素会被渲染,小于该值的像素会被剔除。 2、testAndBlend模式下,alphaCutOff为透明阈值,大于该值的像素会被blend渲染,小于该值的像素会被剔除。 3、blend模式下,忽略alphaCutOff。

    blendParams?: {
        blend?: GPUBlendState;
        blendConstants?: number[];
        opacity?: number;
    }

    透明混合参数 1、只用工作在blend和testAndBlend模式下。 2、每个材质按照本身情况实现对应function。

    Type Declaration

    • Optionalblend?: GPUBlendState
    • OptionalblendConstants?: number[]

      透明混合常量 color 4f https://www.w3.org/TR/webgpu/#dom-gpurenderpassencoder-setblendconstant Sets the constant blend color and alpha values used with "constant" and "one-minus-constant" GPUBlendFactors. If this value is not specified, the value of the color attachment's clear color is used. If the color attachment has no clear color, the value is [0, 0, 0, 0].

    • Optionalopacity?: number

      不透明度(即alpha值),float32,默认=1.0 两种情况: 1、使用统一的透明度(opacity) 2、使用来自texture的透明度(alpha)