# Create material or texture from a render target in C++

**URL:** <https://forums.unrealengine.com/t/create-material-or-texture-from-a-render-target-in-c/602667>\
**Category:** Rendering\
**Tags:** Render-Targets, unreal-engine, UE5-0, question\
**Created:** [July 11, 2022, 10:39pm UTC](https://forums.unrealengine.com/t/create-material-or-texture-from-a-render-target-in-c/602667 "2022-07-11T22:39:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ultrafrog2012](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ultrafrog2012](https://forums.unrealengine.com/u/ultrafrog2012)\
**Post date:** [July 11, 2022, 10:39pm UTC](https://forums.unrealengine.com/t/create-material-or-texture-from-a-render-target-in-c/602667/1 "2022-07-11T22:39:49Z")

</div>

There are many tutorials to do this in Blueprint. But I want to dynamically change the render target in runtime. The number of render targets is also unknown before runtime. So I prefer using C++. I do not want to use an editor-only feature because I need it during gameplay.

All I want is to display what a scene capture component sees on UImage. Maybe what I am trying to do is not the right way. Thank you for your advice in advance!
