I’m trying to obtain object mask for data labeling. My initial idea was to render scene a couple of times with entire scene once and with only enabled needed object. But using primId would also solve the problem if it worked. Instead i’m receiving rgba (0, 0, 0, 255)
so I have drawTarget.AddAttachment("color", GL_RGBA, GL_FLOAT, GL_RGBA);
and renderer_.SetRendererAov(TfToken("primId"));
but the whole buffer rendered with one Id.
Which returns an Rprim Path, which is an internal Hydra path and that can be mapped to the path on the original UsdStage.
Also note that in order to support instanced prims in your selection/masking setup you also need to get the instanceId buffer as well. If you look at the posted code, you can see how that is decoded, which makes it a bit more complicated.
For now I went with twice rendering to obtain mask. I guess I will need to implement object mask using primId if performance will be a concern.
I guess I can mark it as a solution than.