Closed qq1053831109 closed 7 months ago
In theory this is possible. I'll look into ways to implement it soon.
I did some tests. They show that rendering on another thread is not as efficient as it might seem. Perhaps it's a matter of synchronizing internal data in OpenGL.
@qq1053831109 Why do you need this functionality?
You can learn Javafx. The logical thread is n+1 frames.Efficient synchronization mechanism requires excellent design。My opengl panel is for rendering games. Each frame consumes 10ms
And I need to render multiple opengl panels in one Javafx, such as batch viewing models. I don't want them to share a thread for rendering. This can lead to delays. The client software has a low tolerance for latency.
@qq1053831109 I've added multi-thread support to the d3d pipeline (i.e. Windows only). Also, for now it works only with lwjgl.
You can build openglfx by yourself and test performance in your case.
./gradlew :compileJars
./build/libs
to your projectval canvas = OpenGLCanvas.create(LWJGL_MODULE, multiThread = true)
Need ES2 pipeline, can double buffering be considered? In situations where rendering time is high, synchronization time is less important
Added es2 support. Tomorrow I'll try to do it for sw. There are currently some artifacts when resizing the Canvas. I'll try to solve them soon.
Added sw support. There is a new interop for macOS is coming, so the issue is not closed.
Added async IOSurface interop. I will close this issue.
Opengl latency can affect fx latency. Can they run on different threads? And provide a synchronization mechanism after rendering is completed