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

Fix ScenegraphLayer asset wait #4025

Merged
merged 1 commit into from
Dec 16, 2019
Merged

Fix ScenegraphLayer asset wait #4025

merged 1 commit into from
Dec 16, 2019

Conversation

tsherif
Copy link
Contributor

@tsherif tsherif commented Dec 16, 2019

Program uniforms aren't set until the draw.

@@ -5,7 +5,7 @@ export async function waitForGLTFAssets(gltfObjects) {

gltfObjects.scenes.forEach(scene => {
scene.traverse(model => {
Object.values(model.model.program.uniforms).forEach(uniform => {
Object.values(model.model.uniforms).forEach(uniform => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shall we use getUniforms in case of future changes?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a good idea.

@tsherif tsherif merged commit 00fb54f into master Dec 16, 2019
@tsherif tsherif deleted the fix-scenegraph-layer branch December 16, 2019 20:19
tgorkin added a commit that referenced this pull request Dec 17, 2019
…gatsby-examples

* commit '515466ce583f1419d2b0199daa31f850d3627bb8': (76 commits)
  fix website build (#4031)
  Tweak to scenegraph layer fix (#4027)
  Fix s2 layer polygon generation (#4024)
  Smooth edges in scatterplot (#4021)
  pydeck: Update for new @deck.gl/json API and add additional tes… (#4020)
  Fix ScenegraphLayer asset wait (#4025)
  v8.0-beta.1 Changelog (#4022)
  Bump dependency versions in modules, examples and docs (#4015)
  v8.0.0-beta.1
  bump loaders.gl to beta.5 (#4018)
  v8.0 beta
  pydeck: Make a single bundle for use in standalone and Jupyter rendering (#4010)
  Clean up LayerManager (#4011)
  Audit assert usages (#4012)
  React: eventManager listens to all children (#4013)
  Fix plot example labels (#4014)
  Bump loaders.gl to 2.0.0-beta (#4009)
  TextLayer: support background color (#3903)
  v8.0 what's new (#4001)
  Improve createProps perf (#4007)
  ...
chrisgervang pushed a commit that referenced this pull request Jan 31, 2020
@ibgreen
Copy link
Collaborator

ibgreen commented Feb 7, 2020

Just a note: The GLTFLoader loaders.gl v2.x by default loads all assets before resolving the promise, which means that:

  • Any images referenced by the glTF are now already loaded
  • Any referenced binary buffer files are loaded
  • Any embedded base64 buffers are decoded asynchronously
  • Any embedded Draco meshes have already been decoded (asynchronously on worker threads of course).
  • Basis and compressed texture support is still experimental but will work the same way.

Thus there should not be a need for a method named waitForGLTFAssets anymore.

Implementing the "atomic" glTF loader was a major effort so it would be nice to see the rewards being reaped in places like this.

I suspect this would be a good change as there is a general sense that we want to minimize having to deal with async things when close to the WebGL layer.

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

Successfully merging this pull request may close these issues.

None yet

3 participants