-
-
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
Textures created with ImageTexture.create_from_image
are ignoring custom provided mipmaps
#66848
Comments
ImageTexture.create_from_image
have no mipmaps, when the passed image has mipmapsImageTexture.create_from_image
are ignoring custom provided mipmaps
Custom mipmaps should work as I use some in my project. It looks like the error is here: var im = Image.new()
im.create_from_data(size_x, size_y, true, Image.FORMAT_RGB8, pixels) That probably should be: var im = Image.create_from_data(size_x, size_y, true, Image.FORMAT_RGB8, pixels) as |
Fixing the static call to Updated project: Note, I included a randomization of the R component to show that mipmaps are cycling, because Godot is generating mipmaps, just not using those I provide. |
Interesting. I can actually see some very subtle mipmap noise animation in that updated project. But try changing to Compatibility renderer and things start to work somewhat. Maybe a bug somewhere in Vulkan renderer? Also, changing:
|
Could be that some of these godot/servers/rendering/renderer_rd/storage_rd/texture_storage.cpp Lines 1468 to 1481 in 1c1524a
|
This is
|
Godot version
Godot 4 beta2
System information
Windows 10 64 bits NVIDIA GeForce GTX 1060
Issue description
I created an
Image
from code, integrating custom mipmaps. The image is successfully created, however when I use it to create anImageTexture
, the resulting texture appears to have no mipmaps.Steps to reproduce
Minimal reproduction project
ImageMipmaps.zip
In this project, every mip is a different random color. The expected result is a cube flickering with multiple colors. However only the first color shows up.
I'm not sure yet if I've done a mistake somewhere, because the way to create custom mipmaps is not documented, mipmaps aren't shown in editor inspector, and currently the remote inspector doesn't seem to work well enough to show remote textures.
After giving mipmaps to
icon.png
and testing this:The result appears to have mipmaps. So I'm quite confused what I could have possibly missed.
Maybe
Image
isn't properly initializing? Maybe mipmaps I provide are completely ignored?After more tests (adding noise to mip colors) it seems the latter is happening...
ImageTexture
finds that there are mipmaps, but ignores them and makes its own.The text was updated successfully, but these errors were encountered: