LayaAir
LayaAir copied to clipboard
3.0 透明相机报错
环境信息
Chrome 110.0.5481.177 on Arch Linux LayaAir Master3.0 with f77aed304e8925c5cd3a23f1f91468521ee35d6d
错误描述
相机的 clearFlag
设置为 DepthOnly
时无法正确清屏,并报错如下
[.WebGL-0x24d803f1cd00] GL_INVALID_OPERATION: Invalid copy texture format combination.
用例
创建用于在UI上一层,播放3D粒子特效的透明场景场景
示例代码
async initialize() {
this.scene = new Laya.Scene3D();
if (this.scene.physicsSimulation) this.scene.physicsSimulation.fixedTimeStep = 1;
Laya.stage.addChild(this.scene);
this.directionLight = new Laya.DirectionLight();
this.scene.addChild(this.directionLight);
this.camera = new Laya.Camera(0, 0.01, 1000);
this.camera.orthographic = true;
this.camera.orthographicVerticalSize = 20;
this.camera.clearFlag = Laya.CameraClearFlags.DepthOnly;
this.camera.depthTextureFormat = Laya.RenderTargetFormat.DEPTH_32;
this.camera.enableHDR = false;
this.scene.addChild(this.camera);
}
fix in #972