Cube outline shader

Can anyone help with writing a shader to highlight the visible edges of a cube, retaining the texture.

I’ve looked at the Silhouette-Outlined Diffuse shader, but it’s not what i’m after as it highlights “around” the cube and doesn’t show all visible edges.

Thanks in advance.

I guess you should take a look at wireframe shader and combine it with diffuse shader.