I’m currently working on some landscape modification tasks that utilize Compute shaders. The procedure involves obtaining the heightmap (UTexture2D), processing the heightmap into a RenderTarget using a compute shader, and then using the RenderTarget as the new heightmap.
For the RenderTarget-to-heightmap part, I currently have to read pixels back to the CPU (using ReadLinearColorPixels) and then send the pixels back to the GPU (via FHeightmapAccessor), due to my limited knowledge of Unreal RHI. However, this CPU-GPU transfer becomes a bottleneck.
Is there any way to handle the RenderTarget-to-heightmap part purely on the GPU, such as using shaders?
The procedure is running in the editor, not in-game.