No matter what kind of transformation you apply to your vertices, the most important thing is to keep consistent; know in what space you are performing your transformations. Assuming object_matrix
is the transformation of your object and camera_matrix
the view transformation:
vec4 pos = VertexPosition;
// pos is in object space
pos = object_matrix * pos;
// pos is now in world space
pos = camera_matrix * pos;
// view space
Light coordinates are usually in world space, in which case:
pos = object_matrix * pos;
// perform diffuse lighting computations here
pos = camera_matrix * pos;
If by "skeletal matrices" you refer to skeletal animation, they're done in object space.
Hope this helps.