Is there any library that would allow me to render...
# compose-desktop
m
Is there any library that would allow me to render and display a 3D object in Compose Desktop? I'm looking for something like Filament, but Filament doesn't work on Compose Desktop to my knowledge.
s
Not out of the box afaik, but if it's just for compose-desktop, which uses awt under the hood, any awt compatible 3d library would work, you can embed that in a compose view. Can also use javafx which has a 3d lib that is quite nice for simple things and embed that in compose too.
☝️ 1
f
I'm running a stack right now that runs Compose on top of GLFW, with OpenGL 3d rendering. If you would like to know more let me know
z
@Fudge Would you know how to embed a OpenGL scene in compose without swapping out the window for GLFW?
s
@zt IDK if this answers ur question, but you could render a scene in an opengl window, take the pixel buffer at the end of every frame and paint that on a compose canvas. If performance is not a big concern, this could work. Definitely will take some tingling though 😛
z
I think that would work but unfortunately I would like to keep from replacing the base window. Since I do wanna use this in a library format that other developers can easily add without having to also swap out the base for an OpenGL window
m
Similar here, I only need a single 3D element in an otherwise normal Compose Desktop window with complex UI. There is lots of solutions for rendering 3D in their own window, but that doesn't help much.
s
Just stumbled upon this, might be of help: https://github.com/zakgof/korender
f
@zt Korender looks great for you guys if you are looking to build a new 3d render. If you want to use your existing openGL, have a look at the implementation - it uses SwingPanel together with AWTGLCanvas (a seperate lib) Do be aware that this approach does not allow rendering Compose components seamlessly inside the 3d render - you can see that Korender only implemented some basic GUI for it using raw OpenGL. For this reason I have opted for using a GLFW window.