-
-
Notifications
You must be signed in to change notification settings - Fork 35.5k
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
MeshPhysicalMaterial: Support iridescence / thin-film materials #23869
Merged
mrdoob
merged 18 commits into
mrdoob:dev
from
PascalSchoen:feature/KHR_materials_iridescence
May 25, 2022
Merged
Changes from 2 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
4937c9e
Add iridescence parameters to Physical Material
PascalSchoen 1c70414
Add iridescence fragment shader code
PascalSchoen 838aaee
Iridescence shader integration and glTF loading
PascalSchoen 1382187
Update iridescence default values
PascalSchoen 98db4b4
Add KHR_materials_iridescence to supported extensions in GLTFLoader docu
PascalSchoen f0c5487
Enable iridescence in Editor
PascalSchoen c2acb02
Update build results
PascalSchoen 13cfd2a
Merge branch 'dev' into feature/KHR_materials_iridescence
PascalSchoen 463ef5d
Remove build files from PR
PascalSchoen 012988e
Honor iridescence parameters in program cache
PascalSchoen 519e794
Use range for iridescence thin-film thickness
PascalSchoen 0eab470
Fixed linting errors
PascalSchoen 6c5fc18
Fix always-true conditional
PascalSchoen 22542b8
Add iridescence to glTF export
PascalSchoen c3d7713
Instantiate iridescenceThicknessRange in GLTFLoader if undefined
PascalSchoen e542037
Make iridescence Fresnel consistent for IBL
PascalSchoen 6e9b44a
Rename iridescenceIOR to iridescenceIor
PascalSchoen 5c5dc1f
Rename iridescenceIor back to iridescenceIOR except for glTF extension
PascalSchoen File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
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.
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.
@PascalSchoen sorry for the churn here, but glTF's camelCase convention for acronyms like XYZ (
fooBarXyz
) is different from what we follow in three.js (fooBarXYZ
). I think for the public API of MeshPhysicalMaterial, this should remainiridescenceIOR
. Feel free to use whichever you prefer for internal code in the rest of the PR. 🙏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.
@donmccurdy I reverted the change and only kept it for the glTF extension parts. 🙂
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.
@donmccurdy You prefer using
.ior
and.iridescenceIOR
?Note, we also have the function
applyIorToRoughness()
.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 think so, yes — for example we use:
I'm comfortable with either convention but this seems to be the norm in three.js today, and (I think?) more common/idiomatic in JavaScript generally.
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.
OK, I don't have a strong feeling on this one. Maybe
applyIORToRoughness()
?There is also the option of
.refractiveIndex
instead of.ior
.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.
Slight preference for applyIORToRoughness, yes - but not as worried about internal methods.
Somehow
.ior
does not bother me, feels similar tovec.xyz
in GLSL. 🤷♂️