Originally Posted By: Carlos3DGS
Instead of a cube I have to make it out of 6 separate faces (but still all in the same model)?

That is it. It has to be this way because the normals of the vertex of a merged cube are not perpendicular to the faces that they are part of, instead, every vertex has a normal that is an average of the normals of the three faces that it is part of. To make this shader work, every face has to be independent and share no vertex with the other faces.

Originally Posted By: Carlos3DGS

Can you explain how the second shader works?

Of course. The normal of a plane aligned to any of the orthogonal planes (XY, XZ or YZ) has one of its coords fullfilled (1 or -1) and the other two are empty (0).
XY: 0,0,1 - XZ: 0,1,0 - YZ: 1,0,0
The shader computes the texture coords with this values, so only multiplies one of those three elements of the summation to each coordinate. That is why it does not work with not aligned faces.

Hope I explained enough and sorry for my english xP

Salud!