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
(WIP) glTF export: improve material export #5762
(WIP) glTF export: improve material export #5762
Conversation
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.
This is a great contribution! It's great to see the glTF exporter get some love. Hey, @marklundin, got any idea how we can better make use of the glTF exporter in the Editor? Maybe a context menu option when right clicking on entities in the Hierarchy view?
related to #5001 |
The code assumes the textures have their channels matching the glTF specification here. We should test for that (materials in PlayCanvas specify which channel is used) and only export the textures if the channels match. Ideal solution in the future would be that if the channels do not match, we build the required textures from source textures. Also, the normal map can have this format, which we should probably warn about and not export either, till we have code to convert it: engine/src/platform/graphics/constants.js Lines 1049 to 1056 in 47d1f4c
The goal here being that we can only export valid glTF and print a warning otherwise. |
Yep great point @willeastcott, would love to surface this in a more intuitive way for users. It's a great piece of functionality and adds a lot of value. I'll have a think about this. Great PR too @querielo 🔥 |
I'll fix it later when I have free time (our content is usually loaded from .glb-files). |
27fba6d
to
0859e13
Compare
Please try to avoid make this PR larger and keep it focused on the material export improvements this PR is about, as this is getting hard to review now. Follow up work is awesome, but a separate PR please. |
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.
Approving, tested and works well, well done and thanks!
This pull request improves the material export in the glTF exporter.
Please review. Thank you!