In my vertex shader I pass through positions in world space for each vertex. I use a uniform to pass the position of the cameras in world coordinates to the fragment shader. I need both of the values there independent of the answer of the question.
now what is better practice: calulate a vec3 cameraToSurface ( world space ) in vertex shader and pass it to the fragment shader and let it be interpolated in that process? Or should I just recalculate that vector for each fragment in the fragment shader? which would be a simple ( vec3 a - vec3 b ) operation.
Basically: should I pass a vec3 from vertex to fragment shader or recalulate it there, if it is a simple difference operation? whats the cost of interpolating a vec3 between vertex and fragment shader?