Closed qq1053831109 closed 7 months ago
I often get stuck while working on the game editor Opengl. I hope that at this point, Javafx won't get stuck to play the loaded animation
Asynchronous rendering is performed entirely on a separate thread. When the frame is ready, it asks JavaFX to display it. This operation can only affect UI performance if you are using Windows and your video card does not support NVDX_interop. There are no restrictions on frame time. When testing, I deliberately stopped the render thread for a few seconds, and it did not interfere with the main thread.
ok i am update to 4.0. it has a lot change。
PassthroughShader parallelContext resultContext?Seems a bit troublesome? Are you sure this is the best solution? Is it not possible to switch between two FBOs in one context?
private change to protected 。we need hook by extends
I'm sure this is not the best solution. But it's working for now.
Let's figure it out:
What I do:
Rendering thread steps looks like this:
JavaFX steps:
A little later I will remake this mechanism into something lighter and smaller.
ok,I haven't thought of a better plan yet
Is there a wait timeout for multithreaded rendering? If the timeout exceeds 30ms, the current frame will be discarded directly. This ensures that Javafx is running the process. The opengl thread may be loading a weight model or initializing a scene, etc. The main solution of multithreading is that getting stuck in Opengl will not cause Javafx to get stuck.