The problem was in the expression:
foam1.x = foaminterp.x * WindCosSin.x - foaminterp.z * WindCosSin.y;
The issue was because of negative foam1.x, some videocards handle it differently. It was negative because of WindCosSin - a wind vector, its components can be negative. So I fixed it. But the code is needed to be refactored sometime.