   Reconstructing pixel position
  I'm trying to reconstruct the pixel position in world space and Ive the depth and screen space pixel position...I dont know if I should use Inverse of matrix View*Projection or use a ray from near and far clips?   
  Some assumptions:M object->world space matrixV world->camera space matrixP camera->projected space matrixYou can use screen space pixel position and the depth to reconstruct the position in camera space OR you can reconstruct it from the ray from near to far frustum corners, which is interpolated over the fullscreen. Something like this:camera_space_position = ray * depthBut it doesn't matter in which space the ray exists. You can interpolate the rays in worldspace, in this case you would transform your ray in the vertex shader byray_world_space = inv(V) * ray_camera_spaceBut this may be not the best idea. There could be an issue with precision. Floats or doubles are not of endless precision, so it is best to use them near the (0,0,0) position, which is in your case camera space. Instead of using world space for your calculation, transform your data from world space into camera space, i.e. light positions can be transformed into camera space before there're uploaded to the shades.