diff options
author | Kae <80987908+Novaenia@users.noreply.github.com> | 2023-06-20 23:04:36 +1000 |
---|---|---|
committer | Kae <80987908+Novaenia@users.noreply.github.com> | 2023-06-20 23:04:36 +1000 |
commit | 9b75bd8eb280eb108d9eeef7a17c083a883155c7 (patch) | |
tree | 2e4fc913e30444c7f55a1c623efb456dffbefa35 /source/game/StarWorldClient.cpp | |
parent | a330802d37042160aea71353ec223600310d0eef (diff) |
fix minor culling issues
also multiply liquid light by liquid level to fix pop-in problems
Diffstat (limited to 'source/game/StarWorldClient.cpp')
-rw-r--r-- | source/game/StarWorldClient.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/source/game/StarWorldClient.cpp b/source/game/StarWorldClient.cpp index 87fc590..0dfddf8 100644 --- a/source/game/StarWorldClient.cpp +++ b/source/game/StarWorldClient.cpp @@ -412,8 +412,10 @@ void WorldClient::render(WorldRenderData& renderData, unsigned bufferTiles) { return a->entityId() < b->entityId(); }); - RectI lightRange = m_clientState.window(); - RectI tileRange = lightRange.padded(bufferTiles); + RectI window = m_clientState.window(); + RectI tileRange = window.padded(bufferTiles); + RectI lightRange = window.padded(1); + //Kae: Padded by one to fix light spread issues at the edges of the frame. renderData.tileMinPosition = tileRange.min(); renderData.lightMinPosition = lightRange.min(); @@ -461,7 +463,7 @@ void WorldClient::render(WorldRenderData& renderData, unsigned bufferTiles) { auto& tile = column[y]; Vec3F light = materialDatabase->radiantLight(tile.foreground, tile.foregroundMod); - light += liquidsDatabase->radiantLight(tile.liquid); + light += liquidsDatabase->radiantLight(tile.liquid) * tile.liquid.level; if (tile.foregroundLightTransparent) { light += materialDatabase->radiantLight(tile.background, tile.backgroundMod); if (tile.backgroundLightTransparent && pos[1] + y > undergroundLevel) |