Hi, I am trying to render a scene with a screen, the screen should get an alpha pass so I can add things in post easily. The screen is a polygon selection of a mesh. How do I get a fitting pass? Is there a way to still keep the specular as a seperate pass?
Just do a black and white render. The polygons you want to use as a mask you give a pure white and everything else a pure black, then render that out and then you can insert it post where you want.
So, and you can forexample do a small boolean material that you put on whole scene, and you pipe it to the emission color with emission at 1.0 and render out emission AOV, this returns an RGBA render which you then insert into a single channel, the 4th ( alpha channel ) for any given post driver, or just pipe it directly as a filtering mask.
Using an RGBA switch shader with 2 slots, and a user data node that catches the 2 ID's as the Index controller.
Im using Max here, but the workflow would be identical in cinema.
You can see my selected polygons are white and scene objects that goes over it are pure black, I threw this single temporary material on whole scene, the first slot is black, and second slot is white, so now only selected custom polys with ID:2 passes as white.
You could load this temp material via an Arnold operator hook from a MaterialX file on disk, so you have it for later on if you need to do the same type of quick masking inside meshes.