Skip to content

Texture3D import not working when texture has fully opaque and (partly or fully) transparent slices #92315

@Kukuschi

Description

@Kukuschi

Tested versions

Reproducible in: 4.2.2 (stable), 4.3 dev6, 4.0, (maybe?) 3.5.3 (stable)

System information

Windows 10 - Godot Engine v4.3.dev6.official.89850d553 - https://godotengine.org OpenGL API 3.3.0 NVIDIA 551.76 - Compatibility - Using Device: NVIDIA - NVIDIA GeForce RTX 3070 Laptop GPU (tested with Forward+, Compatibility and Mobile) - Also tested on a Surface Pro 10

Issue description

Under certain conditions one cannot import Texture3Ds. One suspicion i have is, that on import Godot removes the alpha channel of textures that are fully opaque (which is quite annoying to begin with). Maybe it removes the alpha channel of the slices that are fully opaque and keeps them on the slices that have some transparency, leading to a mismatch in the format of the slices (RGB8 vs RGBA8). I made a few test textures attached to this with several different (but not all thinkable) cases. They are 512 * 512px with 8 * 8 slices. To be sure the files are not corrupted by the graphic software i made the same textures with different programs and the results were the same.

1.png: import as Texture3D working
2.png: import as Texture3D working
3.png: import as Texture3D NOT working
4.png: import as Texture3D working
5.png: import as Texture3D NOT working
6.png: import as Texture3D NOT working
7.png: import as Texture3D working

error message:
Image format mismatch
Attempting to use an uninitialized RID
servers/rendering/renderer_rd/storage_rd/texture_storage.cpp:1416 - Parameter "tex" is null.
Attempting to use an uninitialized RID
servers/rendering/renderer_rd/storage_rd/texture_storage.cpp:1416 - Parameter "tex" is null.
Attempting to use an uninitialized RID
servers/rendering/renderer_rd/storage_rd/texture_storage.cpp:767 - Parameter "t" is null.

Godot 3.5.3 error message before forced restart:
ERROR: Condition "header[0] != 'G' || header[1] != 'D' || header[2] != 'S' || header[3] != 'T'" is true. Returned: ERR_FILE_CORRUPT
at: _load_data (scene/resources/texture.cpp:476)
No error message after forced restart (but not sure if Texture3D was imported correctly.

Steps to reproduce

Start a new project, drag and drop texture into it. Go to import tab, choose Texture3D with 8 by 8 tiles, hit import button.

Minimal reproduction project (MRP)

No minimal reproduction project needed (can be done in new project). Here are the textures:
1
2
3
4
5
6
7

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions