Skip to content
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

Colored (RGBA) EXR images generated from Godot have wrong order of channels. #55472

Closed
leonard7e opened this issue Nov 30, 2021 · 11 comments
Closed
Milestone

Comments

@leonard7e
Copy link

leonard7e commented Nov 30, 2021

Godot version

3.4 stable

System information

Ubuntu 20.04

Issue description

EXR images generated from Godot changes channel order. Resulting in distorted colors, if the exr file is opened with other apps. Not limited to Blender and Gimp, but includes other apps like Da Vinci resolve.

Images created from Godot will show distorted colors in exrdisplay.

Steps to reproduce

You do need an external EXR viewer for comparison.

Best, use exrdisplay, which comes from makers of OpenEXR. It is shipped with the OpenEXR bundle.
https://www.openexr.com/using.html

The steps:
run the Godot project shipped here. It will load an RGB image. Hit the "Generate EXR" button. It will write the image to file "generated_color_testing.exr"

Now, open "generated_color_testing.exr" in exrdisplay (or DaVinciResolve, Blender, and so on). Compare "generated_color_testing.exr" with "color_testing_reference.exr" (which shows correct coloring in exrdisplay).

Minimal reproduction project

minimal_exr_godot.zip

@leonard7e leonard7e changed the title EXR generated from Godot does not work with other apps Colored (RGBA) EXR images generated from Godot have wrong order of channels. Nov 30, 2021
@Calinou Calinou added this to the 4.0 milestone Nov 30, 2021
@fire
Copy link
Member

fire commented Jan 12, 2022

Investigating.

Can confirm broken in itch io build Version 3.4.2-stable in https://darbyjohnston.github.io/DJV/

image

Is not broken in my version of Godot Engine [master] on 2021-01-12

@fire
Copy link
Member

fire commented Jan 12, 2022

@leonard7e @RodZill4 Can you test?

#56715

@leonard7e
Copy link
Author

leonard7e commented Jan 12, 2022

@leonard7e @RodZill4 Can you test?

@fire

I tried. I only found Mono builds for Linux. (I don't have experiences with Mono on Linux).
I used the linux-editor-mono artifact from
https://github.com/godotengine/godot/actions/runs/1686602957
Godot / Mono crashed. Not sure the crash relates to your fix …

Godot Engine v3.5.beta.mono.custom_build.cc55cc459 - https://godotengine.org
OpenGL ES 3.0 Renderer: NVIDIA GeForce RTX 2060 SUPER/PCIe/SSE2
Async. shader compilation: OFF
/lib/x86_64-linux-gnu/libasound.so.2: undefined symbol: snd_dlpath
 
Mono: Log file is: '/home/leonard/.local/share/godot/mono/mono_logs/2022-01-12_10.29.30_64834.log'
ERROR: Mono: FATAL ERROR 'Runtime critical type Mono.RuntimeStructs/MonoError not found (in domain , error)', ABORTING! Logfile: '/home/leonard/.local/share/godot/mono/mono_logs/2022-01-12_10.29.30_64834.log'.
   at: mono_log_callback (modules/mono/mono_gd/gd_mono_log.cpp:91)

=================================================================
	Native Crash Reporting
=================================================================
Got a SIGABRT while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries 
used by your application.

…
… 

fish: “./godot.x11.opt.tools.64.mono” terminated by signal SIGABRT (Abort)

@fire
Copy link
Member

fire commented Jan 12, 2022

Mono Linux builds have been crashing for me for several months now.

@leonard7e
Copy link
Author

leonard7e commented Jan 12, 2022

Mh … I compiled Godot from your branch/repo. It worked. The colors look correct. Alpha channel looks correct.
Screenshot_2022-01-12_11-19-46

There is a curious indent, where color shapes overlap

@fire
Copy link
Member

fire commented Jan 12, 2022

Fixed by: #56715

@fire fire closed this as completed Jan 12, 2022
@fire fire added the archived label Jan 12, 2022
@fire
Copy link
Member

fire commented Jan 12, 2022

@leonard7e If you can you provide more details on this. I have no idea how to fix that indent, but the color channels was obvious :D

@akien-mga akien-mga modified the milestones: 4.0, 3.5 Jan 12, 2022
@leonard7e
Copy link
Author

@fire
I tried to reproduce the indent issue with different EXR files. But I was not able to do.
(EXR rgb and rgba. With/without transparent background.)
Results seems correct. I am puzzled

@danilw
Copy link

danilw commented Jan 29, 2022

just tested on Godot_v3.4.2-stable still same problem, EXR generated by Godot has wrong channel order when I open it in Blender or GIMP (on screenshot original exr saved and opened in godot (bottom image in Godot(top left), GIMP(bot left), blender(right))

1

This test Godot project with exr included - test_exr_save.zip

exr generated by Godot SaveExr has BGRA channel order

This example file https://github.com/AcademySoftwareFoundation/openexr-images/blob/master/v2/LowResLeftView/composited.exr has ABGR channels order

test_tinyexr from https://github.com/syoyo/tinyexr if use EXR generated by Godot, test_tinyexr save it with ABGR channels order (and it will be opened correctly in GIMP/Blender)

@fire
Copy link
Member

fire commented Jan 29, 2022

I am not sure if it is in 3.4, but the tagging says 3.5. Good night.

@danilw
Copy link

danilw commented Jan 29, 2022

look like it fixed in 3.5 #56715 so nwm, sorry for up

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants