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

Updated dithered transparency to support blue noise #5941

Merged
merged 3 commits into from
Jan 15, 2024

Conversation

mvaligursky
Copy link
Contributor

@mvaligursky mvaligursky commented Jan 15, 2024

Update to transparency dithering introduced here: #5903, which is not released yet and so API changes are fine.

New API (booleans were changed to enums to allow different options)

StandardMaterial.opacityDither = DITHER_BAYER8 / DITHER_BLUENOISE / DITHER_NONE;
StandardMaterial.opacityShadowDither = DITHER_BAYER8 / DITHER_BLUENOISE / DITHER_NONE;
  • added internal data storing 32x32 4 channel blue noise, which will be used for multiple effects together with TAA
  • the data gets also uploaded as a texture (initially used for blue noise dithering only)
  • when the camera jitter is enabled (TAA), both bayer and blue noise pattern are randomly per frame offset by a blue noise based offset

Existing bayer dithering:
Screenshot 2024-01-15 at 13 50 21

Blue noise based (better with TAA):
Screenshot 2024-01-15 at 13 50 37

Related: #5943

@mvaligursky mvaligursky self-assigned this Jan 15, 2024
@mvaligursky mvaligursky requested a review from a team January 15, 2024 13:51
src/core/math/blue-noise.js Show resolved Hide resolved
src/core/math/blue-noise.js Show resolved Hide resolved
src/core/math/blue-noise.js Show resolved Hide resolved
@mvaligursky mvaligursky merged commit 7747b00 into main Jan 15, 2024
7 checks passed
@mvaligursky mvaligursky deleted the mv-bluenoise-transparency branch January 15, 2024 15:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: graphics Graphics related issue feature request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants