Wasm with three js web app#814
Conversation
a394379 to
81ad7e0
Compare
aa46459 to
c767a65
Compare
|
Wow, nice what can come out from relaxing hobby work 🤩 Yes, I can confirm, it works perfectly according to your instructions in Chrome on Windows. For our understanding, can you super-briefly explain the flow wrt graphics. E.g: How is graphics elements (e.g. road surface, roadmarkings, road objects) created? Can the engine reuse .osgb files? |
|
Here a short architecture summary:
My suggested plan for moving forward, of course open for different suggestions:
|
|
@eknabe Complementary to the architectural summary above, here is an example scenario using .glb assets that you should be able to load in the web app to see the difference between the procedural and the glTF based rendering: |
a839ab1 to
50c4f86
Compare
|
Ok. I think the procedural creation of road surface, markings and various object types is an important part of esmini functionality, yet optional. The portability* and off-screen rendering capabilities provided by OSG are core values, I think (although for full-stack setups typically OSG viewer is replaced by something fancier). So my initial thought is that OSG will stay as the core scenegraph engine for some time, at least until we have/see another solution covering same capabilities and bringing additional value. As a compromise strategy, I could see a middle ground approach where a second rendering engine could re-use the low level graphics from OSG scenegraph. E.g. via OSG lib reading back the created geometries. In such setup there would be no need for two separate 3D content generators, which otherwise I think will be hard to maintain (keeping exact same output in esmini standalone and web. E.g. we don't want the different viewer to show different output, at least not in terms of lacking features). But let us review further, maybe see how the procedural generator in your branch handles various OpenDRIVE content. And we can discuss further from there. We like to keep all doors open, even replacing OSG with something else (still portable and supporting headless/off-screen rendering).
|
|
Is there any documentation on how to build the desktop app for modern MacOS, i.e. M processor family with ARM architecture? Maybe your known users are still on Intel Macs? If there is something documented please provide a link. I would like to avoid going off-topic though in this PR, I can open a separate issue for this, I think there already is one but for Linux not for MacOS: #660 That being said, here my comments on your strategic considerations:
I am next going to add the OSI like visualization part that can be activated as an overlay like on the desktop app to be more feature complete. Please also give me a small list of missing and blocking must have features if there is anything you have in mind. |
|
esmini builds are universal and hence runs on both Apple Silicon and Intel based systems. You can grab from release. Or build yourself. For details see CI build script But essentially something like this should work |
|
We do not (or never did) intend or aim to port any OSG code to web. I just want to set the expectations right. Although I really appreciate the initiative I also realize that our resources are limited. We'll not be able to prioritize maintaining a web solution unless all core parts are common. Regarding strategy, there are some various ideas. But it will all depend on sharp need and use cases. So from my point, it's too early to engage in deeper (although fun) discussions. Maybe your POC would be better off in a separate repo, more focus and it would be more decoupled from esmini - expectations on visual output similarities as well. On the other hand, I can also consider adding it to esmini main repo. But that needs to be a mutual understanding that it doesn't come with maintenance commitment. |
|
For the review, I tried add/replace scenario. At least OpenDRIVE failed, original is sticky. Is it expected? Or how do you replace it? |
|
Sidenote: worked for me. |
eed5c70 to
957007e
Compare
|
I pushed an update, here is the latest version with overlay rendering:
I did not quite get this question, can you describe your issue a bit more? The basic idea is that there is one (maybe later multiple) "baked in" example scenario which gets loaded at the beginning when the website is opened so people can instantly play with it. Similar to odrviewer.io The .xodr and .xosc files for that are just hosted on the same webserver as the application code. Then if desired, the user should press the "Load scenario directory" button to load one of his own scenarios from his local filesystem. Remember this final step is not supported in Firefox or Safari at the moment, try with Chrome or Edge for example. Regarding maintaining the code base I really don't have much expectations at all. I think though, even or especially on a best effort basis it is much easier to maintain it in the same repo, exactly like you have been doing for the JS lib until now. For releasing, I imagine something like with CARLA simulator, they create a new release on a best effort basis when they have time between Christmas and New Year's Eve or something like that. I would maybe permanently host my own private version on Github pages to push to a Github pages page but I feel that would be a bit of an "unfriendly fork" and I would only consider doing this if you would absolutely not want to have it under one of your repos @eknabe / @eknabevcc and you would give me green light for it. Honestly though, I would prefer to not run my own repo and rather contribute to one centralized version from time to time. You know like Linux kernel etc. |
957007e to
787f5fd
Compare
|
Sticky OpenDRIVE Hosting |
|
Okay cool, my suggestion then is to merge this version. I will spend some more time on it when I get time again at some point but for now there will be a first working version in that esminiJS directory which I believe is a good step forward compared to what was there before. |
|
Definitely agree this is a major step from previous state. Really good work! Now merged on dev branch. Will be merged to master by next esmini release. |
|
I'm not sure if this is the right place to say it, but I wanted to leave a quick thank you here. I've been building drawtonomy, and I was able to integrate the esmini-WASM build from this PR into it! acc-scenario-play-demo.mov |
|
@kosuke55 very nice to hear, thank you for the testamony! |
|
Just the most recent build for reference: |
|
@johschmitz Nice! Does this latest build reflect the latest (committed) code (or is it based on local changes)? |
|
Should be what is merged, I just zipped the local files to be sure it is in this thread since I wasn't sure what exact state I uploaded a couple of messages above. No updates for the moment. |
@eknabe Since I was bitten bei osg on MacOS and I had this plan for a very long time (fixes #196) plus I finally found a little bit of time to work on something relaxing on the side I started to implement the web based version of esmini including visualization.
I have a first "MVP" that I will post here as a PR in order to
The idea is that it will be published via Github pages alongside the documentation (I would need your help towards that end since I don't want to maintain a fork) and everyone can then run a version of esmini in his browser without installing anything.
I looks like this:
To make the first review easier, here is a zipped version of the example build:
example.zip
Just serve it with
python3 -m http.serverfrom within the extracted directory and then open localhost:8000 in your browser. Please note that directory loading sadly only works in Chromium based browsers since Firefox still does not support directory loading in the file system access API.