Search Unity

Custom SRP Support?

Discussion in 'Visual Effect Graph' started by DepreCats, Feb 18, 2020.

  1. DepreCats

    DepreCats

    Joined:
    Jun 3, 2016
    Posts:
    39
    When will the VFX graph support SRPs that need different shader graph ports than either of these have?:

    Code (CSharp):
    1.  protected static readonly RPInfo hdrpInfo = new RPInfo
    2.         {
    3.             passInfos = new Dictionary<string, PassInfo>() {
    4.             { "Forward",new PassInfo()  { vertexPorts = new int[]{},pixelPorts = new int[]{ ShaderGraphVfxAsset.ColorSlotId, ShaderGraphVfxAsset.AlphaSlotId, ShaderGraphVfxAsset.AlphaThresholdSlotId } } },
    5.             { "DepthOnly",new PassInfo()  { vertexPorts = new int[]{},pixelPorts = new int[]{ ShaderGraphVfxAsset.AlphaSlotId, ShaderGraphVfxAsset.AlphaThresholdSlotId } } }
    6.         }
    7.         };
    8.         protected static readonly RPInfo hdrpLitInfo = new RPInfo
    9.         {
    10.             passInfos = new Dictionary<string, PassInfo>() {
    11.             { "GBuffer",new PassInfo()  { vertexPorts = new int[]{},pixelPorts = new int[]{ ShaderGraphVfxAsset.BaseColorSlotId, ShaderGraphVfxAsset.AlphaSlotId, ShaderGraphVfxAsset.MetallicSlotId, ShaderGraphVfxAsset.SmoothnessSlotId, ShaderGraphVfxAsset.EmissiveSlotId, ShaderGraphVfxAsset.NormalSlotId, ShaderGraphVfxAsset.AlphaThresholdSlotId } } },
    12.             { "Forward",new PassInfo()  { vertexPorts = new int[]{},pixelPorts = new int[]{ ShaderGraphVfxAsset.BaseColorSlotId, ShaderGraphVfxAsset.AlphaSlotId, ShaderGraphVfxAsset.MetallicSlotId, ShaderGraphVfxAsset.SmoothnessSlotId, ShaderGraphVfxAsset.EmissiveSlotId, ShaderGraphVfxAsset.NormalSlotId, ShaderGraphVfxAsset.AlphaThresholdSlotId } } },
    13.             { "DepthOnly",new PassInfo()  { vertexPorts = new int[]{},pixelPorts = new int[]{ ShaderGraphVfxAsset.AlphaSlotId, ShaderGraphVfxAsset.AlphaThresholdSlotId, ShaderGraphVfxAsset.NormalSlotId } } }
    14.         }
    15.         };
    (from: https://github.com/Unity-Technologi...r/ShaderGraph/VFXShaderGraphParticleOutput.cs)
     
  2. PaulDemeulenaere

    PaulDemeulenaere

    Unity Technologies

    Joined:
    Sep 29, 2016
    Posts:
    154
    Hi,
    We are putting efforts to make the shader graph integration more modular (also to support HDRP special cases like translucent) but I can't provide you a deadline for this feature yet.
    Are you using a Custom Scriptable Renderpipeline implemented from scratch or is it an extension of Universal Render Pipeline ?
     
  3. DepreCats

    DepreCats

    Joined:
    Jun 3, 2016
    Posts:
    39
    Basically from scratch (I built upon one of catlike coding's early SRP tutorials)
     
  4. jvidziunas

    jvidziunas

    Joined:
    Mar 25, 2013
    Posts:
    6
    Bumping/seconding, kind of frustrated at this oversight in a purportedly modular rendering framework. At minimum it looks like some of the required editor documentation is out of date-- there are fields for custom compute shaders, etc. in the project settings that are not mentioned at all in the official manual.
     
  5. jvidziunas

    jvidziunas

    Joined:
    Mar 25, 2013
    Posts:
    6
    Follow up, it still appears VFX Graph is incompatible with custom SRPs by design. The
    VFXSRPBinder
    interface is marked internal, thus new graphs cannot be constructed since there is no way to specify templates, etc.
     
  6. DepreCats

    DepreCats

    Joined:
    Jun 3, 2016
    Posts:
    39
    I assume they will make it public at some point, because there's literally no reason not to after the api is finalized.

    But it should ideally be public already (so long as they don't make any documentation about integrating the vfx graph into your own SRP), because we're grown up enough to understand it's still WIP.

    But it's pretty easy to get around the restriction by downloading it from github and modifying the AssemblyInfo file; whether or not they eventually make it public it's only a little bit of work each update. (so long as they do make it modular enough to allow further customization)
     
    jvidziunas likes this.
  7. G-Mika

    G-Mika

    Joined:
    Jul 17, 2012
    Posts:
    99
    I need this too.

    We are working on our own pipeline (SRP). Any updates on this ?

    Having a fork on URP/HDRP or a custom SRP is a good option for big studio who has good Graphics Programmer. I hope the graph will follow.
     
  8. rustinlee

    rustinlee

    Joined:
    May 31, 2014
    Posts:
    20
    This would be really nice to have.
     
  9. XRA

    XRA

    Joined:
    Aug 26, 2010
    Posts:
    265