-
Notifications
You must be signed in to change notification settings - Fork 434
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
[WIP] Test emscripten build for WebGL deployment #53
Conversation
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.
You're moving fast! :) Added a bunch of notes that might be (hopefully) helpful.
@@ -160,8 +162,11 @@ GenericShader& GenericShader::bindTexture(Magnum::GL::Texture2D& texture) { | |||
|
|||
texture.bind(TextureLayer); | |||
|
|||
// TODO this is a hack and terrible! Properly set texSize for WebGL builds |
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 guess having bindTexture(Texture2D& texture, int size)
would be a solution, right? Unfortunately until ES 3.1 there's no way to query texture image sizes.
src/esp/gfx/CMakeLists.txt
Outdated
# If not WebGL build, also include offscreen render-reliant code | ||
# TODO: this should be built as well (with emscripten windowless contexts) | ||
if(NOT BUILD_WEBGL) | ||
list(APPEND gfx_SOURCES Simulator.cpp WindowlessContext.cpp) |
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.
The Magnum builtin WindowlessEglApplication
works as-is on Emscripten, but I'm not sure about your modified version -- the extension APIs most definitely aren't defined there. I can take a look at this once I get to integrating your WindowlessContext modifications back into Magnum.
e1e0ebc
to
b8a417d
Compare
If this PR will be rebased on latest master we will get proper CI testing. |
…ng for emscripten
…tead of custom defines
bee06d2
to
0a41312
Compare
-DBUILD_DATATOOL=OFF \ | ||
-DBUILD_PTEX_SUPPORT=OFF \ | ||
-DCMAKE_BUILD_TYPE=Release \ | ||
-DCMAKE_PREFIX_PATH="$EMSCRIPTEN" \ |
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.
The $EMSCRIPTEN
variable should be explicitly set to the prefix where emscripten was built otherwise it picks up the wrong compiler.
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.
Thanks @abhiskk for testing out this PR and support in my absence. Regarding, the $EMSCRIPTEN
variable: it is defined by sourcing the installed emscripten distribution's emsdk_env.sh
file so it is in general a good idea to leave that not explicitly set in the script here. Perhaps it would be good to include in the script a source /path/to/emsdk_env.sh
statement though and ask people to modify as necessary.
Motivation and Context
Preliminary testing of habitat-sim compiling through emscripten for WebGL deployment. Currently, just a "pile of hacks" to get viewer utility binary working only with pre-loaded data package containing test scenes.
Before landing will need to:
texSize
setting (see here)How Has This Been Tested
source ~/code/emsdk/emsdk_env.sh
or similar)./build_js.sh
Types of changes
Checklist