I modified the engine parameter in PG (https://playground.babylonjs.com/#JA1ND3#863)
engine.setHardwareScalingLevel(20);
After entering xr, the effect is different from the initial effect
I modified the engine parameter in PG (https://playground.babylonjs.com/#JA1ND3#863)
engine.setHardwareScalingLevel(20);
I add codes.[PG:https://playground.babylonjs.com/#JA1ND3#861]
let defaultPipeline = new BABYLON.DefaultRenderingPipeline(
"DefaultRenderingPipeline",
true, // is HDR?
scene,
scene.cameras
);
//抗锯齿
defaultPipeline.samples = 8;
defaultPipeline.fxaaEnabled = true;
It appears to be an issue like this.
After entering webXR, try add camera to the pipeline
scene.createDefaultXRExperienceAsync({
floorMeshes: [scene.getMeshByName("Sols")]
}).then((xr) => {
xr.baseExperience.sessionManager.onXRFrameObservable.addOnce(() => {
defaultPipeline.addCamera(xr.baseExperience.camera)
});
});
cc @RaananW
Not sure why I am assigned, the last answer was correct
The XR camera is different than the default scene came5ra, and it needs to be used in the pipeline in order for the XR camera(s) to render the scene correctly. There is probably no way to automate that - the cameras don’t keep a list of rendering pipelines or post processes they are included it, so we can’t “copy” the assignments from the original camera. Also, you might not want to do that automatically.
Small note regarding hardware scaling rate - XR doesn’t use your canvas to render. If you want to emulate that in XR you can pass a different value to the `framebufferScaleFactor (XRWebGLLayerInit | Babylon.js Documentation) when initializing the output canvas options in the XR experience helper