Yellow-Dog-Man / Resonite-Issues

Issue repository for Resonite.
https://resonite.com
139 stars 2 forks source link

Alpha to coverage on shaders #1998

Open PolygonBird opened 5 months ago

PolygonBird commented 5 months ago

Is your feature request related to a problem? Please describe.

We have two solutions currently on Resonite for Alpha with textures; - Alpha blending: Expensive, doesn't know how to light, too stupid to sort itself out. - Alpha cut out: Know how to sort itself, edges are as sharp as razer blades. It is either 1 or 0 Visible or not.

There are more solutions!

Describe the solution you'd like

Alpha to coverage! Offers smoother aliasing for cut out textures making them appear a lot softer on the edges as if it was alpha blended, while being cheaper than alpha blending.

Major use cases for this would be Hair, fur, feathers and plants.

You can read a much more detailed explanation found here:

https://bgolus.medium.com/anti-aliased-alpha-test-the-esoteric-alpha-to-coverage-8b177335ae4f

firefox_Rbr7JqUkdh

(Image source is from website link provided.)

Describe alternatives you've considered

There is a drawback to this as it requires forward rendering. Resonite preferring differed rendering over forward for performance reasons. Alpha to coverage requires MSAA. There are solutions to make it faster depending on the graphics team. Over all this is truly a more aesthetic choice people can certainly appreciate to get the best look out of their 3D art, especially with more realistic styling. Despite the expenses of the effect, the option to use such would be nice.

I am unsure if there is anything to support this in similar ways in deferred rendering I have been reading something about TAA maybe? But this is a little beyond my expertise.

Additional Context

I may have mentioned this a few times with devs. I was told to make a request note here. Some haven't even heard of Alpha to coverage.

Requesters

Flute

Frooxius commented 5 months ago

If this requires forward & MSAA, we won't likely even consider this until graphics engine switch.

shiftyscales commented 5 months ago

Marking as blocked by #1401.

Geenz commented 5 months ago

You can kind of do this under deferred, but it requires greater control than what we have in Unity. But it is something that’s on my mind for Sauce.

PolygonBird commented 5 months ago

Well I am happy to hear that there is a possibility for it in Sauce. I should probably also mention that there is also the option to add Screen Space Stipple as another option for alpha cutouts. From my experience it at least looks okay, at least better than outright cutouts.