-
Notifications
You must be signed in to change notification settings - Fork 430
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[esp/bindings_js] add back support for semantic information #245
Conversation
src/esp/bindings_js/index.js
Outdated
FS.createPreloadedFile("/", scene, scene, true, false); | ||
Module.scene = scene; | ||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
@@ -5,17 +5,25 @@ import VRDemo from "./modules/vr_demo"; | |||
import "./bindings.css"; | |||
|
|||
Module.preRun.push(() => { | |||
let scene = "skokloster-castle.glb"; | |||
let config = {}; | |||
config.scene = "skokloster-castle.glb"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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