LineMaterial: Write line segments with capsule depth#27353
Draft
gkjohnson wants to merge 6 commits intomrdoob:devfrom
Draft
LineMaterial: Write line segments with capsule depth#27353gkjohnson wants to merge 6 commits intomrdoob:devfrom
gkjohnson wants to merge 6 commits intomrdoob:devfrom
Conversation
Owner
|
Looks great! The problem is that we lose antialiasing? |
Owner
|
/ping @WestLangley |
Collaborator
Author
The problem is that when using the function to determine capsule intersection it doesn't give the right information needed to determine alpha-to-coverage anti aliasing. The solution that came to mind was to run both capsule intersection functions but that felt messy / slow. It needs a bit more work but it's possible there's another way to determine the AA value - I just need to think about it more. Here is what I was thinking for a more fully featured version of this if other are interested in picking it up:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Related issue: #27349, #26916
Description
A quick try at enabling the Line2 to write the line segments depth buffer as capsule shapes so they more sensibly intersect with other scene objects. Unfortunately I'm not sure how to make this work cleanly with alpha-to-coverage to make sure the edges have clean AA without calling the previous intersect function along with the new depth function which would have performance implications. We could add a separate toggle, though, but I don't love that. I'll leave this here for now in case someone else has some ideas.
Demo here. You can toggle the new depth write with the "capsule depth" option.