Веб-сайт самохостера Lotigara

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source/game/StarWorldClient.cpp8
-rw-r--r--source/rendering/StarTilePainter.cpp3
2 files changed, 7 insertions, 4 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)
diff --git a/source/rendering/StarTilePainter.cpp b/source/rendering/StarTilePainter.cpp
index 4b512de..dce4fac 100644
--- a/source/rendering/StarTilePainter.cpp
+++ b/source/rendering/StarTilePainter.cpp
@@ -62,7 +62,8 @@ void TilePainter::setup(WorldCamera const& camera, WorldRenderData& renderData)
m_cameraPan = renderData.geometry.diff(cameraCenter, *m_lastCameraCenter);
m_lastCameraCenter = cameraCenter;
- RectI chunkRange = RectI::integral(RectF(camera.worldTileRect()).scaled(1.0f / RenderChunkSize));
+ //Kae: Padded by one to fix culling issues with certain tile pieces at chunk borders, such as grass.
+ RectI chunkRange = RectI::integral(RectF(camera.worldTileRect().padded(1)).scaled(1.0f / RenderChunkSize));
for (int x = chunkRange.xMin(); x < chunkRange.xMax(); ++x) {
for (int y = chunkRange.yMin(); y < chunkRange.yMax(); ++y) {