I'm making a rendering engine as a hobby to learn more about 3D. I have a deferred renderer with the G-buffer (color, normal and depth). I also have a lighting controller that uses only spotlights at the moment. For each light, I render the depth to a texture. This works nicely, but I can't wrap my head around how to map this depth map.
Basically what I would want is a view from the camera with the light's depth map mapped in the view. I've read a ton of tutorials but cannot seem to understand this process well enough.
(BTW, I'm aiming OpenGL 3.3, so no deprecated stuff in the answers. The web is full of those already :D)