I need some help figuring out Render Target Masking options!
Here is my scenario:
I have Object A & B in Player view
I want to show Object B in my HUD via Render Target with ALL of its post processing and lighting applied. (I don’t mind using Custom render depth passes and stencils, if needed)
I want to mask out everything else except for Object B in the HUD
Is this possible? If so, what is the material setup and Render Target options to make this happen?
I have found a few alternate ways of dealing with this for someone coming across this in future.
Method #1 - If you are going to be using these Render Targets for objects like particles then projecting them on screen space (for UI or other reasons), here is the setup:
Make your Render Textures, and Materials.
Make a Blueprint object of your particle(s) with a Scene Capture Component
Set the Render Mode to > Final Color
Disable “Atmosphere” (and whatever other irrelevant flags) under “General Show Flags”
I specified my particle component as “Show Only Component” via the Scene Render Target Blueprint node in Begin Play
This should all provide you with your particles/objects with a solid black background.
Then I marked my Material to be “Additive” which removed the black background! (See the Material setup Image below)
Method #2 - If you want post processing, and other world effects to impact the object, then here is a proposed, but relatively expensive setup:
Make two RTs, one for scene Color/Alpha and another one for your final scene output
Make your UI Material
3.Make a Blueprint with TWO Scene Capture Component setup. (I again added my SK/SMs to be the “Show Only Components” inside the Begin Play function)
Setup the first Scene Capture with “Final Color”
Setup the second Scene Capture with “Scene Color and inverse Opacity in A”