[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;
}
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;
}
没有找到相关结果
已邀请:
要回复问题请先登录
0 个回复