Cheaper, non-raycast ways to "take a picture" that can be processed by a script?

  1. What do you want to achieve?
    I want to make an NPC that can literally “see” what’s in front of it to be passed to a neural network that controls its behavior. Ideally, I’d like to have the neural network process what’s effectively a low-resolution image every frame (in other words, an array of values corresponding to what’s in front of it). (For context, I’m making a sort of AI toy for personal research, which I might implement or make into a game)

  2. What is the issue?
    The only method I know of to do this is to use raycasts, one for each pixel in the image. However, training a neural network will already take a fair bit of processing power, so I’m hoping to find a cheaper solution so that I can maximize the number of iterations being trained at once.

  3. What solutions have you tried so far?
    I’ve scoured the documentation on cameras and viewports to see if they could offer a cheaper solution than raycasts. Nothing I have found so far provides any alternative solution to raycasts. I also asked Assistant and it was no help, as usual–it didn’t even spit out some bad code to inspire a solution out of spite.