Search Unity

[FEATURE REQUEST] Scriptable post-processing volumes

Discussion in 'Universal Render Pipeline' started by Clavus, Jul 19, 2020.

  1. Clavus

    Clavus

    Joined:
    Jun 6, 2014
    Posts:
    62
    I'm currently using the SRP post-processing, and I noticed how it uses colliders for 'blending' volumes. It just picks the closest point on any of the colliders attached to the volume, as seen in the VolumeManager script in the render-pipelines.core package:
    upload_2020-7-19_12-31-56.png

    Now I've got a situation where I want to blend in the post-processing profile based on proximity to a bezier line. One method would be to update the sphere collider position to the point closest on the line to the camera, but that seems like a bit of a workaround. Ideally the above code from the VolumeManager is delegated to the Volume script (replace it with a method like, Volume.GetClosestDistance(Vector3 triggerPosition) or something) and allow us to override the Volume script with our own class and distance method.
     
  2. izym

    izym

    Unity Technologies

    Joined:
    Jul 27, 2013
    Posts:
    48
    Would it work for your case to approximate the bezier line using a mesh, and then use a Mesh Collider on the volume?
     
  3. Clavus

    Clavus

    Joined:
    Jun 6, 2014
    Posts:
    62
    The line is changing constantly, so I can't put a mesh over that. Plus replacing what's supposed to be a simple distance check with a full-on mesh collision calculation seems kind of wasteful. I'm just asking for the Volume distance check to be a bit more extensible, even if we could just pass in our own delegate that returns a float instead of only relying on Collider.ClosestPoint like it does now. This would allow people to build their own custom blending Volumes easily, without having to fork the whole system.
     
  4. izym

    izym

    Unity Technologies

    Joined:
    Jul 27, 2013
    Posts:
    48
    Unfortunately, it's currently not possible for us to make this overrideable without heavily impacting performance. For now, the only solution is to fork the package.