Almas Article on High Performance & Use of PixelBuffer within FXGL #1052
Unanswered
nicolasbulgarides
asked this question in
Q&A
Replies: 1 comment
-
I'm afraid there is no easy answer to this, as a lot of the answer is based on understanding what exactly causes the bottleneck. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi Almas & other Java / game dev enthusiasts.
I am experimenting with various kinds of assets and I am experiencing a performance bottleneck. The root of my game is an entity which is a pane & things are added onto that as a sort of base, which is a shift away from a full game-world, but for my use case I do not generally need physics.
How can I take an image from my assets and render it via the PixelBuffer so as to draw on open GL? I saw Almas' article linked below but in the context of particles not of just drawing an image lets say of a cloud, for example. I see that you have to have a gpu that is Open CL compatible, and mine is, but I don't know if the gpu driver alone is sufficient or if I have to download a stand alone program which has to be on the host machine. Aside from the yes / no on an additional program, how exactly would I pass in an image e.g "clouds.jpg" into a PixelBuffer so as to then add as a node onto the scene but taking advantage of GPU? I saw that this may or may not involve some "asynch" / synchronization coding /challenges with multithreading, and I am curious to see if anyone has any knowledge on multithreading within FXGL. My first encounter with threads is in another discussion posted and is that the WebView class for rendering a website gets an automatic exception due to the FXGL thread not being the primary FX thread
https://foojay.io/today/high-performance-rendering-in-javafx/#:~:text=The%20PixelBuffer%20API%20has%20been%20introduced%20in%20JavaFX,which%20is%20a%20significant%20limitation%20of%20this%20approach.
Also: I have found this code of yours Almas, and it has comments, but I am trying to work my way through it to understand it and sort of need to see how a pre-existing image can be incorporated as that is my use case. https://github.com/AlmasB/FXGL-FastRender/blob/main/src/main/java/com/almasb/fastrendertest/PixelBufferGPUTestApp.java
Beta Was this translation helpful? Give feedback.
All reactions