Conversation
Contributor
Author
|
Understandable if wanting to hold off landing this, but should pull out the render fixes at least! |
cdata
suggested changes
Nov 10, 2018
| // Materials aren't cloned when cloning meshes; geometry | ||
| // and materials are copied by reference. This is necessary | ||
| // for the same model to be used twice with different | ||
| // environment maps. |
| if (model) { | ||
| model.traverse(object => { | ||
| if (object.material) { | ||
| object.material = object.material.clone(); |
Contributor
There was a problem hiding this comment.
WDYT if clone let us visit each node and decide how to clone it with a callback @mrdoob ?
Could save us a double traversal, but also might be general enough for other use cases
src/three-components/ModelScene.js
Outdated
| this.applyRoomSize(); | ||
|
|
||
| // Ensure the model renders after the skysphere | ||
| this.model.traverse(obj => obj.renderOrder = 1000); |
Contributor
There was a problem hiding this comment.
Since this is guaranteed to happen, why not do it in the loader traversal where materials are cloned?
Merged
…nvironment maps (fixes #65)
This was referenced Nov 12, 2018
Closed
Closed
Contributor
Author
|
Superceded by #237 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
.hdrfiles now. Fixes Support HDR environment maps, and HDR-ify default environment map #65Added HDR support for background-image
Generated PMREM for LDR background-images
This generates radiance maps so that rough, yet metallic surfaces, do not reflect the environment directly, but a mipmapped approximation -- notice the difference with the spheres on the right
Before, with a series of metalness (1) spheres, with increasing roughness:
After:
Generated PMREM for HDR background-image
Before:
After:
Generated PMREM for default environment
Most likely less useful and probably need more improvements on the default envmap (and caching/coloring), but this is applied here as well:
Before:
After: