Conversation
src/esp/bindings_js/index.js
Outdated
| const navmesh = scene.substr(0, scene.lastIndexOf(".")) + ".navmesh"; | ||
| FS.createPreloadedFile("/", navmesh, navmesh, true, false); | ||
| if (config.semantic === "mp3d") { | ||
| const house = scene.substr(0, scene.lastIndexOf(".")) + ".house"; |
There was a problem hiding this comment.
Convert extension replacement code and preload into a function now?
| @@ -5,17 +5,25 @@ import VRDemo from "./modules/vr_demo"; | |||
| import "./bindings.css"; | |||
|
|
|||
| Module.preRun.push(() => { | |||
There was a problem hiding this comment.
At this point, it will be better to move this to its own class which has functions like preloadMp3d etc.
src/esp/bindings_js/index.js
Outdated
| Module.preRun.push(() => { | ||
| let scene = "skokloster-castle.glb"; | ||
| let config = {}; | ||
| config.scene = "skokloster-castle.glb"; |
There was a problem hiding this comment.
Also, use defaults.js file here to export and load defaults (forgot in last PR).
| FS.createPreloadedFile("/", house, house, true, false); | ||
| const semantic = scene.substr(0, scene.lastIndexOf(".")) + "_semantic.ply"; | ||
| FS.createPreloadedFile("/", semantic, semantic, true, false); | ||
| } |
There was a problem hiding this comment.
Just checking we're all still on the same page -- once I'm done with the filesystem abstraction APIs (mosra/corrade#39), everything that's added here and in #239 could be moved back to C++, right?
Or, saying it differently -- what's done here is delaying the app startup (execution of main() is waiting on those files being loaded). If the same would be done via emscripten_async_wget*() APIs from C++ (which is what the filesystem abstraction will ... abstract), the loading could be done asynchronously, with a visual progress feedback directly in the app.
I guess it boils down to how much of this we want to do in pure JS and how much in C++ (and you know what I personally prefer :)).
There was a problem hiding this comment.
I think we are on the same page. I am looking forward to deleting this code once (mosra/corrade#39) lands. I'd much rather just use the C++ filesystem API then have to preload files into the virtual filesystem. This is definitely a temporary hack.
My earlier change where I allowed specifying the scene broke semantic mesh support. Adding back semantic mesh support as a URL parameter.
Add DD-PPO to habitat-baselines
My earlier change where I allowed specifying the scene broke
semantic mesh support. Adding back semantic mesh support as
a URL parameter.
Motivation and Context
Get semantic mesh working again with WebGL port.
How Has This Been Tested
Tested via http://0.0.0.0:8000/esp/bindings_js/bindings.html?scene=17DRP5sb8fy.glb&semantic=mp3d
Types of changes
Checklist