Welcome, Guest.
Username: Password: Remember me

TOPIC: [Help] Depth Alternative? Stencil?

[Help] Depth Alternative? Stencil? 1 year 7 months ago #1

Hey, thanks for Reshade and all you other shader programmers for the cool stuff you've been doing.

Long story short, I'm trying to make a "Green Screen" type shader. I went the easy route and used the depth buffer with a cut off.
Some of you might already have guessed what my issue is, but basically I want to clip everything except the character model, and the floor is unfortunately still included. (As seen below)

I'm not an experienced shader programmer, so I was just wondering what methods I could do to approach this. I've had a google but I can't quite wrap my head around what a Stencil buffer actually is, would that even solve the problem? I've looked through some of the included shaders for examples on how to use the Stencil Buffer, but I'm still uncertain.

Is there an alternative depth buffer I could use, or some fancy math that might help separate the feet from the floor?
I've actually used an alternative depth buffer before with Reshade 2.0, there was one that used something like "Depth normals" which gave a look to everything, and even separated the feet, but I couldn't quite work out how to use that to help separate it. (I'd sometimes even end up with an edge detection type approach, so I'd greenscreen the outlines, but the insides of the feet were then green screened as well :( )

Anyway not looking for you to write the code for me, just maybe a helpful nudge in the right direction. :)

Thank you!
The administrator has disabled public write access.