postprocessing
postprocessing copied to clipboard
XR support?
Currently it seems XR is not supported, see related issue here: https://github.com/pmndrs/react-xr/issues/205
Are there plans to support XR in the future?
I am interested in this topic. I am developing various XR features in React environments and I have the same question. Any suggestion about it?
Right, postprocessing effects are currently not stereo-aware. XR support will be addressed when v7 is complete.
three.js core has long needed fixes since implementing layers. See https://github.com/mrdoob/three.js/pull/26160 which does so and implements WebXR rendering for postprocessing and three.js.
I've created a project example for a ported lens distortion. With/without the webxr three fix I get distortion for both cameras no issue with black rendering. But there is an issue showing the texture for some reason in xr. In the mixed reality simulator it shows doubled up like three's effect composer, its not rendering a texture with the emulator browser extension and polyfill and shows up distorting both cameras.
https://danrossi.github.io/three-lens-distortion/example/postprocessing.html
xr fix. https://danrossi.github.io/three-lens-distortion/example/postprocessing-xr.html
https://github.com/danrossi/three-lens-distortion/blob/main/src/glsl/lens-distortion.frag
I've updated my examples and a non video texture one shows up with no rendering and black background also with the three xr fix sadly.
https://danrossi.github.io/three-lens-distortion/example/postprocessing.html https://danrossi.github.io/three-lens-distortion/example/postprocessing-video.html
I've taken to task to migrate xr changes over to postprocessing with updated examples.
https://danrossi.github.io/three-lens-distortion/example/postprocessing.html https://danrossi.github.io/three-lens-distortion/example/postprocessing-video.html
Using these branches
https://github.com/CodyJasonBennett/three.js/tree/fix/offscreen-webxr https://github.com/danrossi/postprocessing/blob/main/src/passes/EffectPass.js#L578
It still not showing right in the webxr polyfill with overlayed cameras. But in mixed reality simulator it shows up correctly. not sure if the effect is being applied to each xr camera or the whole viewport.
The effect is applied once to the whole viewport; the render pass should contain XR transforms. You can read from pose directly if you want to apply per-eye effects to keep it to 1 draw call -- it's notable that WebXR spec allows for any number of views which some devices have 6 or 100 of. Setting renderer.xr.enabled = false will opt out of XR transforms when rendering which all effects should be doing. I've already applied the necessary changes in https://codesandbox.io/s/kgjxfb which is waiting on https://github.com/mrdoob/three.js/pull/26160.
Yes that works too. I'm sorry I don't understand how to modify the effect I made to do that so the distortion is applied to both cameras seperately. I've integrated your three changes into the tests. And updated RenderPass. I've only updated EffectPass.
https://github.com/danrossi/postprocessing/blob/main/src/passes/RenderPass.js#L322
Is those changes still needed ?
I've integrated the webxr fixes into these demos.
https://danrossi.github.io/postprocessing/public/demo/#bloom
I've rebuilt everything and integrated webxr into the manual demos in this branch. But npm isn't liking checking out your branch of three with the fixes, the module has to be copied in. There is a possible bug with webxrmanager I have to figure out. I'll work out the issue with my effect so it's applied to both webxr cameras.
https://github.com/danrossi/postprocessing/tree/webxr-render-fix
I've fully upgraded the manual and public demos with the fix merged with latest three in that branch. It seems to be working but can't get pages generated for it. fullscreen render.
Wondering what's the status.
I spent too much time on it and gave up for now. It's waiting on integrating changes in three. I couldnt get the lens distortion showing up stereo its just monoscopic.