TextureRenderTarget2D ClearColor does not working
want to clear the texture render target with specific color, when capture the scene.
am using SceneCaptureComponent2D with TextureRenderTarget2D.
I added only one PrimitiveComponent into the ShowOnlyComponents array in SceneCaptureComponent2D.
After then, I set the 'ClearColor' property of the TextureTarget as FLinearColor::Black. But it doesn't seem to be clear properly. Instead, it seams that SceneCapture clears the render target using gradation colors (like sky sphere)
I expected that the ClearColor defines the color of clear function(like glClear), am I wrong?
I decided to explore the engine sources.
When I call the CaptureScene() of the SceneCaptureComponent2D manually, the brief call chain is something like below.
=> ENQUEUE_UNIQUE_RENDER_COMMAND_THREEPARAMETER (UpdateSceneCaptureContents at SceneCaptureRendering.cpp:526)
=> RHICmdList.ClearColorTexture(Target->GetRenderTargetTexture(), FLinearColor::Black, ViewRect) (at SceneCaptureRendering.cpp:218)
Yes, when I call CaptureScene, ClearColorTexture command is followed. Even though it does not clear the texture using ClearColor property, the texture render target should be cleared.
I don't want to add another dummy actors to represent background. It is not the absolute solution.
I am appreciate your help.
asked Dec 15 '16 at 05:57 AM in Rendering
Yeah, using something like
As an added bonus, you can use the
Follow this question
Once you sign in you will be able to subscribe for any updates here