Can I use three_js on an OpenGL surface #139
RobertRoeb
started this conversation in
General
Replies: 2 comments 1 reply
|
Hi @RobertRoeb, I am not sure you will be able to use flutter_gl for this. I am pretty sure it also uses opengl es calls. I can make one that uses this maybe. The other thing you could do is since wx uses opengl you should just be able to get those bins and make a renderer that uses them. Just clone the three_js_angle_renderer and replace flutter_angle in on or 2 files with the opengl one you have and just make sure it has a texture or fbo to draw on. |
1 reply
|
Hi @RobertRoeb, I am glad to hear you got it working and I think that is the best approach for your project. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Hi again,
I am writing Dart binding for a C++ GUI library on Windows, macOS and Linux(GTK+) and I would like use three js in it. The library has built-in support for OpenGL, not OpenGL ES. The Dart bindings for this library do not use Flutter. Here is a link to the doc of the OpenGL window the library provides:
https://docs.wxwidgets.org/3.2/classwx_g_l_canvas.html
From what I understand, flutter_angle draws into a OpenGL ES surface which on macOS is created from a Metal surface using ANGLE. Again, the library I am using provides an OpenGL surface, not an OpenGL ES surface, so I am stuck. I see that the three_dart project (which, I think shares code with this one) is actually based on flutter_gl so the ThreeJS code has been made to work on OpenGL - in principle.
three_dart does not seem to be maintained anymore - I don't know how much difference there is in the core classes between three_js and three_dart - maybe none. Now I am wondering what to do.
There seem to be three scenarios for me (specifically on macOS):
a) Make my C++ library create a Metal surface and use that with flutter_angle. I am not the sole author of that C++ library and this might not be straight forward, but it should be possible.
b) I switch to using the unmaintained three_dart project and I would probably need to fork it. Also, I would need to remove the Flutter code, I need Dart code directly using OpenGL. I really do not want to create yet another fork of Dart ThreeJS, but it should be possible as well.
c) You integrate the flutter_gl variant into your codebase as another renderer. I am no OpenGL vs. OpenGL ES expert - they look similar to me... it probably is possible as well.
What do you suggest is the best way? Possibly yet another one.
All reactions