Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question (multiple robot simulation) Is it possible to sample camera frames without using a render texture?

Discussion in 'Scripting' started by dblaauw, Nov 28, 2022.

  1. dblaauw

    dblaauw

    Joined:
    Oct 7, 2013
    Posts:
    9
    Hi Guys!

    I'm working on a simulation project where we're simulating multiple robots in a scene. Each robot has 3x cameras attached, one main RGB camera and a stereo camera pair. We need to process the camera frames for SLAM.

    At the moment, we're attaching a RenderTexture to the camera so the camera can render to it. But as soon as we do this, the performance drops significantly, which makes simulating multiple robots challenging.

    Screenshot 2022-11-28 at 11.13.09.png

    I've done lots of research on this already, but couldn't find an alternative approach yet, really hoping someone can help us here! When it comes to actually saving the camera frames for processing, I'm using the AsyncGPUReadBack API which seems to work pretty well, much faster than using ReadPixels(), but I'm really hoping there's a more performant way of simulating multiple robot cameras in a single scene, any help or tips would be greatly appreciated!