Am I passing the correct matrices for my shader? openGL/C++ On page 89 of David Wolff - OpenGL 4.0 Shading Language Cookbook book, it suggests a way to set up up a Phong shader in the fragment stage. It lists some different matrices to pass via uniform, and I suspect I might be passing slightly incorrect matrices, as my results are a bit off. This could be from somewhere else in the code of course, but I'd rather know for sure.

These are the matrices used that I'm curious about:

uniform mat4 ModelViewMatrix;
uniform mat3 NormalMatrix;
uniform mat4 MVP;


What exactly are these? At the moment I'm sending these matrices:

view*model //ModelViewMatrix;
transpose(inverse(model))) //top 3x3 row of modelview
projection*view*model //MVP;


The shader "works", but I can't get the lighting direction right.
I wasn't placing the lightposition into view space before passing it in. 

vec4 LightPosition_view=view*LightPosition; //put lp into view space with the rest


When it comes to these things, you have to think in terms of spaces, and I was multiplying the view matrix and the model matrix, into view space, but not the lightposition itself.

I hope that helps anyone else facing the same/similar problem.