I am trying to simulate what's known as an 'event camera' in Unreal. Unlike conventional cameras that output full frames, event cameras return the locations of pixels where activity is detected - see example below.
I have a post-process material in UE, whose job is to essentially subtracts the current image from the previous one at every tick and 'light up' all the pixels that have changed. Thus, the job of this material to identify all "moving" pixels, and after doing this subtraction, I can identify all the pixel locations that had a change in intensity.
Under the assumption that the number of changed pixels is much lesser than the total number of pixels, I want to avoid the really expensive 'ReadPixels' sort of operations in order to simulate the output of an event camera. Is it possible to access the UV positions of non-zero pixels directly? What is a good, efficient way to access such data and read it out from a material?