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

Scene refactor #37

Merged
merged 9 commits into from
Jul 17, 2017
Merged

Scene refactor #37

merged 9 commits into from
Jul 17, 2017

Conversation

emackey
Copy link
Member

@emackey emackey commented Jul 12, 2017

This is a fairly large set of changes, but offers a number of key improvements.

  • Two separate classes, Scene and Mesh both shared scene.js. Mesh was the larger class by far, and has been split off into its own mesh.js file.
  • A loading spinner has been added during model load.
  • The model will not attempt to render (or remove the new spinner) before all textures from all meshes are loaded.
  • The camera is reset between model loads.
  • Samplers are not stepped on by multiple textured meshes.
  • TextureSettingsTest added (but not fully supported yet).
  • jQuery relocated into a folder with other 3rd-party libraries. (Can't remove, due to dependency from dat.gui).

There's still work to do. This could be part of this PR or could be made as later PRs after this is merged.

  • Texture settings CLAMP_TO_EDGE and MIRROR_REPEAT are not yet supported.
  • Several functions in mesh.js are still global in scope and could be better belonging to either Mesh or Scene.

/cc @moneimne @snagy @abwood

(Note: Shader/GLSL code is un-touched here, only JavaScript changes.)

mesh.js Outdated
return image;
}

function loadImages(imageInfos, gl, mesh) {
Copy link
Contributor

Choose a reason for hiding this comment

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

This should probably be moved into the Mesh class, along with loadImage

mesh.js Outdated
}
}

function applyState(gl, program, globalState, localState) {
Copy link
Contributor

@abwood abwood Jul 13, 2017

Choose a reason for hiding this comment

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

Unless we want to add a context.js (not suggesting this), I'd just move applyState and disableState into the Mesh class too.

@moneimne
Copy link
Contributor

Looks really good to me!

@emackey
Copy link
Member Author

emackey commented Jul 16, 2017

@abwood's comments have been addressed.

@snagy
Copy link
Contributor

snagy commented Jul 17, 2017

Looks good to me. Thanks!

@snagy snagy merged commit 6fdd3e8 into master Jul 17, 2017
@emackey emackey deleted the scene-refactor branch July 17, 2017 17:19
emackey pushed a commit that referenced this pull request Mar 3, 2021
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.

4 participants