-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Handle mipmaps and VRAM compression for glTF binary images #62499
Handle mipmaps and VRAM compression for glTF binary images #62499
Conversation
5f51c69
to
7ecee28
Compare
The change itself is good, but the basis universal compression is not fast enough. Will work on it or find an other approach like detect 3d. |
@fire Do you have some data on the performance problems? I think this is what we were trying to figure out when we were discussing the viability of Basis a few months ago. Is the problem with import / compression (okay) or runtime / decompression / conversion to native VRAM compression (bad, affects game loading time) Also, it would be nice if it can reuse the compressed textures if they have the same hash if I reimport the gltf |
I think we need time limits for the import. I tested using a sample non commercial licensed avatar like https://github.com/Miraikomachi/MiraikomachiVRM/blob/master/Miraikomachi.vrm and it was very slow with our vrm addon. I think we can disable uastc, and live with the worse etc1 quality for a speedup. |
6dad928
to
94b1ef8
Compare
Original use case:
|
94b1ef8
to
5efe9e0
Compare
5efe9e0
to
2903122
Compare
I think we need a better way to tell users they exported their GLTF with built-in textures and by default Godot will take no action with them (we could make it optional what to do per scene in the GLTF import options). |
We discussed avoiding creating a folder. Do filename.gltf -> filename[minus .gltf].texturename.png I'll try to provide a pull request where the GLTF2 can compress to BasisU (etc1s) and extract to the folder using the above convention. |
52b708f
to
b3e9e7e
Compare
cc86d29
to
30e379b
Compare
54c3cb4
to
dc8a8dd
Compare
@fire what remains to be done on this PR before it is ready? It would be nice for this to make it in time for 4.0 so we can support |
I believe this was blocked on ASTC support (done by one of my prs), which is blocked on ASTC import (reduz expressed interest in doing this) which is blocked on Basisu changes (easy). |
Use the image naming at the same level don't use a folder. |
I am happy with regards to usability. [ Extract (default) | Ignore and Warn | Optimize Loading Embedded as Basisu ] |
dc8a8dd
to
3962109
Compare
static const char *invalid_filename_characters = ": / \\ ? * \" | % < >"; | ||
|
||
String String::validate_filename() const { | ||
Vector<String> chars = String(invalid_filename_characters).split(" "); |
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.
Could be LocalVector
maybe.
Edit: Nevermind, I guess split()
returns Vector<String>
so you can't just assign it to a different container.
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.
The issue is .split() allocates a Vector. validate_node_name
does the same. It's called infrequently in imoprt code.
I was originally thinking of doing .replace().replace()...
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.
It can be for a follow-up PR if needed/relevant, but I guess invalid_filename_characters
could be made a static LocalVector<CharString>
with all the chars already split, so we don't need to redo this computation for what's going to always be the same every time we validate a filename.
[ Ignore and Warn | Extract Textures (default) | Optimize Loading Embedded as Basisu ] Enable compressed mip maps from Basis Universal for faster compressions. Increase the quality of Basis to avoid corruption. To keep compatibility use the first mip of the previous internal Godot format. Because texture names may have invalid filename characters, adds String::validate_filename to sanitize filenames for import pipeline use.
3962109
to
39922d7
Compare
Thanks! |
Provide three options:
[ Ignore and Warn (default) | Optimize Loading Embedded as Basisu | Extract ]
Fixes: godotengine/godot-proposals#4271
Relates: #62436
Relates: #62295
Part of the V-Sekai group. https://github.com/v-sekai