Hi RhythmScript -
I think you are on the right track and all you will need to do to get your portal object selectable via CustomDepth or CustomStencil is follow these steps:
- Create a BlueprintActor
- Add the Portal Static Mesh as a Component
- Add another copy of your Portal Static Mesh as a new Component (Total of 2 copies of the same mesh right on top of one another.)
- Assign one of the Portals to use your Translucent Material
- Assign the other Portal a generic opaque material (you can use the world grid material as well)
- In the Details panel of the Opaque Mesh under rendering Uncheck Main Pass and check Render in Custom Depth (assign a Stencil if you are using that stencil)
The opaque mesh will not render in the main pass but will render in the Custom Depth pass which the Translucent Material cannot render in. This way you get your mask and keep the translucent object.
Thank You -
Eric Ketchum