Stencil targeting specific color


I did a bunch of googling and couldn’t find an answer. I already use stencils so I am somewhat familiar with them. For the life of me, I can’t figure out how to target a different color other than B/W for stenciling. I’d like to stencil on let’s say red (255,0,0,255) and ignore all other colors.

Extra you don’t need to read below if you don’t want to:
I am redesigning water in my game. I thought maybe anything with “water” could be set to a high color like red (255,0,0,255) which at the end of the rendering, the stencil could draw water onto anything hitting that color range.

Dunno, maybe a fx file would be better and more efficient…

Something that came up:

Another thing:,use%20both%20the%20D3D10_BIND_DEPTH_STENCIL%20and%20D3D10_BIND_SHADER_RESOURCE%20bind%20flags.

This was a fun accidental find: [Spanish]

Found via this video:

Search phrase:

Sadly this is a dead link:

Relating to FX searches:

Something interesting…:

Will add these links to my links thread… some interesting stuff there…

Hope these help somewhat…

Thank you. I’ll see what I can learn from those to see if it will fit what I am trying to do. Your search queries were definitely very different than mine. I was looking at it from the stencil functionality, not water in general.

1 Like

Do share your findings!

Good luck!