Depthbuffer on wireframe models

I’m doing some projection mapping and would like to be able to project the wireframe of the model onto the target however showing only the wireframe of the visible surfaces. I guess what I’m after is a sort of depth buffer for the wireframe. Is there any way to do this or will the wireframe render mode always draw the whole mesh? At the moment I’m just switching to a model containing only the visible surfaces.

Thanks!

Oli

render an identical copy using a constant shader set to black.

This will obscure non visible faces

And remember to scale it a little bit off its center point otherwise you get overlapping faces.