diff options
| author | Dan Goodliffe <dan@randomdan.homeip.net> | 2026-02-21 00:50:31 +0000 |
|---|---|---|
| committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2026-02-21 00:50:31 +0000 |
| commit | 5b4a34cb8c272c96f94fc0d45684f675085587a6 (patch) | |
| tree | 271f0d18dd241aa7c53a221a28eababb65b32578 /game | |
| parent | Reduce shader includes, doesn't use materialInterface, just Detail (diff) | |
| download | ilt-5b4a34cb8c272c96f94fc0d45684f675085587a6.tar.bz2 ilt-5b4a34cb8c272c96f94fc0d45684f675085587a6.tar.xz ilt-5b4a34cb8c272c96f94fc0d45684f675085587a6.zip | |
Simplified Frustum
Don't need to differentiate between shadedBy by contains. The 5
plane/face variant is actually fine in both cases. For a perspective
projection, the near plane is essentially at the origin and is handled
by the left/right/top/bottom planes meeting. For the directional light
case (orthographic projection) the near plane is omitted as objects in
front of the clip space still cast shadows into it.
Also includes a fix the distance calculation to not add .w, don't know
where I got the idea this was right.
Diffstat (limited to 'game')
| -rw-r--r-- | game/terrain.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/game/terrain.cpp b/game/terrain.cpp index f10aac6..187d035 100644 --- a/game/terrain.cpp +++ b/game/terrain.cpp @@ -152,7 +152,7 @@ Terrain::shadows(const ShadowMapper & shadowMapper, const Frustum & frustum) con { shadowMapper.landmess.use(); for (const auto & [surface, sab] : meshes) { - if (frustum.shadedBy(sab.aabb)) { + if (frustum.contains(sab.aabb)) { glBindVertexArray(sab.vertexArray); glDrawElements(GL_TRIANGLES, sab.count, GL_UNSIGNED_INT, nullptr); } |
