Found a solution that worked for me. VERY DOUBTFUL THIS IS SHIPPABLE. But seemingly passable for proto! Took me hours to figure out, wanted to pass on the knowledge. Our theory is that when you’re doing PIE, multiple scene captures with the same render texture will all write to the same place, effectively overwriting each other.
If you don’t want to do ‘run under one process’, we were able to solve this by dynamically making a render texture.
In this case, we wanted to render 3D elements in each client’s hud. This reddit post roughly goes over how we made it work:
In short:
Your material should take in the render texture as a parameter
You’ll need to be able to get a reference to the object with your material on it.
You’ll also need to get a hold of your scene capture 2d component.
- In BP, CreateRenderTarget2D.
- Then find whatever has your material on it (your scope, your widget, etc…) and do GetDynamicMaterial.
- On the dynamic material, SetTextureParameterValue, plugging in your newly created render target.
- Go back to your SceneCaptureComponent2D, set TextureTarget to be your new render target