» Stencil Mask
This site relies heavily on Javascript. You should enable it if you want the full experience. Learn more.

Stencil Mask

module depth stencil depthbuffer dx11


Demo/helper modules for using the stencil buffer in DX11.

Contains 2 modules: StencilMask (DX11.RenderState Write), & StencilMask (DX11.RenderState Read)

You can use 8 bits of the depth-buffer as a stencil buffer. With the Write module we set each bit individually to render 8 independent masks for free (or at slightly-reduced-but-still-quite-ok depth accuracy).

Using the Read module you can limit a shader to only drawing the pixels flagged by any of your mask(s)

You can set all of this in your shader also, but can be handy to not have to modify everything.

Edit: Have changed these to be renderstate only, as StencilReference (DX11.Layer) had some issues and is being depreciated.


16.12.16 [07:44 UTC] by everyoneishappy | 473 downloads
Updated to RenderState Version

sebescudie 15/12/2016 - 10:43

interesting, thanks!

anonymous user login


~22h ago

domj: Midweek Patch Therapy today at 17:30 CET! Hope to see you there https://therapy.domj.net

~2d ago

domj: Schéma + Orca + Pilot, a love triangle https://www.twitch.tv/videos/639199128

~2d ago

joreg: Your next chance for an easy introduction to the all-new #vvvv gamma: This friday 6pm CET: https://thenodeinstitute.org/event/introduction-to-creative-coding-with-vvvv-gamma-english/

~5d ago

~8d ago

domj: Stuck in your patching or eager to share what you made or came across? Join Midweek Patch Therapy at 17:30 https://therapy.domj.net/

~9d ago

david: vvvv meetup 3. new stream link. again youtube made us nuts.. please send everybody to https://youtu.be/pa3HRQ7kj6w

~9d ago

joreg: Reminder: Join us this evening, 8pm CET for the 3rd worldwide #vvvv meetup: 3.-worldwide-vvvv-meetup

~9d ago

sinus: @evvvvil: very impressive stuff! keep on marching the rays!You´ll never walk alone!

~10d ago

evvvvil: @mediadog, thankx for pointing it out broski. Wicked.