How to exclude post processing effects from certain objects?

I’m wondering as I’ve been looking for an answer everywhere, but never found one.

How to exclude AO -for example- from certain objects like the player?

This is an available option in a lot of triple A games, take Modern Warfare 2019 for example, has this feature. Here’s a pic:

Now, how to do that in Unity?

Bump … any help?

One way to do something like that could be to use custom stencil passes and modifications to the PP shaders to get early out from pixels that contain marked objects on the stencil buffer. I’ve done this in past to get more control over where motion blur applies for example but it’s was around HDRP 6. Some effects like SSR and decals have stencil check built-in already (this is what those receive SSR etc checkboxes do on your mesh renderer).

All in all, you need to modify HDRP package to make this happen.