Hello everyone,
I have a question because i’m little bit lost.
I currently use the plugin “Chaos Vehicle” and want to create scratch/impact when a car hit a wall or other car but i don’t know how
The easiest way i think it’s decals but decals is a projector and i don’t want other object affected… maybe mat but of course it’s way more difficult. That why i need help!
Thank you
The decal can sample the custom depth stencil buffer to mask what object to be applied to.
There is also the custom decal response workflow, which allows advanced control over how a material reacts to decals.
1 Like
Thanks for answer! i just see this videos but i’m not an expert on shader/mat and he don’t explain how the mat is not affected by red dot with an example
There are lots of ways. A bitmask node can filter out a specific value (such as the selected but value in the custom depth stencil) to create a black and white alpha mask.
Ok i see! but something that i don’t understand is where to put this? in decal mat or in surface? 'cause example i want bullet hole only in some walls, i have to modify all ma shader wall?
Depends on if you’re using custom depth or not.
If you’re using the depth stencil, that can be read inside the decal to mask it.
If you aren’t using the stencil then you would do the masking in the receiver material.
1 Like
Okok! i’m little bit lost but it’s ok thanks for your answers
Update: i finally succeeded to use custom stencil and it work pretty well but i have to set the custom layer on obj in my scene (it’s little bit tedious) so is it a way that my custom stencil interacts only with specific material?
shorter, my decals can react only with specific material? and how?
Thanks
Inside the decal material you use a scene texture sampler node set to the custom stencil buffer, then you can pass this texture into a bitmask node to detect if the value of a pixel equals your stencil’s chosen bit or not. This bitmask can be used as an opacity mask for the decal.
1 Like
oh ok perfect thanks i’ll try it