I have been playing around with the foundations of an augmented reality RPG targeting smartphones and things were going great. But, I just got a Quest 3 and decided to load it up to see how things looked. Sadly, it is not great. I have two strange issues regarding scene lighting and I was wondering if someone may know what is going on here.
- Any time I move the quest joysticks left or right, the scene’s sunlight / shadow changes as if the directional light that serves as the sun is being rotated around the map. But, I did not code any such functionality and this does not happen on the smartphone based versions.
Also
- On the Quest 3, shadow angles change drastically as you move your head around, which once again is not expected, wanted, or programmed behavior.
Note, scene lighting is lit by an HDR skybox and a directional light. Nothing more. There is nothing in my code changing the direction of the directional light.
This shows both the issues:
Same test terrain but captured on my tablet which does not have the lighting issues:
Any ideas?
// lighting for the active map
private loadLighting(name: string, scene: Scene){
ar.c("Creating Scene Lighting");
let hdrTexture = CubeTexture.CreateFromPrefilteredData("./assets/environments/studio.env", ar.scene);
ar.scene.environmentTexture = hdrTexture;
// Sun
if(ambienceManager.sunEnabled){
ambienceManager.sunlight = new DirectionalLight("Sun", new Vector3(-0.5, -2, 4), ar.scene);
ambienceManager.sunlight.diffuse = new Color3(1, 0.85, 0.40);
ambienceManager.sunlight.intensity = 10;
ambienceManager.sunlight.shadowEnabled = true;
ambienceManager.sunShadow = new CascadedShadowGenerator(1024, ambienceManager.sunlight);
ambienceManager.sunShadow.numCascades = 4;
ambienceManager.sunShadow.stabilizeCascades = true;
ambienceManager.sunShadow.lambda = 0.13;
ambienceManager.sunShadow.cascadeBlendPercentage = 0.36;
ambienceManager.sunShadow.depthClamp = false;
ambienceManager.sunShadow.autoCalcDepthBounds = true;
ambienceManager.sunShadow.shadowMaxZ = 16811191;
ambienceManager.sunShadow.bias = 0.01;
ambienceManager.sunShadow.normalBias = 0.004;
ambienceManager.sunShadow.darkness = 0.1;
ambienceManager.sunShadow.usePercentageCloserFiltering = true;
ambienceManager.sunShadow.filteringQuality = CascadedShadowGenerator.QUALITY_HIGH;
}
}