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

Add adjustments and color correction to Compatibility renderer #91176

Merged
merged 1 commit into from
Apr 26, 2024

Conversation

clayjohn
Copy link
Member

@clayjohn clayjohn commented Apr 25, 2024

Fixes: #66457

This is the last of the major features missing from the Compatibility renderer. The remaining features are long term projects (e.g. VoxelGI) or things that won't be supported (e.g. SDFGI).

Using adjustments forces using the post processing pass (which is bad for performance on mobile devices). Originally we wanted to implement this in the scene shader and only use the post processing pass with glow. However, the BCS effects are not suitable for multipass lighting. Brightness, saturation and color correction were broken, but acceptable, but contrast completely breaks to a degree that isn't acceptable. I.e. when using contrast any object with multipass lighting has the reverse of the contrast used.

@@ -1521,6 +1521,7 @@ void main() {
if (alpha < alpha_scissor_threshold) {
discard;
}
alpha = 1.0;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fixes a bug that became more obvious as a result of enabling post effects.

This code matches the behaviour of the RD renderers:

#if (defined(ALPHA_SCISSOR_USED) || defined(ALPHA_HASH_USED)) && !defined(ALPHA_ANTIALIASING_EDGE_USED)
alpha = 1.0;
#endif

Copy link
Contributor

@BastiaanOlij BastiaanOlij left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@akien-mga akien-mga merged commit a07f89b into godotengine:master Apr 26, 2024
16 checks passed
@akien-mga
Copy link
Member

Thanks! Awesome to have the Compatibility renderer basically feature complete for 4.3 beta!

@clayjohn clayjohn deleted the GL-adjustments branch April 26, 2024 16:04
@Bimbam360
Copy link

Bimbam360 commented May 3, 2024

Just span up 4.3dev6 and adjustments aren't applying on a newly created scene with a new spatial material and albedo applied:

Compatibility Behaviour
compat

At least there's no more errors, but also seemingly does nothing.
image

For reference:
Forward Expected Behaviour
forward

@clayjohn
Copy link
Member Author

clayjohn commented May 3, 2024

@Bimbam360 sorry about that. A bug slipped through and the regular adjustments get disabled unless color correction texture is used. It's fixed already in master and will be fixed in beta 1

@naturally-intelligent
Copy link

Thanks for adding this! After glow, this was the last feature missing that brings our project back to full v3 compatibility.

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

Successfully merging this pull request may close these issues.

OpenGL: Environment adjustments not implemented yet
5 participants