Shader that makes every other pixel not render?

How can I make a shader (or is there one included?) that makes all other pixels transparent other than those on the object itself?

The object itself is invisible so the final render should be like a 3d window to what’s behind.

Shaders can only effect the object that is being rendered… unless the shader is being applied to some full-screen object for a full-screen effect. You can’t mess with “other” pixels.