Search Unity

How do i use a Shader Graph shader on a Visual Effect Graph particle?

Discussion in 'Visual Effect Graph' started by koomzog48, Apr 17, 2020.

  1. koomzog48

    koomzog48

    Joined:
    Apr 17, 2020
    Posts:
    1
    I saw that JulienF_Unity answered a question about this in this thread, but I couldn't figure it out. I think I know that it is possible, but I haven't quite cracked it.
    Steps taken so far:

    1. Installed Shader Graph and Visual Effect Graph
    2. Enabled "Experimental Operators/Blocks" in Preferences -> Visual Effects
    3. Created a Visual Effect Master end node in my Shader Graph

    Now, how do I use that shader for my particles in Visual Effect Graph?
     
    Wizp likes this.
  2. KoomZog

    KoomZog

    Joined:
    Apr 7, 2020
    Posts:
    4
    I'm trying to create the smoke effect explained at ~25m in this video:

     
  3. KoomZog

    KoomZog

    Joined:
    Apr 7, 2020
    Posts:
    4
    For anyone finding this by googling in the future:
    I figured it out. I had an existing PBR shader created in Shader Graph and added a Visual Effect Master end node in that and connected it. But VFX Graph needs a shader created specifically for it (Create -> Shader -> VFX Shader Graph). I copied all other nodes to that shader and saved the asset. Then I could select it in VFX Graph. Problem solved.
     
  4. Deleted User

    Deleted User

    Guest

    In Shader Graph 7.4.3 "shader" slot dissapear from Output Particle Quad Node.
     
  5. espineljose

    espineljose

    Joined:
    Aug 28, 2020
    Posts:
    1
    How did you do that? I'm trying to do it but in VFX graph shader is not displayed... Captura.PNG is not displayed...
     
  6. martyglaubitz

    martyglaubitz

    Joined:
    Sep 27, 2020
    Posts:
    1
    Are you using URP or HDRP?
     
  7. VladVNeykov

    VladVNeykov

    Unity Technologies

    Joined:
    Sep 16, 2016
    Posts:
    550
    Make sure this is enabled in Preferences/Visual Effects:
     
  8. BrandoRRS

    BrandoRRS

    Joined:
    Mar 9, 2020
    Posts:
    1
    Effects, I only get VFX, how can I enable Operators/Blocks?
     

    Attached Files:

    • vfx.png
      vfx.png
      File size:
      43.4 KB
      Views:
      356
  9. VladVNeykov

    VladVNeykov

    Unity Technologies

    Joined:
    Sep 16, 2016
    Posts:
    550
    Hey @BrandoRRS ,
    Your screenshot is from the Project Settings menu. You need to look into Preferences > Visual Effects.
     

    Attached Files:

  10. wechat_os_Qy0y1ZPmNDGaQgfAkXSOnu528

    wechat_os_Qy0y1ZPmNDGaQgfAkXSOnu528

    Joined:
    May 21, 2021
    Posts:
    1
    thank you~
     
    VladVNeykov likes this.
  11. cubrman

    cubrman

    Joined:
    Jun 18, 2016
    Posts:
    412
    This feature is missing in 2023...

    If anyone is having trouble with adding custom Shader Graph shaders to a VFX Graph, here is a solution: turn on Debug mode in Inspector. Right Click on Inspector tab (usually top right corner) and choose "Debug" instead of "Normal". You will be able to find the Shader Graph slot there.
     
    Last edited: Sep 2, 2023
    InckieD likes this.
  12. Art-Leaping

    Art-Leaping

    Joined:
    Apr 2, 2015
    Posts:
    22
    In URP, you must create a different output node, instead of using the standard ones, for example "Output Particle ShaderGraph Quad":
    upload_2024-3-25_17-2-24.png upload_2024-3-25_17-2-36.png
     
    FredMoreau likes this.
  13. cubrman

    cubrman

    Joined:
    Jun 18, 2016
    Posts:
    412
    well, I'm working in HDRP - there is no such output node
     
  14. FredMoreau

    FredMoreau

    Unity Technologies

    Joined:
    May 27, 2019
    Posts:
    168
    The Output Particle ShaderGraph Context is Render Pipeline Agnostic.
    It shall be available no matter what pipeline you're using.

    What makes it work with HDRP and/or URP is how you set up the Shader Graph.
    From the docs:
    All outputs share these settings and property ports. The only exception is the Shader Graph setting which most outputs support, but not all of them.

    Specifies the Shader Graph Unity uses to render particles this output produces. If you assign a Shader Graph to this property, the Inspector hides some settings and properties that are duplicates of those in the Shader Graph. Also, the Inspector exposes all the Surface Options from the Shader Graph which allows you to edit the Shader Graph properties inside the Inspector for the context. For information on the Surface Options this adds to the Inspector, see the documentation for the type of Shader Graph you assigned. For example, if you assigned an HDRP Lit Shader Graph, see the documentation for the Lit Shader Graph.​

    Hope this helps.
     
  15. Marie_G

    Marie_G

    Unity Technologies

    Joined:
    Mar 9, 2021
    Posts:
    76
    Hello, on HDRP there should be the shadergraph dedicated output starting in 23.3, or classical output with shadergraph slot before that. It is available as soon as you check experimental features in the preferences, as mentioned by Vlad earlier.

    You can get more informations on the documentation: https://docs.unity3d.com/Packages/com.unity.visualeffectgraph@17.0/manual/sg-working-with.html
     
  16. cubrman

    cubrman

    Joined:
    Jun 18, 2016
    Posts:
    412
  17. Marie_G

    Marie_G

    Unity Technologies

    Joined:
    Mar 9, 2021
    Posts:
    76
    Hello, on 23.2.3f1 any outputs should have the shadergraph slot available, as you correctly enabled experimental features.
    As I said earlier, the dedicated shadergraph output starts on 23.3.0a5.

    Before that (which is your case on 23.2), input your compatible shadergraph in the dedicated slot in the output. Here are some examples.
    upload_2024-4-8_9-30-43.png
     
    Last edited: Apr 8, 2024
    FredMoreau likes this.