Fixed some render-tiles not being rendered
If a render-tile is only touched by chunks with blocks at the highest point near the sky, then the render tile may not be rendered due to the chunk scan's algorithm. Chunks in rows divisible by 4 were not considering the tile above them, even though the chunk partially overlaps. This is only seen for chunks with blocks at the very top of them by the sky, and only when no other chunks would trigger that tile for rendering.
This commit is contained in:
@@ -584,24 +584,26 @@ class TileSet(object):
|
|||||||
tilecol = chunkcol - chunkcol % 2
|
tilecol = chunkcol - chunkcol % 2
|
||||||
tilerow = chunkrow - chunkrow % 4
|
tilerow = chunkrow - chunkrow % 4
|
||||||
|
|
||||||
# Determine if this chunk is in a column that spans two columns of
|
# If this chunk is in an /even/ column, then it spans two tiles.
|
||||||
# tiles, which are the even columns.
|
|
||||||
if chunkcol % 2 == 0:
|
if chunkcol % 2 == 0:
|
||||||
x_tiles = 2
|
colrange = (tilecol-2, tilecol)
|
||||||
else:
|
else:
|
||||||
x_tiles = 1
|
colrange = (tilecol,)
|
||||||
|
|
||||||
|
# If this chunk is in a row divisible by 4, then it touches the
|
||||||
|
# tile above it as well. Also touches the next 4 tiles down (16
|
||||||
|
# rows)
|
||||||
|
if chunkrow % 4 == 0:
|
||||||
|
rowrange = xrange(tilerow-4, tilerow+16+1, 4)
|
||||||
|
else:
|
||||||
|
rowrange = xrange(tilerow, tilerow+16+1, 4)
|
||||||
|
|
||||||
# Loop over all tiles that this chunk potentially touches.
|
# Loop over all tiles that this chunk potentially touches.
|
||||||
# The tile at tilecol,tilerow obviously contains the chunk, but so
|
# The tile at tilecol,tilerow obviously contains the chunk, but so
|
||||||
# do the next 4 tiles down because chunks are very tall, and maybe
|
# do the next 4 tiles down because chunks are very tall, and maybe
|
||||||
# the next column over too.
|
# the next column over too.
|
||||||
for i in xrange(x_tiles):
|
for c in colrange:
|
||||||
for j in xrange(5):
|
for r in rowrange:
|
||||||
|
|
||||||
# This loop iteration is for the tile at this column and
|
|
||||||
# row:
|
|
||||||
c = tilecol - 2*i
|
|
||||||
r = tilerow + 4*j
|
|
||||||
|
|
||||||
# Make sure the tile is in the boundary we're rendering.
|
# Make sure the tile is in the boundary we're rendering.
|
||||||
# This can happen when rendering at lower treedepth than
|
# This can happen when rendering at lower treedepth than
|
||||||
@@ -827,6 +829,22 @@ class TileSet(object):
|
|||||||
# draw the chunk!
|
# draw the chunk!
|
||||||
c_overviewer.render_loop(self.regionset, chunkx, chunkz, tileimg,
|
c_overviewer.render_loop(self.regionset, chunkx, chunkz, tileimg,
|
||||||
xpos, ypos, self.options['rendermode'], self.textures)
|
xpos, ypos, self.options['rendermode'], self.textures)
|
||||||
|
|
||||||
|
if 0:
|
||||||
|
# Draw the outline of the top of the chunk
|
||||||
|
import ImageDraw
|
||||||
|
draw = ImageDraw.Draw(tileimg)
|
||||||
|
# Draw top outline
|
||||||
|
draw.line([(192,0), (384,96)], fill='red')
|
||||||
|
draw.line([(192,0), (0,96)], fill='red')
|
||||||
|
draw.line([(0,96), (192,192)], fill='red')
|
||||||
|
draw.line([(384,96), (192,192)], fill='red')
|
||||||
|
# Draw side outline
|
||||||
|
draw.line([(0,96),(0,96+1536)], fill='red')
|
||||||
|
draw.line([(384,96),(384,96+1536)], fill='red')
|
||||||
|
# Which chunk this is:
|
||||||
|
draw.text((96,48), "C: %s,%s" % (chunkx, chunkz), fill='red')
|
||||||
|
draw.text((96,96), "c,r: %s,%s" % (col, row), fill='red')
|
||||||
|
|
||||||
# Save them
|
# Save them
|
||||||
if self.imgextension == 'jpg':
|
if self.imgextension == 'jpg':
|
||||||
@@ -848,6 +866,8 @@ class TileSet(object):
|
|||||||
|
|
||||||
chunklist = []
|
chunklist = []
|
||||||
|
|
||||||
|
# Chunks that are relevant to this tile: the 8 chunks directly in this
|
||||||
|
# tile, and the chunks from the previous 16 rows
|
||||||
rowstart = tile.row
|
rowstart = tile.row
|
||||||
rowend = rowstart+4
|
rowend = rowstart+4
|
||||||
colstart = tile.col
|
colstart = tile.col
|
||||||
@@ -870,7 +890,6 @@ class TileSet(object):
|
|||||||
if mtime:
|
if mtime:
|
||||||
# The chunk exists
|
# The chunk exists
|
||||||
yield (col, row, chunkx, chunkz, mtime)
|
yield (col, row, chunkx, chunkz, mtime)
|
||||||
|
|
||||||
|
|
||||||
def get_dirdepth(outputdir):
|
def get_dirdepth(outputdir):
|
||||||
"""Returns the current depth of the tree on disk
|
"""Returns the current depth of the tree on disk
|
||||||
|
|||||||
Reference in New Issue
Block a user