Shadow mapping: project world-space pixel to light-space
问题 I'm writing shadow mapping in deferred shading. Here is my depth map for directional light (orthogonal projection): Below is my full-screen quad shader to render pixel's depth in light view space: #version 330 in vec2 texCoord; out vec3 fragColor; uniform mat4 lightViewProjMat; // lightView * lightProj uniform sampler2D sceneTexture; uniform sampler2D shadowMapTexture; uniform sampler2D scenePosTexture; void main() { vec4 fragPos = texture(scenePosTexture, texCoord); vec4 fragPosLightSpace =