Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

Would it be possible to have the SRP culling be a job?

Discussion in '2020.2 Beta' started by forestrf, Oct 26, 2020.

  1. forestrf

    forestrf

    Joined:
    Aug 28, 2010
    Posts:
    231
    If the job system can handle doing culling, it would speed up enormously rendering several cameras, like when using split screen. Culling of extra cameras could happen on a custom SRP after the culling of the first camera is done (or even while the culling of the first camera is being done). Right now 4 cameras in split screen take several milliseconds on culling alone that could be alleviated with the multithreading the job system provides, specially given that culling could be done while filling the commandbuffers, pipelining the process
     
  2. Hyp-X

    Hyp-X

    Joined:
    Jun 24, 2015
    Posts:
    438
    If you use the built in culling system it already runs in multiple threads.

    If you use the BatchRenderer you have to write your own culling, but you can use jobs.
    The only downside is that Unity haven't released enough information to make this work...
     
  3. forestrf

    forestrf

    Joined:
    Aug 28, 2010
    Posts:
    231
    But I can't create a cull camera job, schedule it, then do other stuff and finally Complete() the the job. It's "create and complete" on a single step, so it's single thread from the API point of view

    If not, I would really like to know how I can cull a camera while filling command buffers or doing anything else, because I can't call Cull from another thread or from a job
    <https://docs.unity3d.com/ScriptReference/Rendering.ScriptableRenderContext.Cull.html>
     
  4. forestrf

    forestrf

    Joined:
    Aug 28, 2010
    Posts:
    231
    I assume there's no way to fill a command buffer or to perform culling on a job or a different thread, then. That will be a performance problem for doing splitscreen