godot icon indicating copy to clipboard operation
godot copied to clipboard

RGBH .exr imported as Texture3D with Lossless compression gets converted to RGB8

Open stoofin opened this issue 1 year ago • 0 comments

Tested versions

4.3

System information

Godot v4.3.stable - Ubuntu 24.04.1 LTS 24.04 - Wayland - Vulkan (Forward+) - dedicated AMD Radeon RX 6600 (RADV NAVI23) - Intel(R) Core(TM) i7-6700 CPU @ 3.40GHz (8 Threads)

Issue description

My 16-bit floating point 3d textures were getting their values normalized into [0,1]. I don't know if it's supposed to be like this, but it was very confusing.

Steps to reproduce

An image generated by this script:

var image: Image = Image.create_empty(1, 1, false, Image.FORMAT_RGBH)
image.set_pixel(0, 0, Color(-1.0, 0.5, 43.75))
image.save_exr("res://test_texture.exr")

when imported as a Texture3D with Lossless compression, contains the pixel (0, 0.498, 1, 1) but if imported as a Texture2D with Lossless compression it has the original pixel

res://2d_lossless.exr            Format 14
res://2d_lossless.exr            Pixel (-1, 0.5, 43.75, 1)
res://2d_vram_uncompressed.exr   Format 14
res://2d_vram_uncompressed.exr   Pixel (-1, 0.5, 43.75, 1)
res://3d_lossless.exr            Format 4
res://3d_lossless.exr            Pixel (0, 0.498, 1, 1)
res://3d_vram_uncompressed.exr   Format 14
res://3d_vram_uncompressed.exr   Pixel (-1, 0.5, 43.75, 1)

Minimal reproduction project (MRP)

exr-image-float.zip

stoofin avatar Oct 04 '24 20:10 stoofin