-
-
Notifications
You must be signed in to change notification settings - Fork 97
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
Implement loading DDS textures at run-time #5748
Comments
This should be added in a similar manner to the |
I guess this should be reopened now |
Indeed, the PR was reverted due to issues with DDS files in the project folder being imported as image resources which prevented them from being used in their raw form. The feature in this proposal is still approved though. |
Hi. I checked carefully images loading, resources importing and resources loading in Godot. The All image formats supported by To support loading of DDS files just by I don't like to have a second method just for import stage, and I don't like erasing I think the clean way to distinguish extensions between import stage and other cases is to change the interface of I've also found that using var im = Image.load_from_file(dds_absolute_path)
var t = ImageTexture.create_from_image(im)
m.albedo_texture = t
$CSGBox3D.material = m I can do this: var t = ResourceLoader.load(dds_absolute_path)
m.albedo_texture = t
$CSGBox3D.material = m That would skip dds parsing / converting, it should be faster, so it should fit my use case better. But I still don't understand why does Documentation says that Godot can import DDS files. It can't. Godot can use DDS files. There are no import options for DDS. The files will be visible in the editor, but they aren't imported (they have no Also the documentation of So I see two solutions for now:
What do you think? |
var t = ResourceLoader.load(dds_absolute_path)
m.albedo_texture = t
$CSGBox3D.material = m I was made aware that Could someone tell how Godot SHOULD load external media files? There are |
Adding PS: It seems like |
Hi. I'm using |
Describe the project you are working on
An alternate editor for existing train simulator (not written in Godot).
Describe the problem or limitation you are having in your project
The original project is using DDS format for textures. DDS format in Godot is handled as a texture loader only (during importing assets within the editor), but my tool must work with original data files. These files are external for Godot.
Godot can't handle DDS files via
Image.load()
. The method is returingERR_FILE_UNRECOGNIZED
at runtime. DDS is handled only at import stage.Describe the feature / enhancement and how it helps to overcome the problem or limitation
The proposal is about adding
ImageLoaderDDS
class, moving DDS handling code inside it, and reusing image loader (or part of it) in texture loader.Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
Here is a prototype version of a patch (currently only for 3.x branch):
https://github.com/marcinn/godot/tree/image-loader-dds
It allows to use DDS files directly:
If this enhancement will not be used often, can it be worked around with a few lines of script?
It cannot be worked around by few lines of script. Image loading is a core of the engine.
Is there a reason why this should be core and not an add-on in the asset library?
The text was updated successfully, but these errors were encountered: