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

Layer-Specific Decals #21

Open
wes-hawkins opened this issue Sep 22, 2020 · 4 comments
Open

Layer-Specific Decals #21

wes-hawkins opened this issue Sep 22, 2020 · 4 comments

Comments

@wes-hawkins
Copy link

Colin, this shader is fantastic, thank you! Would you be able to modify it to only project onto certain layers? That would make it absolutely perfect for just bout every possible need. I will happily pay a bounty for the layer-specific rendering!

@dsazulay
Copy link

You can use stencil to limit where the projection will appear.

@ColinLeung-NiloCat
Copy link
Owner

you can use stencil or render queue, because it is a screen space method, it can't control where the decal will render.

@HigginDazs
Copy link

Do you have an example showing this? I can't seem to get the decal to ignore specific layers

@ColinLeung-NiloCat
Copy link
Owner

In you custom shader, you write a stencil value K first, usually your character shader.
https://docs.unity3d.com/Manual/SL-Stencil.html

Then, in the decal material, you set Stencil = only pass if stencil buffer's value NotEqual K

Since it is a screen space method, unity's Layer system is not useful, you need to rely on RenderQueue or Stencil.

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

No branches or pull requests

4 participants