How do I undo the interpolation of vertex attributes? I'm using unity shader graph which doesn't support nointerpolation. I assume I need to store 3 float3 with one component of each float3 being 1 and the rest 0, this will give the barycentric coordinate. But I don't know how to actually use them to undo the interpolation.
Even with the barycentric coordinates, you cannot "undo" interpolation. Interpolation uses 3 input values and produces one output value: $f(A, B, C) = O$. So to reverse that would mean that you have one equation with three unknowns, ignoring the coordinate itself. You cannot solve for 3 unknowns with one equation.
If Unity's Shader Graph tool doesn't support flat interpolation, then it's probably best to solve the specific problem rather than searching for a general solution. The way to do this will be particular to exactly the effect you're trying to achieve.