Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    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:
    208
    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:
    421
    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:
    208
    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:
    208
    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