[0]iPhone 11 及以上机型 Camera 的 RenderTexture 显示不出来

Laya 2.3.0 及以上版本。
 iPhone 7 机器上显示正常,iPhone 11 及以上机型 Camera 的 RenderTexture 显示不出来!有没有解决方案?这个BUG什么时候修复?
 
代码看图:
20220929093655.png
已邀请:

Yan

赞同来自:

未能重现,请提供可重现的完整示例,而不是自行定位的地方。

186*****256

赞同来自:

大佬,问题有点问题,我们自测各种安卓平台显示的挺好,iPhone6,iPhone7,iPhone11也显示的挺好,测试是iPhone13上显示不出来,代码都是一模一样的!若不是这里的问题,那么我贴出所有的代码,主要是摄像机裁剪,以及渲染排序,代码就这么点。
 
constructor() {
this.scene = Laya.loader.getRes(Assets.Scene.Slot);

this.settings = Configs.slotSettings;

// culling mask.
for (let i = 0; i < Constants.MaxLayer; ++i) {
let child = <Sprite3D>this.scene.getChildByName(`Layer${i}`);
let camera = <Laya.Camera>child.getChildByName("Camera");
camera.cullingMask = Math.pow(2, i);
Utility.setSprite3DLayer(child, i);
this.layers.push(child);
this.cameras.push(camera);
}

// cameras.
this.cameras[1].clearFlag = Laya.CameraClearFlags.SolidColor;
this.cameras[1].clearColor = new Laya.Vector4(0, 0, 0, 0);
this.mainCamera = new Camera3D(this.cameras[0]);
this.clippingCamera = new Camera2D(this.cameras[1]);
Blackboard.set(BBKey.MainCamara, this.mainCamera);
Blackboard.set(BBKey.ClippingCamera, this.clippingCamera);

// sorting fudge.
for (let i = 0; i < this.layers.length; ++i) {
for (let j = 0; j < this.layers[i].numChildren; ++j) {
let layer = this.layers[i];
let child = <Sprite3D>layer.getChildAt(j);
if (child instanceof Laya.Camera) {
continue;
}
// child.transform.localPosition = new Vector3(0, 0, 0);
Utility.setSprite3DSortingFudge(child, 10000000 - j * 10000);
}
}

// slot camera clipping.
// Renderer Target Quad
let rtq = <MeshSprite3D>this.layers[0].getChildByName("RTQ");
let renderTextrue = new Laya.RenderTexture(this.settings.clippingWidth, this.settings.clippingHeight, Laya.RenderTextureFormat.R16G16B16A16, Laya.RenderTextureDepthFormat.DEPTH_16);
this.cameras[1].renderTarget = renderTextrue;
// this.cameras[1].orthographicVerticalSize = this.settings.clippingHeight;
(<Laya.UnlitMaterial>rtq.meshRenderer.material).albedoTexture = this.cameras[1].renderTarget;
Laya.timer.frameOnce(10, this, () => {

})
}

186*****256

赞同来自:

今天我又测试了一天,做Demo的时候发现确实是正常的,后面发现是FGUI和Laya摄像机裁剪导致层级错乱了,关闭FGUI或者add到最后面是能看到的,但是挡住了FGUI,add到索引为0的位置则裁剪的摄像机内容看起来是被FGUI挡住了看不见了,实际什么问题需要你们查找。重点:测试的苹果机型6,7,11上都能正确的显示内容,层级没问题,13上面就不正常。DEMO附件传不上来,连接:https://pan.baidu.com/s/1QE6xoZ3kwHphRECmYf6YWQ 提取码:qhd7

要回复问题请先

商务合作
商务合作