diff options
-rw-r--r-- | gfx/gl/shaders/directionalLight.fs | 2 | ||||
-rw-r--r-- | gfx/gl/shadowMapper.cpp | 1 |
2 files changed, 1 insertions, 2 deletions
diff --git a/gfx/gl/shaders/directionalLight.fs b/gfx/gl/shaders/directionalLight.fs index 04715ce..d1e60ee 100644 --- a/gfx/gl/shaders/directionalLight.fs +++ b/gfx/gl/shaders/directionalLight.fs @@ -17,7 +17,7 @@ void main() { const vec3 Position = texture(gPosition, TexCoords).xyz; - const vec4 PositionInLightSpace = (lightViewProjection * vec4(Position, 1)) * 0.5 + 0.5; + const vec3 PositionInLightSpace = ((lightViewProjection * vec4(Position, 1.0f)) * 0.5 + 0.5).xyz; const float lightSpaceDepth = texture(shadowMap, PositionInLightSpace.xy).r; if (lightSpaceDepth < PositionInLightSpace.z) { discard; diff --git a/gfx/gl/shadowMapper.cpp b/gfx/gl/shadowMapper.cpp index 4acdb39..fd25dbe 100644 --- a/gfx/gl/shadowMapper.cpp +++ b/gfx/gl/shadowMapper.cpp @@ -19,7 +19,6 @@ ShadowMapper::ShadowMapper(const glm::ivec2 & s) : size {s} glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_BORDER); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_BORDER); static constexpr glm::vec3 border {std::numeric_limits<float>::infinity()}; - // static constexpr glm::vec3 border {1}; glTexParameterfv(GL_TEXTURE_2D, GL_TEXTURE_BORDER_COLOR, glm::value_ptr(border)); glBindFramebuffer(GL_FRAMEBUFFER, depthMapFBO); |