-
-
Notifications
You must be signed in to change notification settings - Fork 35.2k
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
GLTFLoader: Make KHR_materials_unlit able to be overridden #20722
Conversation
23c6608
to
3713794
Compare
Redone the commits against the latest |
…h the plugin system
…lugins register now unshift plugins instead of push
3713794
to
6cf9e05
Compare
ping @donmccurdy @takahirox , how do you think about it? See the "Points need review" section on the description. |
Update! Thanks to #21207 I'm now able to remove Ping @donmccurdy @takahirox |
@0b5vr is this PR still something you're interested in having merged? |
Closing. Seems the change is not required anymore. |
Will close #20709
What I did
KHR_materials_unlit
with plugin system introduced in GLTFLoader plugin system, first round #19144 .getMaterialType
andextendMaterialParams
of any plugin whenKHR_materials_unlit
exists in a material.GLTFLoader.register
now registers the given plugin callback to the top of its plugin callback list instead of last.Motivation
As I mentioned in #20709, I want to load our own custom glTF material using GLTFLoader.
However, the glTF still have
KHR_materials_unlit
as a fallback, which is prioritized than any plugins registered.With these changes, I can override the behavior of
KHR_materials_unlit
.Points need review
GLTFMaterialsUnlitExtension.extendMaterialParams
, does the "Removing material params" part look good?materialType !== MeshBasicMaterial
. I don't know how I can resolve this