Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stencil Mask Example #413

Closed
wants to merge 23 commits into from
Closed

Conversation

cmhhelgeson
Copy link
Contributor

@cmhhelgeson cmhhelgeson commented Apr 3, 2024

EDITED 4/3/24

A simple masking example leveraging the stencil buffer. Masks can be positioned with the mouse, resized with the scroll wheel, and inverted.

The example is intended to demonstrate how users can modify existing code with minimal adjustments to create masks with the stencil, render into different scenes, and leverage the capabilities of the render pipeline to directly modify the stencil buffer across one or more passes by disabling the pipeline's color and depth write functionality.

I apologize for all the merge commits that are still extant in my pull request branches, but I wasn't able to figure out a sensible way of squashing them all by the end of the day.

image

Merge main into my fork
Merge main into my fork.
commit 8882d40
Author: cmhhelgeson <[email protected]>
Date:   Tue Apr 2 19:48:16 2024 -0700

    Basic functionality implemented

commit 6fee17c
Author: cmhhelgeson <[email protected]>
Date:   Tue Apr 2 18:40:35 2024 -0700

    added uniforms

commit 470263b
Author: cmhhelgeson <[email protected]>
Date:   Tue Apr 2 18:19:31 2024 -0700

    Stencil Mask example
commit 8882d40
Author: cmhhelgeson <[email protected]>
Date:   Tue Apr 2 19:48:16 2024 -0700

    Basic functionality implemented

commit 6fee17c
Author: cmhhelgeson <[email protected]>
Date:   Tue Apr 2 18:40:35 2024 -0700

    added uniforms

commit 470263b
Author: cmhhelgeson <[email protected]>
Date:   Tue Apr 2 18:19:31 2024 -0700

    Stencil Mask example
…dded additional comments, cleaned up description
@cmhhelgeson cmhhelgeson marked this pull request as draft April 4, 2024 20:51
…der's functionality, edited the meta.ts and index.html naming accordingly
@cmhhelgeson cmhhelgeson marked this pull request as ready for review April 4, 2024 21:10
@kainino0x
Copy link
Collaborator

I apologize for all the merge commits that are still extant in my pull request branches, but I wasn't able to figure out a sensible way of squashing them all by the end of the day.

You should branch this repository's main instead of your fork's main. Example first time setup:

git remote add upstream [email protected]:webgpu/webgpu-samples.git
git fetch upstream
git checkout main
git branch --set-upstream-to=upstream/main
git reset --hard upstream/main

Then when you want to branch:

git checkout main
git pull # same as git pull upstream main
git checkout -b your_new_branch

@cmhhelgeson cmhhelgeson closed this Apr 5, 2024
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