Avoiding depth buffer collisions selectively

I’d love to use vfxgraph to spawn decals like the gooball sample, but how would I selectively ignore certain collisions such as a character?

9820764--1411587--Unity_KLYJqr2x9j.gif

Not possible, there was plan to implement layer support, but I am not sure if they added it already in unity 6.
However it’s possible with decal projector, but it requires custom simulation of particles on CPU.

1 Like

Been using 6 for a while and haven’t seen any mention of some sort of new depth buffer layer either in settings or vfxgraph. Do you by chance remember where layer support was mentioned?

Sorry, that was on roadmap, I think somewhere on the forum.


actually its there, I was thinking of some sort of new depth layer system but the rendering layers feature is editable when the node is selected.

on first test, it only appears to work with gameobjects for some odd reason, not graphics entities with the appropriate render layer - edit no its a custom shader problem sigh

Yes, it casts decal into buffer, but it requires other objects to support decals and light layers.

Morning, I’ll ask around regarding Entities specific behavior. But note that for the “decal layer” feature to work in URP and HDRP, you have to enable the setting.

For HDRP:

  • Project Setting > Quality > HDRP > Rendering > Decal.
  • Make sure that “decals” are enabled, and also “Layers” in the Decal section.

From here, you need to make sure that the Mesh that you need to be affected is using the same Rendering layer mask as the one flagged in your VFX Graph Decal Output.

For URP:

  • Select your Universal Renderer Data asset

  • Press the Add renderer Feature at the bottom

  • Search for “Decal”

  • Add the Decal renderer feature

  • Enable the “User rendering Layers”

A side note: In URP, the “Decal Layer” option is always visible even if it’s not enabled in your URP renderer.
As for HDRP, make sure that your GameObjects are using the same Rendering Layer Mask.

9831738--1414092--upload_2024-5-13_15-4-9.jpg

I will ask around regarding specific behavior related to ECS, but this might not fall into the VFX Graph team.

Did you try to use regular Decal and decal Layer in your project to see if it’s working?
If not, I guess that it’s on our side.

Thanks for your patience.

1 Like

Appreciate this! but I wasnt clear enough with my previous post, I figured it all out, the problem with entities turned out my shader was a missing #include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/RenderingLayers.hlsl.

One thing I dont really understand is why there are some settings only visible in the inspector when a context is selected(in this case decal rendering layers).

I am glad to know that you resolved your issue.
VFXGraph doesn’t have a dedicated setting panel and is using the editor Inspector.
The inspector displays the information and settings related to the selected Node/ Block. The Output Contexts has a lot of options and settings, and the “Decal Layer” setting is only available when selecting a URP decal Output or HDRP Decal output this option would not make sense on a URP lit Quad Output and would cut the interface.