-
-
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
Revert "Implement loading DDS textures at run-time" #81126
Conversation
This reverts commit 34ab1c8.
Source issue TokisanGames/Terrain3D#190 |
I did quick test and it looks that disabling registration of "dds" extension in ImageLoaderDDS solves the issue, and still gives a possibility of loading DDS at runtime. It would be nice if this little patch can be applied instead of reverting whole PR. Maybe this could be checked by @TokisanGames?
The problem with import system is more complex and related to the core of Godot Editor. I tried to change implementation of ResourceImageDDS by disabling extensions and types, but only removing extension in ImageLoaderDDS forces editor to keep dds files untouched. |
I commented out the one line and Terrain3D loads up as it did before in 4.1.1 with textures untouched, no import files, the Import tab blank and disabled, and no errors. Didn't/Can't try export (w/o the export files). I then ran the demo scene with this in ready. The file is 1024x1024, 10 mipmaps
There are no code errors in the editor. But upon running the terrain3d demo, the editor stops on an error, |
@TokisanGames Thanks. |
Thanks! |
Should #69101 also be reverted? |
Would not a viable solution to godotengine/godot-proposals#5748 trying to use the ImageLoader first have been |
This reverts commit 34ab1c8.
Reverts: #69085
It turns out that by registering the load function with
ImageLoader
the import system would automatically detect .dds files as images that need to be imported. This has 2 negative side-effects:DDS files should not be imported like other textures.
The root of the issue is how we detect resources at import time. When loading an image at run time, we run through all the loaders registered with ImageLoader. If the file extension matches one of the loaders, then we call that loader to load the file.
At import time, we loop through all files in the project, and check them against the support extensions of all loader types (ImageLoader, ResourceLoader, etc.), which each loop through all of their registered loaders. This is used to a create a map of what resources should be imported and by which loader etc. in current master .dds is registered with ResourceLoader and ImageLoader. But for some reason ImageLoader seems to take precedence and the file is treated like an image.
If we want to support loading dds files at runtime, then we need to figure out a way to exclude them during import, but keep them registered with ImageLoader.
If users ran projects with .dds files after #69085 was merged. Even after this PR, the .import files will remain in the project, but they will be ignored and the only import option will be "keep file (no import)"
CC @TokisanGames @marcinn1