Skip to content

Conversation

@greggman
Copy link
Collaborator

@greggman greggman commented Jan 22, 2025

I'm not sure this is a great sample because I'm not sure using the stencil mask for this purpose is best. It's got the advantage that it should "early out" but it has the disadvantage of, for example, using an alpha mask, that would allow more than just masked yes/no.

Stencil masks are used for shadow volumes but that techinque has fallen out of favor. Stencil masks are also used for outlines. That might be a good use but there are several other popular outline algorithmns.

So, this demo is kind of pretty and at least shows using the a stencil buffer.

Copy link
Collaborator

@beaufortfrancois beaufortfrancois left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for starting this sample @greggman! I've left few comments.

I'm not sure this is a great sample because I'm not sure using
the stencil mask for this purpose is best. It's got the advantage
that it should "early out" but it has the disadvantage of, for example,
using an alpha mask, that would allow more than just masked yes/no.

Stencil masks are used for shadow volumes but that techinque has
fallen out of favor. Stencil masks are also used for outlines.
That might be a good use but there are several other popular
outline algorithmns.

So, this is demo is kind of pretty and at least shows using the
a stencil buffer.
@greggman greggman merged commit 8a7776c into webgpu:main Mar 24, 2025
1 check passed
@greggman greggman deleted the stencil-sample branch March 24, 2025 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants