-
-
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
GLTFLoader: Fix color space for specular map. #23630
Conversation
Thanks! I wonder how this wasn't broken before. 🤔 |
The previously automatic inline decode only worked for specific textures of built-in materials. For all others (like the |
So, |
New glTF material features (like sheen, transmission, refraction, IOR, iridescence, subsurface scattering, ...) are only added to the metal/rough PBR workflow by Khronos now and moving forward, so the spec/gloss workflow in glTF provided by With extensions like I think we could consider removing support for spec/gloss. |
Thanks @Mugen87! Yeah, Spec-Gloss is deprecated, but only for about a year now and there are lots of assets floating around with the extension because many authoring tools didn't like the idea of a lossy conversion. I would wait until there is a high quality free tool for converting Spec-Gloss GLBs to MR before we remove support. |
Not intending to rush the process, but -
The conversion is not lossy if the viewer supports the specular and IOR extensions. |
Awesome, thanks @donmccurdy! Is this part of a web GUI anywhere yet? I don't know if you want to help build out the functionality of the model-viewer editor or build your own, but either way it would be awesome. I know, I know, in our copious spare time... |
At some point I'm going to have https://gltf.report/ start doing the conversion by default (it'll need metal/rough for other reasons), but for now it can be accomplished by running this in the sidebar script tab: import { metalRough } from '@gltf-transform/functions';
await document.transform(metalRough()); |
Thanks! |
* GLTFLoader: Fix color space for specular map. * GLTFLoader: Add more missing sRGBEncoding. * Update GLTFLoader.js
Cherry-picked into the |
* GLTFLoader: Fix color space for specular map. * GLTFLoader: Add more missing sRGBEncoding. * Update GLTFLoader.js
Related issue: #23627
Description
This PR defines the color space for
specularMap
. Only relevant forKHR_materials_pbrSpecularGlossiness
.SpecGlossVsMetalRough.glb
now renders as expected.