I followed this tutorial
it works fine but the stenciled item creates an outline thru walls. Is there a fix?
I followed this tutorial
it works fine but the stenciled item creates an outline thru walls. Is there a fix?
Wait! I might be misinformed but isn’t that the whole point of the stencil?
If you are just trying to make your objects solid color you should just use an “unlit” material. The whole point of the stencil is that it is “placed on top”.
my bad i didn’t clarify, i just want to know if there’s a way so it doesn’t show an outline thru walls in game play mode.
you need to write not only to the stencil buffer, but also the custom depth buffer. Then you can compare the custom depth buffer to the regular depth buffer to detect if the object is in front of or behind something else. You can use this to create a mask to enable or disable your outline.
cool thanks, unfortunately i don’t know how to do any of that but thanks for the input!
i got it to work in case anyone wants to use this effect, also documenting for future use.
in project settings under rendering post processing, find custom depth stencil pass, enable with stencil.
select your object in the level you want to be in color, in details panel search custom depth, check render customdepth pass then set the number for the object. i set mine to 2.
create the material open it and set it to post process, then search blendable and change it to before tonemapping.
and copy this graph
once done setup your post process volume, apply the material
it worked for me
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.