diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2022-12-06 18:11:13 +0000 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2022-12-06 18:11:13 +0000 |
commit | e247d3a28db3d222ff932d78ecf2208616bfd7a8 (patch) | |
tree | 95916582c5ed7670afe26fde6249b34fda2be6bc /gfx/gl | |
parent | Disable depth test, remove unnecesary texture binds and clear for lighting pass (diff) | |
download | ilt-e247d3a28db3d222ff932d78ecf2208616bfd7a8.tar.bz2 ilt-e247d3a28db3d222ff932d78ecf2208616bfd7a8.tar.xz ilt-e247d3a28db3d222ff932d78ecf2208616bfd7a8.zip |
Tidy up
Diffstat (limited to 'gfx/gl')
-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); |