title: C++ pointer to incomplete class type is not allowed on UTextureRenderTarget2D Unreal Engine 5 EA
body: <p>I am trying to take a Scene capture of an Unreal Project 5 Scene and send its pixel content to a compute shader to do some transformations on the rendered image. The goal of that shader would be to send a standard resolution and a high resolution image to the shader.</p>
  <p>After some research, I came across <code>USceneCaptureComponent2D</code> that could be used to generate a <code>Texture2D</code> element that could be used to extract the pixel data from the image (<a href="https://www.reddit.com/r/unrealengine/comments/dwu3sf/get_output_in_pixels_from_camera/" rel="nofollow noreferrer">https://www.reddit.com/r/unrealengine/comments/dwu3sf/get_output_in_pixels_from_camera/</a>)</p>
  <p>However, it appears that I cannot manipulate the Render Target since it has an <code>incomplete</code> type:
  <a href="https://i.stack.imgur.com/qdBSf.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/qdBSf.png" alt="error" /></a></p>
  <p>Right now, on the TickComponent method, I am getting the user's camera and setting the scene capture camera view to the latest POV of the player's camera:</p>
  <pre class="lang-cpp prettyprint-override"><code>void UComputeShaderTestComponent::TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction)
  {
      Super::TickComponent(DeltaTime, TickType, ThisTickFunction);
  
      if (UWorld* World = GetWorld())
      {
          APlayerCameraManager* PlayerCameraManager = World-&gt;GetFirstPlayerController()-&gt;PlayerCameraManager;
          SceneCapture-&gt;SetCameraView(PlayerCameraManager-&gt;GetLastFrameCameraCachePOV());
      }
  }
  </code></pre>
  <p>I was wondering if those changes were coming from UE5 and if so, is there a better way I can send all the pixels displayed on the screen to a shader?</p>
  <p>Source code of the model I am using: <a href="https://github.com/mortmaire/Unreal-Engine-Access-Render-Target" rel="nofollow noreferrer">https://github.com/mortmaire/Unreal-Engine-Access-Render-Target</a></p>
  <p>Modules I am using in the <code>Build.cs</code> file:</p>
  <pre class="lang-cs prettyprint-override"><code>PublicDependencyModuleNames.AddRange(new string[] {
              &quot;Core&quot;,
              &quot;CoreUObject&quot;,
              &quot;Engine&quot;,
              &quot;InputCore&quot;,
              &quot;RenderCore&quot;,
              &quot;RHI&quot;
          });
      
  </code></pre>
  <p>The following post suggests it could be caused by a missing module in the above list. I tried adding Renderer and it did not work.
  <a href="https://stackoverflow.com/questions/66295943/pointer-to-incomplete-class-type-is-not-allowed-unreal-engine-4-26">Pointer to incomplete class type is not allowed Unreal Engine 4.26</a></p>
  <p>Thanks!</p>