Alpha Distribution for Alpha Testing #4651
Replies: 2 comments
-
The current alpha hash implementation in Godot seems to look broken. You can see "streaks" of alpha transparency changes occurring as a material gets closer or further away from the camera. It never delivered a good-looking result in my experience, even with the newly implemented TAA enabled. Instead, I'd look into replacing alpha hash with a "alpha dither" mode, which represents the material's alpha channel using interleaved gradient noise dithering. This should work well when TAA is disabled, but also when it's enabled by randomizing the jitter offset every frame. In contrast, alpha hashing is mostly designed to work with TAA, yet not every Godot user will be using TAA. Alpha distribution looks interesting, but since it seems to work purely as a pre-process approach, it can be done at import time rather than requiring a new render mode to be implemented in the built-in material. Rendering can be done using traditional alpha testing, but with a bespoke alpha channel generated on import. |
Beta Was this translation helpful? Give feedback.
-
There is also a paper on alpha distribution that has more detail: http://www.cemyuksel.com/research/alphadistribution/alpha_distribution.pdf This could be made into an interesting importer plugin. The nice thing about alpha distribution is that it is a pre-process (i.e. you do the calculations at import time, not at run time). At run time you just have to do a normal alpha scissor (all alpha values will be 0 or 1 so it doesn't matter what threshold you use). This would avoid the overhead of alpha hashing. That being said, as a general solution it isn't quite as nice as alpha hashing. You need to coordinate an importer option and the corresponding material. It also looks much worse on objects close up as it forces them to have sharp pixelated edges. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello everyone.
A long time ago I looked at this pr (godotengine/godot#40364) and all the discussion that was generated so I found a very good alternative to Alpha Hash and it is Alpha Distribution, so I will leave you the source of the method here(http://www.cemyuksel.com/research/alphadistribution/alpha_distribution_i3d2018_slides.pdf) and the video where a little more about the subject is explained (https://youtu.be/LTzhxLEgldA?t=3699 ). I hope this helps.
Beta Was this translation helpful? Give feedback.
All reactions