How to render a custom scene layout only?

Hello!

When I am using a camera, I am rendering basically everything that the viewport of a camera can see. But I want to change it - I want to have a custom “area” (polygonal) which should be rendered, while all the rest should be black. Is that possible? If yes - how?

Thanks in advance!

I’m also interested in the answer to this question. I’d like to be able to render (to a render texture) all but one object in a scene.

I think you could do this with post process effects, by masking out the areas you want to remain black.

Can you indicate how do I create a custom post process effect please?