Hi there and thanks for creating this project,
I am using three_js dart to navigate through a city model that is made of a few thousand triangles and few hundred textures projected unto those triangles (the walls, roofs etc). I am using (and the author of) wxDart, which has two variants, one using Flutter as the backend and one using wxWidgets as the backend (that is relevant for the issue). wxDart has a WxGLContext class for both variants and I have written a ThreeJS renderer to link wxDart's WxGLContext to WxGLCanvas to ThreeJS Dart. This renderer is here https://pub.dev/packages/three_js_wx_renderer
Basically everything works now, but very frequently, the system lags and I get something like 1 frame per second. Currently, I do nothing but changing the camera position. I have originally written the same code in Javascript using ThreeJS r146. It has the same model using the exact same data and additionally has dozens of animated models and flying and walking around. This runs with no lag on a Mac Mini m4 in Chrome. Now running the simpler code (no models, just camera change) with either the Flutter or the Native backend, I get the mentioned lag. This cannot be due to the Flutter Texture widget or the framebuffer code as it happens in wxDart Native using pure OpenGL as well (macOS OpenGL 4.1). I considered that the Dart garbage collector was doing weird stuff, but when only changing the camera position and then calling render() I am not sure if many Dart objects are created at all.
I don't know which version of ThreeJS this Dart port used (as the basis for the fork, basically) but I am not if that is even relevant. So currently, I have no clue what the issue is and would appreciate any suggestions.
Hi there and thanks for creating this project,
I am using three_js dart to navigate through a city model that is made of a few thousand triangles and few hundred textures projected unto those triangles (the walls, roofs etc). I am using (and the author of) wxDart, which has two variants, one using Flutter as the backend and one using wxWidgets as the backend (that is relevant for the issue). wxDart has a WxGLContext class for both variants and I have written a ThreeJS renderer to link wxDart's WxGLContext to WxGLCanvas to ThreeJS Dart. This renderer is here https://pub.dev/packages/three_js_wx_renderer
Basically everything works now, but very frequently, the system lags and I get something like 1 frame per second. Currently, I do nothing but changing the camera position. I have originally written the same code in Javascript using ThreeJS r146. It has the same model using the exact same data and additionally has dozens of animated models and flying and walking around. This runs with no lag on a Mac Mini m4 in Chrome. Now running the simpler code (no models, just camera change) with either the Flutter or the Native backend, I get the mentioned lag. This cannot be due to the Flutter Texture widget or the framebuffer code as it happens in wxDart Native using pure OpenGL as well (macOS OpenGL 4.1). I considered that the Dart garbage collector was doing weird stuff, but when only changing the camera position and then calling render() I am not sure if many Dart objects are created at all.
I don't know which version of ThreeJS this Dart port used (as the basis for the fork, basically) but I am not if that is even relevant. So currently, I have no clue what the issue is and would appreciate any suggestions.