Search Unity

Feature Request More injection points for custom passes

Discussion in 'High Definition Render Pipeline' started by designmatic, May 1, 2023.

  1. designmatic

    designmatic

    Joined:
    Aug 21, 2017
    Posts:
    9
    Dear HDRP-Team,

    Using HDRP in production we encountered one major roadblock for our team and desired art style. Namely, we want to use an outline post process / custom pass to add outlines to objects in the scene.

    However, we encounter the major issue that the custom passes do you not offer sufficient injection points. In combination with volumetric fog we cannot use an injection point that happens before the volumetric fog rendering. See the attached screenshot with using the HDRP outline sample that demonstrates the issue we encounter. You will see that the outline is not affected by the fog and is rendered on top of it.

    If you look at the official diagram you notice that most injection points are at the later stages: https://docs.unity3d.com/Packages/c...14.0/manual/Custom-Pass-Injection-Points.html

    We need an injection point after the opaque cluster but before clouds and fog. The earlier injection points are too early for an outline shader to work. As the system is already in place we would like to request to add additional injection points. Having to duplicate the HDRP package and do this changes ourselves is a lot of wasted time and we feel this an oversight on Unity’s side of things.

    Even for realistic scenarios this would be essential (e.g., outline for an interactive element).

    Thank you for your time and consideration.
     

    Attached Files:

  2. hugokostic

    hugokostic

    Joined:
    Sep 23, 2017
    Posts:
    84
  3. mgeorgedeveloper

    mgeorgedeveloper

    Joined:
    Jul 10, 2012
    Posts:
    327
  4. hugokostic

    hugokostic

    Joined:
    Sep 23, 2017
    Posts:
    84
    @mgeorgedeveloper As VolumetricClouds is not a Custom Pass, either for Transparent Object rendering order, I am think that your suggestion is a little different as it don't touch Custom Pass purpose : it's a feature request for volumetric cloud vs transparents shaders rendering order, I guess such a feature would have a cost?
    The Injection Point I suggestted would allow to procedurally inject stars or whatever in the skyColor before the clouds/fog apply, but using a fullscreen effect rather than transparent geometries.
     
    Last edited: May 3, 2023
  5. mgeorgedeveloper

    mgeorgedeveloper

    Joined:
    Jul 10, 2012
    Posts:
    327
    To explain in the context of custom pass injection points: because local clouds are rendered before other transparent objects, I thought a good solution to get the stars (VFX) rendered before the clouds, would be to use a custom pass with an appropriate injection point - but such an appropriate injection point does not exist. So I'm just talking generally here to give another example where more custom pass injection points might solve some issues (not related to your specific case, sorry)
     
  6. hugokostic

    hugokostic

    Joined:
    Sep 23, 2017
    Posts:
    84
    Sorry, I didn't get it because it is possible without transparency, to draw stars on sky : all you need is to draw a color and a "mask" channel using your emitted particle (draw mesh) into a Screen Space buffer(not camera) then use your color to be blended with skyColor using this mask channel data when you apply your CustomPass (Draw Procedural), so you will have use your "mask" channel to draw the first rendered color, like refraction do with screen color. but whatever the channel you need, you can compute them from an Unlit shader that particles draw and capture it in your buffer to be apply screen space.
    So this way you would be able to use the "Before Sky and Fog" (the Injection point I have suggested) because at this step of rendering, the sky is already colored, without volumetric clouds, so you can draw whatever you want like stars this way, And to get occlusion from dense fog/volumetric cloud naturally too.
    From my point of view you can even use Opaque shader on your VFX and don't go for CustomPass, as a star is a shiny thing, if you put an high HDR value on the emmisive, they will bloom in the sky with a normal occlusion behavior regarding cloud and blooming intensity.

    Hope it can help :)
     
    mgeorgedeveloper likes this.
  7. designmatic

    designmatic

    Joined:
    Aug 21, 2017
    Posts:
    9