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

Any plans to support active 3D Stereo rendering? #24

Open
MikeD89 opened this issue Apr 21, 2020 · 3 comments
Open

Any plans to support active 3D Stereo rendering? #24

MikeD89 opened this issue Apr 21, 2020 · 3 comments
Assignees

Comments

@MikeD89
Copy link

MikeD89 commented Apr 21, 2020

Are there any plans to support OpenGL quad-buffered, active stereo rendering?

@redrezo
Copy link
Member

redrezo commented Apr 23, 2020

drift focuses on getting an OpenGL texture into JavaFX. I'm not sure about what is needed for "quad-buffered active sterio rendering" but i think you would need a high frame rate for it. The displaying of the final image is done by the javafx quantum renderer which which limits the framerate in some ways (although there are ways to increase it like -Djavafx.animation.fullspeed=true)

for quad buffering, in the current version you could acquire 4 render textures and present them whenever you want, however this is not fully tested since it is mostly used to acquire one texture and present it right after rendering to it.

also the next version will have a swapchain mechanism where you can specify the size of your swapchain

@MikeD89
Copy link
Author

MikeD89 commented Apr 23, 2020

Quad buffered rendering is more straightforward than it sounds. If you disregard the camera positioning, at its core its essentially about rendering twice - once into GL_BACK_LEFT, and once into GL_BACK_RIGHT, before swapping the buffers as normal for Double Buffering.

https://www.khronos.org/opengl/wiki/Default_Framebuffer#Color_buffers

I can definitely read multiple render textures, thats no issue at all. My trouble is finding a way to present them using hardware based stereo rendering (NVIDIA 3D Vision in my case). I'm not sure if this is possible at all in JavaFX.

Fortunately in my application I can currently achieve the necessary framerate for stereo, using LWJGL 2.9.3 and an AWT/Swing UI implementation. I would be looking in the future to move to LWJGL 3 and JavaFX, using DriftFX to connect the two worlds together.

@redrezo
Copy link
Member

redrezo commented Apr 24, 2020

JavaFX renders its scene graph with its quantum renderer to a single os surface, the composition of our texture and the rest of the scene happens in there. We just "smuggle" our texture into JavaFX. I think it does not support quad buffered rendering - but to make sure you can have a look at its sources.

I think you need to do it the other way around if you want to have a javafx ui - let javafx render into a texture and blit that above your OpenGL scene. Drift only supports OpenGL -> JavaFx. But this reverse mode would be a nice feature for DriftFX.

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

2 participants