[UE 4.26]How to use custom material and texture input in custom render pass

I recently switched my work focus from Unity to Unreal, but I encountered a tricky task

I hope to add a Mask Pass in the Mobile Forward pipeline, where I will render the object’s subsurface scattering mask and other masks for screen post-processing effects.

image

But I don’t know how to write how to render the object with a specific Shader and parameters in the MaskPass, and obviously, the object will use different Shader and map inputs in the MaskPass and BasePass.

Due to my lack of knowledge of Unreal Engine rendering, I didn’t find such information. Most of the articles I found talked about the use of Custom Depth Stencil, or there was no other input to the Shader in their Custom RenderPass.

If you can provide me with relevant information, it would be very grateful.