-
Notifications
You must be signed in to change notification settings - Fork 115
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
Moves responsibility of checking texture compatibility to developer. #295
Conversation
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 for putting this in another branch. This fixes the crashing problem. This issue remains:
- When inserting a non-DXT5/RGBA8 image, then adding a subsequent texture, the texturing breaks when the new texture slot is created because the system generates a texture with DXT5/RGBA w/ mipmaps. The new texture already matches the previous texture size. It also needs to match the format.
It also generates these messages, but the cause is above
servers/rendering/renderer_rd/storage_rd/texture_storage.cpp:884 - Condition "p_layers[i]->get_format() != valid_format" is true.
Attempting to use an uninitialized RID
I did some investigation. The actual cause is:
|
We want it to generate a checkerbox texture when creating a new texture slot so that the array works. It just needs to match the format of anything that is already there. Or DXT5 if nothing. Change the format here, and in the similar section for the normal map: https://github.com/TokisanGames/Terrain3D/blob/main/src/terrain_3d_texture_list.cpp#L109-L113 |
Thanks for clarifying. By "the system generates" I thought Godot did that. Looks like there is not a straightforward way to convert an image to a specified format. One will have to deal with |
This only occurs in the editor, so that ticket is not a concern. If they have a rare compressed texture that godot can't create, then they'll get an error and a broken display until they drop in a new texture, which is acceptable since it will happen in a small subset of rare textures people will only use <1% of the time. |
Updated the PR after a lot more testing. Thanks! |
Redoing #294. When setting a "New ImageTexture", a valid image of FORMAT_MAX is created. Now logs an error "Expects an actual texture file. See documentation for format suggestions."