LayaAir icon indicating copy to clipboard operation
LayaAir copied to clipboard

3.0 透明相机报错

Open Geequlim opened this issue 1 year ago • 1 comments

环境信息

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);
}

Geequlim avatar Mar 05 '23 06:03 Geequlim

fix in #972

xiaoguzhu avatar Mar 28 '23 08:03 xiaoguzhu