-
-
Notifications
You must be signed in to change notification settings - Fork 21.1k
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
Movie mode recording in 2D HDR is not as good as expected. #81301
Comments
I've confirmed this on v4.2.dev3.official [013e8e3] I tried looking into a solution to this for a few days but couldn't get anything working.
... the issue being that this tonemapping is done for the window viewport but not for the texture sent into the In the meantine, you can work around this issue by using a shader to manually convert from linear to sRGB space for movie mode only: shader_type canvas_item;
global uniform bool MOVIE;
uniform sampler2D screen_texture : hint_screen_texture;
void fragment() {
COLOR = texture(screen_texture, SCREEN_UV);
if(MOVIE){
COLOR.rgb = pow(COLOR.rgb, vec3(1.0/2.2));
}
} func _ready():
if OS.has_feature('movie'):
RenderingServer.global_shader_parameter_set("MOVIE", true) (this will cause the displayed image to be incorrect, but the recorded movie will be closer to the intended result)
Here's an MRP with the issue and the workaround: |
reason for issue confirmed here (I believe) |
This is essentially the same issue as #82351 |
It should be possible for MovieWriter to automatically perform the linear-to-sRGB conversion depending on whether 2D HDR is enabled. Relevant code is here: godot/servers/movie_writer/movie_writer.cpp Lines 172 to 196 in 251fb83
There is one potential concern however: in the long run, some people may desire to have movie output that's written in linear space so it can be integrated in compositing software (you'd also need the output to be in OpenEXR and have high dynamic range). That said, given MovieWriter can't write to OpenEXR yet, I think we can always perform the conversion for now. |
@Calinou I couldn't figure out what methods to use to convert a texture from linear to sRGB, if any exist. There are automatic conversion methods in If you have any pointers there, that would be appreciated! |
You will probably need to loop over the image's individual pixels and convert them to sRGB using the Color function. I'm not sure if we have a single function that does this on an entire image. |
Hm, alright. I would be worried about performance at that point, perhaps a shader is the best solution for now. Though, I haven't tested it. |
I think rendering a video in sRGB color space is by far the more common and expected use case. we've been trying out movie maker mode recently to render a trailer. despite movie maker mode seemingly being the ideal application for that, we gave up on using it because our game uses 2D HDR and the results were unexpected. alternatively to automatic conversion, a warning hint when enabling movie mode combined with a link to docs explaining how to convert your video could be a satisfactory solution, too. |
Godot version
v4.2.dev.mono.custom_build [75de1ca]
System information
Godot v4.2.dev.mono (75de1ca) - Arch Linux #0~20230903.g20dcd95 SMP PREEMPT_DYNAMIC Sun Sep 3 05:16:45 UTC - Wayland - Vulkan (Mobile) - dedicated NVIDIA GeForce GTX 1650 (nvidia; 535.104.05) - Intel(R) Core(TM) i5-9300H CPU @ 2.40GHz (8 Threads)
Issue description
2D HDR on, no restarting:
2D HDR on, restarting:
Movie mode recording output:
(I have run out of Deepl translations, please understand...)
Steps to reproduce
Minimal reproduction project
N/A
The text was updated successfully, but these errors were encountered: