Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice
  3. Dismiss Notice

Resolved Avoiding depth buffer collisions selectively

Discussion in 'Visual Effect Graph' started by thelebaron, May 7, 2024.

  1. thelebaron

    thelebaron

    Joined:
    Jun 2, 2013
    Posts:
    878
    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?

    Unity_KLYJqr2x9j.gif
     
  2. Qriva

    Qriva

    Joined:
    Jun 30, 2019
    Posts:
    1,354
    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.
     
    thelebaron likes this.
  3. thelebaron

    thelebaron

    Joined:
    Jun 2, 2013
    Posts:
    878
    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?
     
  4. Qriva

    Qriva

    Joined:
    Jun 30, 2019
    Posts:
    1,354
    Sorry, that was on roadmap, I think somewhere on the forum.
     
  5. thelebaron

    thelebaron

    Joined:
    Jun 2, 2013
    Posts:
    878
    Unity_3WfnE8MinF.png
    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
     
    Last edited: May 8, 2024
  6. Qriva

    Qriva

    Joined:
    Jun 30, 2019
    Posts:
    1,354
    Yes, it casts decal into buffer, but it requires other objects to support decals and light layers.
     
  7. OrsonFavrel

    OrsonFavrel

    Unity Technologies

    Joined:
    Jul 25, 2022
    Posts:
    224
    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.


    upload_2024-5-13_15-4-9.png

    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.
     
    Last edited: May 13, 2024
  8. thelebaron

    thelebaron

    Joined:
    Jun 2, 2013
    Posts:
    878
    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).
     
  9. OrsonFavrel

    OrsonFavrel

    Unity Technologies

    Joined:
    Jul 25, 2022
    Posts:
    224
    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.