[LayaAirIDE 2.0]2.8.0上默认模型不能产生和接受阴影
同样的代码在 2.3.0 上使用阴影功能,是有阴影效果的。
在2.8.0上使用阴影功能,就没有出现阴影效果。
2.8.0设置阴影的代码:
var directionLight: Laya.DirectionLight = scene.addChild(new Laya.DirectionLight()) as Laya.DirectionLight;
directionLight.color = new Laya.Vector3(0.6, 0.6, 0.6);
directionLight.transform.worldMatrix.setForward(new Laya.Vector3(1, -1, 0));
directionLight.shadowMode = Laya.ShadowMode.SoftLow;
directionLight.shadowDistance = 100;
directionLight.shadowNearPlane = 1;
directionLight.shadowResolution = 2048;
directionLight.shadowCascadesMode = Laya.ShadowCascadesMode.NoCascades;
directionLight.shadowNormalBias = 4;
directionLight.shadowStrength = 10;
在2.8.0上使用阴影功能,就没有出现阴影效果。
2.8.0设置阴影的代码:
var directionLight: Laya.DirectionLight = scene.addChild(new Laya.DirectionLight()) as Laya.DirectionLight;
directionLight.color = new Laya.Vector3(0.6, 0.6, 0.6);
directionLight.transform.worldMatrix.setForward(new Laya.Vector3(1, -1, 0));
directionLight.shadowMode = Laya.ShadowMode.SoftLow;
directionLight.shadowDistance = 100;
directionLight.shadowNearPlane = 1;
directionLight.shadowResolution = 2048;
directionLight.shadowCascadesMode = Laya.ShadowCascadesMode.NoCascades;
directionLight.shadowNormalBias = 4;
directionLight.shadowStrength = 10;
没有找到相关结果
已邀请:
要回复问题请先登录
1 个回复
Laya_z
赞同来自: