Take alpha antialising options into account when setting up materials #71261
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This restores the functionality of the alpha antialising options
Fixes: #64501
#58954 made it so that alpha scissor and alpha hash materials always go through the opaque pipeline. However, alpha antialising is more like depth prepass in that it can be used for depth pass and shadows, but still needs to be drawn with a transparent pipeline so that proper MSAA can be done.
Image comparison - cropped and scaled
Before:
After:
comparison slider for fun
As a bonus:
Alpha edge antialising is a very important tool to combat aliasing that occurs when using alpha scissor or alpha hashing. Alpha scissor allows you to take advantage of the depth prepass to get proper sorting of semi-transparent objects (like leaves or grass) within a mesh.
Plain alpha
Ordinary alpha looks nice and smooth, but suffers from a chaotic layering of the individual branches (branches that are near the bottom that should be hidden are drawn over top) and casts no shadows.
Alpha scissor allows us to properly order the branches and cast shadows but the edges are rough looking and the aliasing is even worse when the camera moves
Depth prepass alpha looks nice and smooth like alpha, and even casts shadows, but lower branches are still getting drawn over upper branches
Alpha scissor with Alpha blend retains the positive characteristics of alpha scissor, but smooths out the aliasing artifacts.
Comparison