needs more shader (for smoothing out lightmap render)

This commit is contained in:
minjaesong
2017-07-04 14:58:18 +09:00
parent 9027f85d1d
commit db2fd0c8e4
8 changed files with 89 additions and 24 deletions

View File

@@ -442,12 +442,12 @@ object BlocksDrawer {
LightmapRenderer.getHighestRGB(x + 1, y - 1) ?: 0 >= tileDrawLightThreshold ||
LightmapRenderer.getHighestRGB(x - 1, y + 1) ?: 0 >= tileDrawLightThreshold)
{
// TODO coalesce non-lit black patches
// FIXME bad scanlines bug
if (zeroTileCounter > 0) {
batch.color = Color.BLACK
/*batch.color = Color.BLACK
batch.fillRect(x * TILE_SIZEF, y * TILE_SIZEF, -zeroTileCounter * TILE_SIZEF, TILE_SIZEF)
batch.color = color
zeroTileCounter = 0
zeroTileCounter = 0*/
}
@@ -508,6 +508,8 @@ object BlocksDrawer {
// draw black patch
else {
zeroTileCounter += 1 // unused for now
batch.color = Color.BLACK
batch.fillRect(x * TILE_SIZEF, y * TILE_SIZEF, TILE_SIZEF, TILE_SIZEF)
}
} // end if (not an air)
} catch (e: NullPointerException) {
@@ -517,12 +519,13 @@ object BlocksDrawer {
// hit the end of the current scanline
// FIXME bad scanlines bug
if (x == for_x_end) {
/*if (x == for_x_end) {
val x = x + 1 // because current tile is also counted
batch.color = Color.BLACK
batch.fillRect(x * TILE_SIZEF, y * TILE_SIZEF, -zeroTileCounter * TILE_SIZEF, TILE_SIZEF)
batch.color = color
zeroTileCounter = 0
}
}*/
}
}

View File

@@ -334,7 +334,7 @@ object LightmapRenderer {
while (x < this_x_end) {
// smoothing enabled and zoom is 0.75 or greater
// (zoom of 0.5 should not smoothed, for performance)
if (TerrarumGDX.getConfigBoolean("smoothlighting") &&
if (false && //TerrarumGDX.getConfigBoolean("smoothlighting") &&
TerrarumGDX.ingame!!.screenZoom >= 0.75) {
val thisLightLevel = getLightForOpaque(x, y) ?: 0