Babylon.js icon indicating copy to clipboard operation
Babylon.js copied to clipboard

Out of sync VR camera with lens flares

Open SimonTrushkin opened this issue 4 years ago • 4 comments

Forum https://forum.babylonjs.com/t/vr-and-lens-flares/17665

Repro

  • PG: https://playground.babylonjs.com/#ZEB7H6#28:
  • Expected result: Lens flares was attached on each rig cameras in VR:
  • Current result: Lens flares was attached only at one rig camera

Screenshots https://aws1.discourse-cdn.com/business7/uploads/babylonjs/optimized/2X/0/0edfcc03e06a676912a81bd3fa3fe84ec97e5d51_2_657x500.jpeg

Device Oculus Quest 2

SimonTrushkin avatar Jan 21 '21 12:01 SimonTrushkin

According to my tests (and the attached image) - lens flare was added to both cameras.

This is not a bug, but the right behavior according to the current implementation. The problem is that each camera has a different position and rotation, so the lens flare is positioned incorrectly when viewed in a headset (each eye sees something else, it feels very odd). The camera that should be used to calculate the lens flare's positions is the xr camera and not the rig camera. The rig camera should only render.

RaananW avatar Jan 21 '21 13:01 RaananW

@RaananW Yes, I'm sorry, I put it wrong, flares really added to both cameras but attached to only one (on second camera flares are rendered like at first camera how i understand).

SimonTrushkin avatar Jan 21 '21 14:01 SimonTrushkin

This feature, together with others like post processing (god rays is a good example) require the projection layer of the layer API to work correctly - #10588 . Once integrated this issue will be dealt with

RaananW avatar Sep 15 '21 11:09 RaananW

This issue has been automatically staled because it has been inactive for more than 14 days. Please update to "unstale".

github-actions[bot] avatar Mar 28 '24 00:03 github-actions[bot]