model-viewer icon indicating copy to clipboard operation
model-viewer copied to clipboard

WebXR Postprocessing

Open Beilinson opened this issue 2 years ago • 6 comments

          Thanks @elalish

I did checks on https://modelviewer.dev/examples/postprocessing/ Is it possible to have the bloom effect working on AR viewer as well like it’s the case now for 3D viewer please?

Thank you

55114183-4B09-45F8-A30A-AC66AC499042

Best

Originally posted by @zelghrabi-edu in https://github.com/google/model-viewer/issues/3948#issuecomment-1523004064

Beilinson avatar Apr 28 '23 15:04 Beilinson

  1. For the native WebXRRenderer for three.js, it requires some tinkering with the renderers that isn't fully supported yet by pmndrs/postprocesssing, which maybe shouldn't enter model-viewer as it is meant to be a fully stable API.
  2. On most mobile devices <model-viewer> actually defaults to the native AR viewer, meaning <model-viewer-effects> actually has no control over the rendering. On IOS for example, this is because WebXR is mostly unsupported.

More on WebXR iOS support:

It is currently in an "experimental state", which is accessible through: Settings -> Safari -> Advanced -> Experimental Features and all the way at the bottom:

image

It is disabled by default, and I am not sure how well it will work in the case of model-viewer, though it might be interesting to test.

Additionally, apple has the RealityKit API for AR experiences on IOS, which does allow for custom postprocessing, however this is only for c/swift IOS apps, while browsers are limited to quick look which is not customizable.

Beilinson avatar Apr 28 '23 15:04 Beilinson

Indeed, this would be an Android-only feature for now, since iOS doesn't yet support WebXR. We don't actually use three's WebXRRenderer currently, so hopefully it's a bit simpler.

elalish avatar Apr 28 '23 15:04 elalish

Hello, Thanks guys for your answers It doesn't work for Android as well

image

zelghrabi-edu avatar Apr 28 '23 18:04 zelghrabi-edu

That's actually SceneViewer on Android, which also can't support this, since like QuickLook, it's a separate app. Only WebXR mode can be made to work (though I don't think it does yet).

elalish avatar Apr 28 '23 19:04 elalish

@elalish Hello. I'm looking for applying some custom postprocessing effects on AR mode (webxr). Could you please give me a hint on how I may achieve this goal?

mahdavifar2002 avatar Aug 19 '23 10:08 mahdavifar2002

It's hasn't quite been implemented yet, but I don't think it should be too hard. Basically we need a similar update to the render loop in ARRenderer.ts as we now have in Renderer.ts. @Beilinson would be good to ask for review, and I'll certainly help with any PR as well.

elalish avatar Aug 21 '23 15:08 elalish