Skip to content
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

Allow Base Color and Alpha Map textures to NOT be combined on export #1230

Closed
wiledal opened this issue Oct 1, 2020 · 9 comments
Closed

Comments

@wiledal
Copy link

wiledal commented Oct 1, 2020

Funnily enough, this has been requested in reverse previously: #343

Problem
Since glTF-files are often used in web applications, it is crucial to keep the filesizes low.
Having JPEG-compressed diffuse+alpha material combos is often 500%+ more size efficient than transparent pngs.

My example scene is 600kb as FBX, with separate JPEG diffuse and alpha textures.
Same scene is 4.3 MB when exported to .glb from Blender, due to the creation of transparent PNGs.

Screen Shot 2020-10-01 at 1 08 19 PM

While the combined texture can be useful, it would be great to have the option to keep the alpha channel separate from the diffuse texture in the export settings.

@scurest
Copy link
Contributor

scurest commented Oct 1, 2020

Separate base color/alpha textures are not possible in glTF.

@wiledal
Copy link
Author

wiledal commented Oct 1, 2020

I just realized this ☝️ after looking at the glTF spec. For a format that is built to be portable and web-friendly, this is an obvious disadvantage in regards to file sizes. But I don't know enough about the underlying ideas to justify my criticism.

Maybe we can use avif textures in the future, with considerably better image compression. Except, that is also not part of the spec.

@donmccurdy
Copy link
Contributor

donmccurdy commented Oct 1, 2020

There are texture formats available or upcoming in glTF that include alpha at better file sizes than PNG:

But Blender does not support these formats (yet?) so the image compression would need to be added after export.

You may also be able to improve the default compression of PNG images with something like https://squoosh.app/.

@wiledal
Copy link
Author

wiledal commented Oct 1, 2020

I considered using other image formats externally, but keeping the files self-contained is part of what makes it great.

Closing this since the topic is related to the glTF spec rather than the Blender exporter.

@metamultiverse
Copy link

Hi, is there any update on this issue since last comment?

@julienduroure
Copy link
Collaborator

Do you refer to webp & KTX / Basis? Because the first request of this ticket is not something the glTF specification allows.

About webp : Still in the TODO list, not planned for now. News will probably goes in this ticket : #1308

About KTX: Much more complicated, KTX must probably be added in Blender core first, before we can managed it in I/O. No visibility on this for now

@metamultiverse
Copy link

metamultiverse commented Nov 29, 2022 via email

@donmccurdy
Copy link
Contributor

@metamultiverse No, glTF requires alpha to be in the alpha channel of the base color texture. You're welcome to file an issue on the glTF repository (https://github.com/KhronosGroup/glTF/issues), I don't know of any open requests for the feature (or plans to add it) at the moment.

@ArturBalthazar
Copy link

The problem is when we want to use a different UV channel for the alpha texture. Bc if it's combined with base color, they are forced to use the same uv channel, which is sad and limiting... :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants