Render Target Issue

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.

Any ideas?

The default tuut will make the render target real time. So, yes, if you point the camera at the render target, you’ll get strangeness…

But you can make the render target only capture a freame when you press a key, for instance.

1 Like

here is the very simple setup.

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

I think the default behavior makes sense.

If it only did one frame by default, everyone would be on here asking how to make it real-time :slight_smile:

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

Found the solution. Change SceneCapture2D’s CompositionMode from Overwrite to Composite

Thanks for your time anyway. Excellent engine Excellent community

1 Like

There definitely is a performance issue, though. It’s like having two screens, the engine has to render two points of view.

indeed. compare to no real-time capture the whole scene is rendered twice each frame

When I say no performance issue, I mean compare
a. black plane
b. plane with RT buffer data which appears to be infinite stacked like this:

For the drawing twice concern, I have tested a huge scene with RTX 3070 with real-time capture on, seems no huge impact

1 Like