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

Debanding not working for framebuffer allocation = 2D #67748

Closed
belzecue opened this issue Oct 22, 2022 · 2 comments · Fixed by #67768
Closed

Debanding not working for framebuffer allocation = 2D #67748

belzecue opened this issue Oct 22, 2022 · 2 comments · Fixed by #67768

Comments

@belzecue
Copy link

Godot version

3.5.1-stable.official

System information

Linux, GLES3, Intel Integrated GPU

Issue description

The Project Settings "framebuffer allocation" property hint says:

Clipboard 1

So, as I undestand it, DEBANDING should work for either a value here of 3D or 2D. I can confirm that debanding is active when I set Framebuffer Allocation to '3D', but when I switch it to '2D' it is not active, as demonstrated in the video below, where you can see a smooth fade-up on the moon when set to 3D but banding appear when Framebuffer Allocation is set to 2D. Watch the bottom of the moon in both examples.

capture-2022-10-22_18.36.12.mp4

Steps to reproduce

Grab any greyscale texture with a wide grey range (dark to light), such as an high quality texture of the moon, slap it on a quad and add a tween to fade up from black.

First try it with the framebuffer property set to "3D" to confirm you get a smooth fade up with no banding.
Next switch over to framebuffer allocation = "2D" and run the scene again, watching for any banding.

Minimal reproduction project

Once I get confirmation that debanding should be active when framebuffer allocation = 2D then I'll upload a simple MRP.

@Calinou
Copy link
Member

Calinou commented Oct 22, 2022

Debanding runs in the tonemap pass. As a result, it only affects 3D rendering, not 2D rendering, regardless of the framebuffer allocation mode chosen.

For 2D rendering, perform your debanding in a custom shader when needed. Note that this won't work in Godot 4 as 2D rendering is always SDR there. An option to render 2D in HDR again will be readded in the future (probably not for 4.0 due to time constraints). See also #66978 and #62110.

Edit: Are you using the Canvas environment background mode? In this case, debanding might work in 2D, just like glow. However, it's still expected to require 3D framebuffer allocation as the Canvas background mode doesn't work with 2D framebuffer allocation.

@belzecue
Copy link
Author

belzecue commented Oct 23, 2022

Thank for the info. I suspected that might be the case. Yes, I'm using a custom shader and have debanding code ready to use in the alternative. And yes, I'm using Canvas environment background, which is providing glow but not the debanding when framebuffer allocation is set to 2D. No problem leaving allocation set to 3D, other than losing a couple frames of performance.

I feel the documentation needs to make this much clearer and I'll look into submitting a doco patch to do so -- unless a deeper dive shows that it is actually mentioned somewhere. I see you've already done the doco update! Thanks!

@akien-mga akien-mga added this to the 3.6 milestone Dec 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants