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 an option to jitter BaseMaterial3D dithering pattern across frames #79522

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Calinou
Copy link
Member

@Calinou Calinou commented Jul 15, 2023

This improves the dithering pattern's appearance when TAA is enabled, or at high frame rates when TAA is disabled (thanks to monitor response times not being instant).

See godotengine/godot-proposals#4179 (the rationale is very similar).

Preview

Click to view at full size (this is required for accurate preview). TAA is enabled on all screenshots.

Before After
Screenshot_20230716_004902 webp Screenshot_20230716_004940 webp

Bonus screenshot (6 MB)

TODO

Copy link
Member

@clayjohn clayjohn left a comment

Choose a reason for hiding this comment

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

IMO this should be automatic. i.e. enabled when using TAA, disabled if not using TAA.

If users request the setting later, we can add it.

@Calinou
Copy link
Member Author

Calinou commented Jul 17, 2023

IMO this should be automatic. i.e. enabled when using TAA, disabled if not using TAA.

If users request the setting later, we can add it.

I've pushed a second commit that removes the setting. Let me know if I should do the same for #61834.

@Calinou Calinou force-pushed the basematerial3d-add-dither-jitter branch from f129b55 to d2d194a Compare August 18, 2023 10:12
This improves the dithering pattern's appearance when TAA is enabled,
or at high frame rates when TAA is disabled (thanks to monitor response
times not being instant).
@Calinou Calinou force-pushed the basematerial3d-add-dither-jitter branch from d2d194a to df5a104 Compare July 27, 2024 18:16
@Calinou
Copy link
Member Author

Calinou commented Jul 27, 2024

Rebased and tested again, it works as expected. This is now effective on FSR2 as well.

I wonder if we should have a dedicated built-in shader variable to expose a TAA/FSR2 jitter fraction, since this would allow for converting to ShaderMaterial without having the converted code depend on whether you had TAA/FSR2 enabled or not at the time of conversion.

Note that there's an issue which also occurs without this PR, but tends to be made more noticeable with this PR. A large checkerboard pattern is visible when moving towards or away a material with dither distance fade enabled (either Pixel Dither or Object Dither).

image

I'm not sure what's causing this. I've reported it separately: #94841

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

2 participants