husker-dev / openglfx

OpenGL implementation for JavaFX
Apache License 2.0
80 stars 10 forks source link

Is it possible to support shaders? #49

Closed qq1053831109 closed 7 months ago

qq1053831109 commented 7 months ago

Is it possible to directly use the gl context of Javafx and support shaders. This allows you to create a 3D game engine based on Javafx

husker-dev commented 7 months ago

At the very beginning of my project, this was part of the GL content rendering mechanism into JavaFX. But this solution has a large number of disadvantages, because we don't know what parameters are specified when creating an OpenGL context in JavaFX. Also, we cannot specify the version and be sure of the allocated resources, such as FBO or VBO.

Therefore, a shared context mechanism was created. A new pure context is created that can share its objects with JavaFX.


Also, I don't recommend using JavaFX + openglfx to create games. You lose a lot of graphical settings, and add a lot of problems. It's better to use glfw (lwjgl) and imgui.


About shaders. You can use shaders in OpenGLCanvas. But for easier use in the UI, I have created this issue #47.

qq1053831109 commented 7 months ago

ok