I’d like to implement video feedback effect, i.e. capture current view to a render target (say RT_Screen) and in the very same scene, there is one plane that uses render target (RT_Screen) as texture. As frames keep being produced, it would appear infinite captures stacked one on another.
The setup is straight forward thanks to this video:
This video works fine because SceneCaptureComponent2D (which is also a camera) is in front of the displaying plane, or in another word, the displaying plane is not ‘captured’ by the SceneCaptureComponent2D.
if the SceneCaptureComponent2D is pointing at the plane, the plane is black. The RT seems to be cleared each frame.
IMO, This behavior is not right. If RT is a buffer in memory, each time we capture the screen, we simply update this buffer, and when we render the plane, we will take the content of the buffer (no matter what it is) unless we clearly states: please clear the buffer before applying to our plane. I guess this is how the video feedback is accomplished in ordinary camera (the actual hardware) which simply does nothing to the RT buffer
Not seeing a performance issue here. The cost should be constant.
Frame 1:
Use SceneCapture camera to produce a render result and save it to RT (a frame buffer). At this moment, RT texture is empty so plane is black which is fine.
Frame 2:
Now RT has some data (the previous frame), when rendering SceneCapture2D frame, we should see the plane’s texture as Frame1’s data. Not black.
This process keeps going, no extra cost at all.
This black-ness prevents our product being released, it would be wonderful if somehow we can make it transparent