# Copy RenderTargetTexture of FViewport (D3D11)

**URL:** <https://forums.unrealengine.com/t/copy-rendertargettexture-of-fviewport-d3d11/435941>\
**Category:** Rendering\
**Tags:** d3d11, unreal-engine, Rendering, render-target, CPP, question\
**Created:** [October 19, 2018, 8:43am UTC](https://forums.unrealengine.com/t/copy-rendertargettexture-of-fviewport-d3d11/435941 "2018-10-19T08:43:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_affb8425](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_affb8425](https://forums.unrealengine.com/u/anonymous_user_affb8425)\
**Post date:** [October 19, 2018, 8:43am UTC](https://forums.unrealengine.com/t/copy-rendertargettexture-of-fviewport-d3d11/435941/1 "2018-10-19T08:43:28Z")

</div>

Hello guys!  
I’m trying to copy RenderTargetTexture into similar Texture created by me to modify its data.  
I’m working with source code: UnrealEngine/Engine/Plugins/Runtime/Steam/SteamVR/Source/SteamVR/Private/SteamVRRenderer.cpp  
method: FSteamVRHMD::D3D11Bridge::FinishRendering()

There is available ID3D11Texture2D\* RenderTargetTexture which comes from FViewport every frame.  
I want to copy that texture to my own texture and pass it to openVR::Submit method for the next rendering stage.

I’m not familiar with internal Unreal Engine structure and capabilities of manipulating of d3d11 textures. I’ve tried to use native d3d11 method ID3D11Context::CopyResource but in vain…image on screen becomes black…

I’m ready for discuss this task and to provide additional information about it if necessary!

Thanks in advance for help!

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_affb8425](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_affb8425](https://forums.unrealengine.com/u/anonymous_user_affb8425)\
**Post date:** [October 25, 2018, 7:42am UTC](https://forums.unrealengine.com/t/copy-rendertargettexture-of-fviewport-d3d11/435941/2 "2018-10-25T07:42:20Z")

</div>

I’ve found the problem. It was incompatible DXGI&nbsp; formats between Unreal Engine 's render texture and my texture. It’s pity that d3d doesn’t warn about it when you call CopyResource method.
