I am new to Unreal Engine and I was hoping that you all could point me in the right direction. I am trying to do something that is not really built into the Unreal Engine but I was hoping that someone here could let me know if what I want to do is possible. And if there is a better spot in this forum for me to pose this question, please let me know!
So a little background, I am working on a project to create a tool to obtain optical flow information between frames. Not to go too in depth, Optical flow is the apparent motion of objects surfaces and edges in a visual scene relative to the observer. Essentially, I want to track the world space location represented by each pixel rendered in a scene from frame to frame and calculate a vector of its movement between frames.
An example: So say a scene is comprised of a cube that is spinning. The pixel I am interested in represents one corner of the cube or some specific point on an actor and has WS coordinates of (x,y,z). As the next frame renders, the cube has rotated and the corner of the cube now has WS coordinates of (x+dx , y+dy ,z+dz) and the pixel that previously represented the corner now represents some other part of the cube or scene. I want to be able to calculate (dx,dy,dz) for each pixel.
- Get WS location of each pixel rendered -> output to array
- Create a reference to the specific point on the object that the pixel represents.
- Get WS location of previously referenced point on objects in scene -> output to array
1a.Subtract WS location (x+dx,y+dy,z+dz) at frame 2 from WS location (x,y,z) at frame 1 to obtain differences(dx,dy,dz)
1b.Save array of differences
- Get WS Location of each pixel rendered in new frame
- Reset references to specific points on object that pixel represents
Repeat For all frames
Thanks a lot, your thoughts and comments are greatly appreciated!