[LayaAir3]平面阴影Stencil用法问题

在角色上添加如下脚本,但是无效,是用法不对吗
onAwake(): void {
        console.log(this.owner.name)
        var skin = this.owner.getComponent(Laya.SkinnedMeshRenderer);
        let mat = skin.material;
        mat.stencilTest = Laya.RenderState.STENCILTEST_NOTEQUAL;
        mat.stencilWrite = true;
        mat.stencilRef = 2;
        mat.stencilOp = new Laya.Vector3(Laya.RenderState.STENCILOP_KEEP, Laya.RenderState.STENCILOP_KEEP, Laya.RenderState.STENCILOP_REPLACE)
        skin.material = mat;
    }
stencil.png
已邀请:

要回复问题请先

商务合作
商务合作