[0]iPhone 11 及以上机型 Camera 的 RenderTexture 显示不出来
Laya 2.3.0 及以上版本。
iPhone 7 机器上显示正常,iPhone 11 及以上机型 Camera 的 RenderTexture 显示不出来!有没有解决方案?这个BUG什么时候修复?
代码看图:
iPhone 7 机器上显示正常,iPhone 11 及以上机型 Camera 的 RenderTexture 显示不出来!有没有解决方案?这个BUG什么时候修复?
代码看图:
没有找到相关结果
已邀请:
要回复问题请先登录

3 个回复
Yan
赞同来自:
186*****256
赞同来自:
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
赞同来自: