Skip to content
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

WebASM build of USD #1492

Open
marsupial opened this issue Apr 15, 2021 · 6 comments
Open

WebASM build of USD #1492

marsupial opened this issue Apr 15, 2021 · 6 comments

Comments

@marsupial
Copy link
Contributor

Hello!
In the USD-WG both @philsawicki and I have demoed pieces of getting USD working in a web-browser, and are pretty interested in getting this running. There are still some caveats, but wanted an issue to track some smaller PRs that can help building with emscripten.

Ideally embedding a demo in this issue would be possible, or even a preview via GitHub Pages, but not yet due to the lack of CORS headers.

If you checkout the branch and run a local server.py though, you can load and interact with a USD file. Rendering is using a Hydra delegate for Filament, which has a WebGL backend (but also works on the desktop in Houdini, Maya).

I've tried separating out the more trivial commits that should be non controversial (27f3d17 or aa7f517).
There's also a group devoted to compiling cleanly on clang to not obscure actual both for emscripten, but also Android and iOS.
And some possibly more controversial things (like 0b7bcf1, which is generally useful for sandboxed environments where PXR_PLUGINPATH_NAME can't necessarily be setup before the library is loaded).

I'll start doing some PRs, but feel free to cherry-pick anything that looks appealing, thanks!

HdFilament.mp4
@mistafunk
Copy link

Such a cool timing - we are just investigating the same... 👍

@marsupial
Copy link
Contributor Author

marsupial commented Apr 15, 2021

A lot of people are!
The renderer isn't included yet for re-building, but USD can be built pretty easily with a build script.

Getting bindings [that closely match Python] is probably the biggest need right now.

@jilliene
Copy link

Filed as internal issue #USD-6657

@donmccurdy
Copy link

donmccurdy commented Apr 19, 2021

It'll take a while to load, but you can get a live demo from this branch using the GitHack CDN. The link below is currently working for me in Chrome, but failing in Firefox with errors about SharedArrayBuffer. This link will update automatically as the underlying git branch changes:

https://raw.githack.com/marsupial/USD/HdFilament/extras/imaging/examples/hdFilament/index.html

@marsupial
Copy link
Contributor Author

@donmccurdy, thanks for the info! The SharedArrayBuffer error in Firefox is because two CORS headers (Cross-Origin-Opener-Policy, Cross-Origin-Embedder-Policy) not being served AFAIK.

As mentioned in the threejs issue, the file size is 35MB, but a little over 21MB of that is due to the embedded usdz files (and most of that is because of the png-textures).

The next step is to get the Filament delegate source up so the whole thing can build properly and work without the embedded content. I and a few others are meeting monthly to try and push this further if you're interested in helping.

@jeffscottward
Copy link

A lot of people are!
The renderer isn't included yet for re-building, but USD can be built pretty easily with a build script.

Getting bindings [that closely match Python] is probably the biggest need right now.

i built it, what do now?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants