-
-
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
[3.x] Implement loading DDS textures at run-time (reverted) #69101
[3.x] Implement loading DDS textures at run-time (reverted) #69101
Conversation
9cf61d2
to
7670f68
Compare
7670f68
to
39b3f15
Compare
core/image.cpp
Outdated
@@ -3300,6 +3302,14 @@ Error Image::load_bmp_from_buffer(const PoolVector<uint8_t> &p_array) { | |||
return _load_from_buffer(p_array, _bmp_mem_loader_func); | |||
} | |||
|
|||
Error Image::load_dds_from_buffer(const PoolVector<uint8_t> &p_array) { | |||
ERR_FAIL_NULL_V_MSG( | |||
_bmp_mem_loader_func, |
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.
Should this be _dds_mem_loader_func
?
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.
thanks, fixed
This looks great to me, would be useful from a reviewing point of view if you can confirm that the block moved between the files is unchanged so we only have to review the "glue" code. |
39b3f15
to
749b808
Compare
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.
I think this is fine (barring the copying right notices for static checks). It seems to copy the established techniques from the other image loaders, and the actual DDS loading is unchanged.
I've been testing this out with some DDS files, and noticed a couple of problems with the DDS loader (nothing to do with this PR):
- It can't handle incomplete mipmap chains, which do occur in the wild (I may be able to PR to fix this later as I have the fix working locally)
- It can't handle cubemaps. This would be nice to handle, but the
image->load()
system currently assumes one image for one load and might require some alternative system for loading multiple images in one go (Image
doesn't seem to have support for layers as far as I saw).
749b808
to
22468ea
Compare
Amended myself to fix style issues. |
Thanks. To not to forget, would you do similar changes for #69085, which is shifted to 4.x for now? |
Ah right, I missed that this was backporting a change which hasn't been merged in I'd probably wait for the |
Thanks! |
Should this be reverted? See #81126 |
For the time being yes. Edit: Done with 54738d3. |
I am not able to insert any DDS ( converted by Converseen), the file exists in the project, but not able to display itself in any Sprite or TextureRect. |
We have hundreds of DDS files, both in GD3 and GD4. What happens when you double click the DDS file in the file panel? It should load in the inspector and tell you the format, like this. What do you see? I convert with intel's photoshop dds plugin, nvdia's texture tools, and the gimp. |
yes, i could open them in gimp again. in Godot 3.5 and 3.6, it appears just as a red X |
This is a 3.x backport of godotengine/godot-proposals#5748.
PR for master branch (4.x) is here: /pull/69085
Adds:
The DDS loader implementation is moved from texture loader to image loader.