Hey, I have a question regarding the Output Particle URP Lit Decal VFX graph node and how/where its information gets written into the DBuffer.
As a setup, I have a particle system spawning a decal when colliding with the depth buffer. That particle is just a red quad for debugging.
This image shows the decal appearaing on the right material (Unity Lit), but not on the left material (custom material). My custom shader is very much based on Unity’s lit shader, it just delays a few color calculations and adds some more more vertex and normal options.
I first thought I messed up on implementing that my material receives decals, but if I just use the decal projector, it looks like this:
So my material is capable of receiving decals.
Next, I checked the rendering layers, but the setup is the same for both cubes in the images, so I don’t see an issue there.
When checking the frame debugger, I noticed that in places where my custom material is used, the VFX decal information is just not written into the DBuffer (the projector information is written into it though).
However, I can’t figure out why. Does anyone know what might cause this issue or where I could look next?
Thanks in advance!
Hello @pap3rhat!
Would you be able to share your custom shader or, even better, the small setup project you’re using in the screenshot ? I can have a look to understand what is happening.
You could also try using a ShaderGraph output in VFX Graph with a Decal ShaderGraph to see if it also happens.
Hey, thanks for your response!
While setting up an example project, I have actually figured out what went wrong. In the DepthNormalsOnly pass, I messed up setting the correct normal in my “just use the default normal” mode (as opposed to procedural or using a texture).
Within the decal renderer feature documentation (Decal Renderer Feature | Universal RP | 12.0.0) it does state that a DepthNormal prepass is required, but because it worked with the projector, I just assumed that this couldn’t be the issue otherwise, both wouldn’t be working. But apparently that is wrong, for some reason? If you just happen to know why that is the case, I’d be interested in learning the difference!
Since decal shader graphs don’t support vfx graphs (at least in the 6.0 version I’m using), I couldn’t test whether or not that setup is also influenced by it.
Thanks again!
My bad for the ShaderGraph Decal in VFX, it is not supported indeed.
Regarding why it happened, I can only guess, but maybe the VFX Decals were using some Angle Fade, and with the normal being incorrect, it completely faded out the decal ?
That might have actually been it! Good to know for the future, thanks for your help!
1 Like