Check if Pixel belongs to Object

Hey, Im writing an Echolocation Surface Shader and therefore it would be useful if I could change the shader depending on which object it hits, as different surfaces have different reflections. As far as I understand shaders, they run for each pixel in every single frame, so would it be possible to check for the pixel that I’m rendering if it belongs to a certain object?

Sounds like you would be best of using a post effect for this purpose?