Custom ObjectID pass

Hi all! I’ll try to keep it short.
We need to implement our own ObjectID pass, I set up a material that reads the custom primitive data. We’re using Movie Queue to render our beauty and depth pass so we don’t really need it to be at the same time the the game is running (this would be a plus).

Here are different things I’ve been researching and some ideas I got, any help is greatly appreciated and I’m open to new suggestions too.

  1. Render beauty pass. Replace Materials. Render ObjectID. (would need to reset the materials after so not very convenient)

  2. Modifying the surface shader so it renders an extra pass and grabbing it with a post process shader. I’d know how to do that in Unity but not sure where I’d start in Unreal.

2b. Storing the values in vertex colors and rendering that to the GBuffer.

  1. I wouldn’t mind a second camera with a material override, again, I’d know how to do this in unity but no really sure how to implement it in unreal.

  2. Modify the stencil mask to support ints higher than 255. :man_shrugging:

  3. Use PathTracing CustomData pass but couldn’t find any info in the Docs or online. (Any help here is appreciated)

Thanks!!