Examples: Modularized PMREM and added webgl2_loader_gltf #16072
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Following discussions with @donmccurdy, this PR provides a fully functional version of the glTF loader example using modules from
examples/jsm
.For this purpose I needed to include the
examples/js/PMREM
utils to themodularize.js
script provided by #9562. This PR also provides.d.ts
type definitions for those utilities.Following @mrdoob advice, I named this example
webgl2_loader_gltf.html
sincewebgl2
samples already use ES6 syntax. I chose to use a coding style closer to theexamples/jsm
files though (only import needed modules fromthree.module.js
, noTHREE
prefix).I also took special care to minimize differences with the original
webgl_loader_gltf.html
, so that they can be diffed for reference purpose.I'd especially appreciate a code review on this coding style, and the provided type definitions.