Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VR / Daydream supported ? #435

Open
dsanjit opened this issue Oct 29, 2018 · 19 comments
Open

VR / Daydream supported ? #435

dsanjit opened this issue Oct 29, 2018 · 19 comments
Assignees

Comments

@dsanjit
Copy link

dsanjit commented Oct 29, 2018

Would like to use Filament in a Daydream / Oculus GO / Rift project. Is stereo supported along with multiview and other optimizations ?

@romainguy
Copy link
Contributor

Stereo rendering is not currently supported. It's something we'd like to have eventually.

@romainguy romainguy added the enhancement New feature or request label Oct 29, 2018
@rawnsley
Copy link
Contributor

rawnsley commented Dec 7, 2018

@romainguy Is there anything to stop us implementing this ourselves as two View's (one for each eye) into the same Scene?

@romainguy
Copy link
Contributor

That would work unless you need a custom post process step (for foveated rendering etc.). It also wouldn't be as efficient as if the engine supported VR natively.

@rawnsley
Copy link
Contributor

@romainguy Any chance of a hint on the best approach to GoogleVR SDK integration? The lifecycle is based around GvrView, but the underlying Surface object it creates is not exposed so I'm not sure how I can create a Fragment SwapChain that targets the underlying buffers or if that's in fact what I should be doing at all.

I read that we can't just retrofit Fragment into our GLSurfaceView applications and carry on as before so I'm wondering if the same is true of libraries like GoogleVR that manage the underlying surface lifecycle internally.

@romainguy
Copy link
Contributor

Interesting, the way GrView works is not what I would have expected (and it's incompatible with Vulkan too). We'll take a look. Libraries should not manage the surface like this.

@romainguy
Copy link
Contributor

I just found a lower level that seems to be what you/we want: https://developers.google.com/vr/reference/android/com/google/vr/ndk/base/GvrLayout

@rawnsley
Copy link
Contributor

That looks promising! I will report back (and thanks again)

@rawnsley
Copy link
Contributor

I can get a trivial rendering working with GvrLayout:

gvr-triangle

Obviously this is ignoring the stereo image requirements and the lens distortion correction post-processor, which might be challenging to integrate as it appears to be OpenGL specific.

I'm going to mark this down as possible but complicated and circle back once better minds than mine have done the heavy lifting. I've got everything I need for integrating Fragment with my own VR SDK now, so I just needed to confirm that 3rd party VR SDK integration was going to be possible in the future.

@romainguy
Copy link
Contributor

Looks like we'll need to add support indeed. And it looks like it will be GL specific and not work with Vulkan :/

@oahc09
Copy link

oahc09 commented Oct 22, 2019

Stereo rendering is not currently supported. It's something we'd like to have eventually.

I'm working on using the Filament engine to vr headset like oculus quest or htc vive,find that GLSurfaceView is not supported, can you give some methods or suggestions about how to run filament engine by GLSurfaceView. Very thanks ~

@rawnsley
Copy link
Contributor

@oahc09 I haven't actually done it, but the Oculus mobile SDK appears to support integration with graphics libraries that need to own the EGL context as long as you respect various overlapping lifecycles.

@romainguy
Copy link
Contributor

@oahc09 You cannot use Filament with a GLSurfaceView as Filament needs to own the EGL context. What you'll have to do is integrate whatever VR SDK you need into Filament's backend (filament/backend in the source tree). It's something we want to do eventually.

@oahc09
Copy link

oahc09 commented Oct 23, 2019

@oahc09 You cannot use Filament with a GLSurfaceView as Filament needs to own the EGL context. What you'll have to do is integrate whatever VR SDK you need into Filament's backend (filament/backend in the source tree). It's something we want to do eventually.

Yes, I'm trying to do some integrate with vr sdk by using ndk, and change the filament engine.cpp/platformegl.cpp code, but just in exploration stage, because i'm not very familiar with the render framwork. If you have some flow charts about the render framework , can you share them? It may by very helpful to me. Thanks very much.

@dsanjit
Copy link
Author

dsanjit commented Apr 16, 2020

Any progress on VR support please? Or maybe I missed something...

@rawnsley
Copy link
Contributor

@dsanjit I don't believe there are any plans for specific VR support in Filament at the moment. I have managed to use Filament successfully with at least one VR SDK and I think the method would extend to the others. Happy to sketch out my current approach if it would help.

@oahc09
Copy link

oahc09 commented Apr 16, 2020

Any progress on VR support please? Or maybe I missed something...

You can refer to the branch : https://github.com/NibiruDev/filament_V1.4.0_Nibiru
It makes filament suppored on vr hmd。

@dsanjit
Copy link
Author

dsanjit commented Apr 16, 2020

@rawnsley Thanks! Did you use GL_OVR_multiview or similar to do multiview rendering ? If yes some details would help.

@oahc09 Thanks will check !

@rawnsley
Copy link
Contributor

@dsanjit I don't think Filament supports multiview rendering. I use two Filament Views (one for each eye) that render to texture buffers that I then submit to the VR engine for display. Thread and EGL context management is a bit painful, but possible.

One problem is that you need to wait until Filament has finished rendering before sending the frame to the VR SDK, but the only option is currently flushAndWait. This hurts efficiency and limits the frame rate, but in most VR SDKs the problem is reduced by asynchronous timewarp (which decouples the head rotation from the frames being submitted). In 6DoF headsets or scenes with a large amount of movement (independent of the head rotation) the artefacts will be worse.

@Nolram12345
Copy link

Any updates on VR support for Filament ?

@z3moon z3moon self-assigned this Jan 14, 2025
@pixelflinger pixelflinger removed the enhancement New feature or request label Jan 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants