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

Implement further color correction post processing effects #4731

Open
jcostello opened this issue Jun 23, 2022 · 16 comments
Open

Implement further color correction post processing effects #4731

jcostello opened this issue Jun 23, 2022 · 16 comments

Comments

@jcostello
Copy link

Describe the project you are working on

3D environment lighting in Godot

Describe the problem or limitation you are having in your project

Working on 3D environments, specially on the lighting I realize that setting the color mood is not that easy in Godot. Currently Godot's color correction post processing effect is not enough and is not easy to set up the right tones.

The only thing to have in mind is that in these before and after, I wouldn't take advantage of the indirect light energy when baking light compared with the other engine bellow

Before

image

After

image

Describe the feature / enhancement and how it helps to overcome the problem or limitation

It would be ideal to have shadow/midtones/highlights as well as lift/gamma/gain color correction effects to help setting the right color mood in the scene. Also Having an intensity slider to animate them would be ideal.

Color correction done in other engine.

Before
image

After
image

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

Ideally it would be on the Environment Node

If this enhancement will not be used often, can it be worked around with a few lines of script?

Could be a shader but IMO it would be nice to have it on the engine available for everyone as it is something that most of the people would tweak

Is there a reason why this should be core and not an add-on in the asset library?

Same as above

@Calinou
Copy link
Member

Calinou commented Jun 23, 2022

Related to #2196.

All the color correction you've mentioned can already be done using a well-crafted 3D LUT texture, but I agree that exposing built-in shadows/midtones/highlights adjustments would be useful, especially when using ACES tonemapping (as it tends to make things dark). However, this needs to be done in a way that doesn't cause a performance penalty when you don't use the feature.

Edit: Standard shadows/midtones/highlights adjustments can be performed using a 1D LUT texture, even.

@jcostello
Copy link
Author

@Calinou I agreed. Althought it can be done, it need to be crafted outside and could be a bit tedious. Also I dont know if you can achive the same result when pushing the shadows up or the highlights down.

Either way, as you said, performance should not be affected when this is not used.

@VivianVerdant
Copy link

This would be very useful. I use color correction suites in video editing software all the time, and being able to fine tune the way lighting and shadows looks can be powerful in setting the mood and readability in a scene.

@fire
Copy link
Member

fire commented Jun 23, 2022

Feel free to salvage my color management system pr.

https://github.com/fire/godot/tree/littlecms

@jcostello
Copy link
Author

Feel free to salvage my color management system pr.

https://github.com/fire/godot/tree/littlecms

I don't have the knowledge to do so. Anyone? 🙏

@QbieShay
Copy link

Related to #2196.

All the color correction you've mentioned can already be done using a well-crafted 3D LUT texture, but I agree that exposing built-in shadows/midtones/highlights adjustments would be useful, especially when using ACES tonemapping (as it tends to make things dark). However, this needs to be done in a way that doesn't cause a performance penalty when you don't use the feature.

I think we could use a LUT under the hood and perhaps give a good in-engine tool to generate one?

@Calinou
Copy link
Member

Calinou commented Jun 24, 2022

I think we could use a LUT under the hood and perhaps give a good in-engine tool to generate one?

LUT generation in the engine is an interesting idea, but it also prevents doing real-time manipulation (as generating a 3D LUT can take a while). I'm not sure how often people would need to change shadows/midtones/highlights during gameplay though.

@VivianVerdant
Copy link

Being able to make changes in real time, or blend between custom presets would be useful in instances like traveling between indoors and outdoors, or during day-night cycles.

@Calinou
Copy link
Member

Calinou commented Jun 24, 2022

Being able to make changes in real time, or blend between custom presets would be useful in instances like traveling between indoors and outdoors, or during day-night cycles.

See also #4580. If you can blend between two LUTs, then (almost) anything is possible.

@QbieShay
Copy link

QbieShay commented Jun 24, 2022

Yes I'd lean towards blending multiple LUTs, yes :) although this could be more expensive (computation wise) than just regulating a uniform across all shadow passes? maybe we can expose these parameters in project settings or world environment (shadow tint, light tint, etc.)

@Calinou
Copy link
Member

Calinou commented Jun 24, 2022

although this could be more expensive (computation wise) than just regulating a uniform across all shadow passes? maybe we can expose these parameters in project settings or world environment (shadow tint, light tint, etc.)

Shadows/Midtones/Highlights adjustments don't actually affect shadow or light appearance. They affect specific levels of the image's brightness by adjusting parts of the luminance curve. It's kind of like using a Curves filter in an image editor.

@jcostello
Copy link
Author

although this could be more expensive (computation wise) than just regulating a uniform across all shadow passes? maybe we can expose these parameters in project settings or world environment (shadow tint, light tint, etc.)

Shadows/Midtones/Highlights adjustments don't actually affect shadow or light appearance. They affect specific levels of the image's brightness by adjusting parts of the luminance curve. It's kind of like using a Curves filter in an image editor.

Exactly.

If we can have a LUT generating tool with the same adjustments Im fine with that. I checked on how can you generate LUT textures in something like Gimp and you use GMIC (altering values like the ones we described above) and then generate the texture. So maybe similiar results can be achived inside the engine and generate a LUT texture

@QbieShay
Copy link

If the agreed approach is to generate LUTs, then i think we need to re-answer the question "can it be done with an addon"

@jcostello
Copy link
Author

Sure It can, but probably tricky done by an addon. In my opinion this could be in the core as an upgrade of the existing post effect

@fire
Copy link
Member

fire commented Jun 24, 2022

The design is that we give icc color profiles or alternative tables to https://github.com/fire/godot/tree/littlecms and it'll generate a lookup table texture by taking a standard color 2d array / texture atlas and multiplying the lut with the texture and then set as the color grade option in godot 4.

@ArseniyMirniy
Copy link

ArseniyMirniy commented Oct 25, 2024

  1. Using LUTs doesn't make it easier for casual audience
  2. For now, you can use my Visual Shader for color correction and screen effects: https://github.com/ArseniyMirniy/Godot-4-Free-Color-Correction-and-Screen-Effects-Visual-Shader — it's fairly easy to use and it works well with basic systems (like auto exposure). For 4.3 it's better to use ACES, for 4.4 AgX will probably make more sense.

The shader allows making the image Warmer, Colder, tweak greens, use Vignette, Saturation, and Brightness, etc.

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

6 participants