Search Unity

Custom Culling using the Scriptable Render Pipeline

Discussion in 'Graphics Experimental Previews' started by ToddRivers, Oct 3, 2018.

  1. ToddRivers

    ToddRivers

    Joined:
    Mar 15, 2013
    Posts:
    9
    Hey! I'm working on a project that needs some unique culling that's hard to do simply with layers.
    Especially useful would be the ability to only render objects from one scene at a time.

    I'm excited by the new Scriptable Render Pipeline stuff and am looking into how I could customize what gets rendered using it.
    I've had a look through the docs and this post:
    https://github.com/Unity-Technologies/ScriptableRenderPipeline/wiki/SRP-Culling

    And as I understand the ScriptableRenderContext uses a FilterResults struct representing what's going to be rendered.
    This is generated by CullResults.Cull() which takes a ScriptableCullingParameters.
    However I'm not sure how I can customize this to cull specific game objects or all objects from a scene.

    It is or will it be possible to modify FilterResults yourself? Like add / remove Renderers from it?
    Or is there any documentation or advice on how ScriptableCullingParameters class works, particularly with its sceneMask?
     
    mitaywalle and Jes28 like this.
  2. mitaywalle

    mitaywalle

    Joined:
    Jul 1, 2013
    Posts:
    84
  3. adbourdages

    adbourdages

    Joined:
    Jul 8, 2012
    Posts:
    48
    I would also like more access to the Culling methods for custom culling. My use case would be to *not* perform culling as I already know all the objects are in the camera field of view. I would like to reclaim those precious milliseconds lost to the culling step.
     
    Shikshen and Jes28 like this.
  4. Ziflin

    Ziflin

    Joined:
    Mar 12, 2013
    Posts:
    43
    I have a similar issue as the original poster. We have separate hierarchies of gameplay areas and need a way to hide them from the camera and listener. Basically we need independent worlds/scenes but we're still connecting them with OffMesh links. The objects in the separate areas still need updating, so we can't simply deactivate the root node.

    Something similar to the sceneMask sounded promising but there hasn't been any update on it.
     
  5. Ziflin

    Ziflin

    Joined:
    Mar 12, 2013
    Posts:
    43
    I'm curious if anyone has come up with a solution to this problem? We still haven't found a decent way to cull out visible or audible objects. Is there some way to set the camera and listener to only cull objects in the scene that it is in?
     
unityunity