Rendering mesh into offscreen buffer

Hi, after about 2 weeks on and off of reading through all of unreal’s graphics programming documentation, as well as reading a lot of (largely uncommented) unreal rendering source code, I am still pretty much clueless as to how to render meshes into an off screen buffer then compositing that buffer over the screen one, without SceneCaptureComponent2d.

what I am trying to do is :

  • Create an off screen depth & color buffer
  • Render a few specific meshes into that buffer, not the screen one
  • Blur & distort that buffer using compute shaders
  • Combine that buffer with the screen buffer (inbetween opaque & transparent rendering)

If it were Unity this’d be a handful of documented function calls in a scriptable render pass, but on Unreal the only readable example I could find was on how to do post processing with a compute shader from a SceneViewExtension

Does anyone know how I could do any of this? preferably without modifying engine code
Thanks in advance

Hi PaperMartin,

It is possible without the SceneCaptureComponent, but it’s a real pain to implement! I’ve done it in rdLODtools (on the marketplace) for capturing the mesh frames, then run compute shaders over those - Editor Only. (It comes with source code if you wanted to look over it)

Check out the FEdtiroViewportClient:

hey, would anything you’ve done in your plugin be adaptable at least partially for use in a SceneViewExtension, or is it mostly editor only functions? if that helps, the end goal for me is to recreate the cloud rendering pipeline from Sea of Thieves The Technical Art of Sea of Thieves - YouTube (according to the devs, they didn’t have RDG or SVE at the time and had to modify engine code to implement it)
I want to do it in a SVE so the rendering code works both in editor and in game, and also to decouple the rendering code from actors

No that’s editor only I’m afraid.

Why don’t you want to use a SceneCaptureComponent2d? Is it because you need the mesh in the world? If so, it’s easy enough just to create the mesh off the level somewhere…

Mainly because SceneCaptureComponent2d is afaik basically a 2nd camera running the entire render pipeline again, whereas all I need is to render these meshes’s depth and color (no metallic, roughness, etc) then integrare the result into the main renderpipeline
Also the meshes would have to be somewhere in the levels and be rendered rom the player / editor camera’s point of view

Yeah, they’ll all be rendering the whole pipeline - at least with SceneCaptureComponent2d, the world is already created, and you can have somewhere way off the game area set up with lights etc, inside a box…

1 Like