Search Unity

Optimize rendering of many cameras at once

Discussion in 'General Graphics' started by AverageCG, Nov 6, 2019.

  1. AverageCG

    AverageCG

    Joined:
    Nov 13, 2017
    Posts:
    19
    Hey,

    tld: I'm looking for a breakdown of how Unity cameras render, how one could optimize rendering many cameras at once and maybe some additional sources or a trail of treats down the path of computer graphics. I just pivoted into computer graphics a few months ago and most of what i read is fairly high-abstraction / high level ideas. My general sources thus far being Akenine-Möller's "Real-Time Rendering" a wide range of research papers focused on GI as well as random internet searches.

    Sorry if this is off-topic for the Forum

    That said:
    I am currently working on implementing my own lightprobe's mostly for learning purposes and building a custom GI solution.

    With regards to this i am currently rendering these probes using standard unity cameras, and as expected the frame-rate in my very simplistic scene is already sitting at around 30 fps with about 27x6 cameras.

    This was expected, but what was not quite expected is that the camera resolution seems to have little to nothing to do with the performance. Going from 8x8 resolution renders on the cameras all the way up to 1024x1024 has no effect on the frame rate. I suppose this is due to rasterisation and the fact that my scene just consists of very few triangles (standard unity cubes that are scaled to make for a cornell box), is this correct? I also know (or tell myself i know) that this is in theory the reason why ray tracing is the prefered method for GI solutions such as Unity's coming RTXGI (which is a unity implementation of Morgan McGuires DDGI paper isn't it?)

    So, yea I'm just curious to know what bottlenecks a unity camera for example. Looking at the profiler suggests that simply waiting for commands, i.e. gfx.WaitforGfxCommandsFromMainThread / Semaphore.WaitForSignal? But what do these do and how can one optimise the rendering of many cameras at once?

    Thanks in advance!
     
  2. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    6,493
    I render 15xx images with a few millions into an atlas shader on a gt 705 in about ~800ms https://forum.unity.com/threads/best-way-to-unwrap-cubemap-to-atlas-texture.767006/#post-5139545

    Performance is impacted by drawcalls (number of object drawn roughly), fillrates (resolution x shader complexity x overdraw of polygon) and bandwidth (data send through the pipe between the various memory), depending on the platform. Then there is efficiency of data layout to avoid the gpu waiting around between task.

    While it's mobile oriented, I find ARM various doc a great entry to familiarize with these issue. https://static.docs.arm.com/100140/..._mobile_gaming_graphics_100140_0302_00_en.pdf
     
    Last edited: Nov 6, 2019
    AverageCG likes this.
  3. AverageCG

    AverageCG

    Joined:
    Nov 13, 2017
    Posts:
    19
    Hey thanks a lot, I'll have a look around :)
     
    Last edited: Nov 6, 2019