I don’t have the very latest version of Unity HDRP yet, but is there a way to make the decal projector (HDRP) to only render on certain layers? For example, I only want a decal to render on the terrain/ground.
If not, is this a feature that could be worked on/implemented soon?
Decal layers will be available in 10.x.x pacakge with 2020.2.
you can indeed test it in the future 2020.2b1 that should be out soon (but summer vacation delay it a bit)
i haven’t used light layers? in hdrp yet. i think there are to many reports about breaking other stuff.
but you can limt a decal to just the terrain using the stencil buffer.
make the terrain depth prepass write out a specific stencil value like 3.
then hack into the decal shader and set up its stencil values accordingly:
Ref 3
Comp Equal
works in hdrp 7 and 9
i haven’t used light layers? in hdrp yet. i think there are to many reports about breaking other stuff.
I haven’t heard about such a thing. Light layers work well and is use in several projects.
We have good example: Unity Blog
However if you have reference on issues, please report link here, thanks
make the terrain depth prepass write out a specific stencil value like 3.
I would really recommend to not use an arbitrary number
We have a file name HDStencilUsage.cs. There is only two bit available for custom usage in HDRPReservedBits
if you use the stencil use those one otherwise you will break an effect or an optimzation in HDRP
We haven’t use stencil for decal layers (due to too few bits available) but an extra buffer to allow to have up to 8 layers.
Hi, are you sure Decal layers are enabled in both your HDRP settings and your FrameSettings? (Check in Edit → Project Settings → Default HDRP settings) and look at if Decal layer are enabled