From: marstr Date: Wed, 28 Aug 2024 21:27:55 +0000 (+0200) Subject: Adjustments to building rendering, adjustments to blur of element renderings, changes... X-Git-Url: https://marstr.online/code/gitweb.cgi?a=commitdiff_plain;h=c9eaf6ecb3d09bf0782d8eb361cb945bddee8977;p=orthographic Adjustments to building rendering, adjustments to blur of element renderings, changes to streams, adjustment to residential rendering, tweak to street and highway colors. --- diff --git a/Textures/building/common/brd/b1.png b/Textures/building/common/brd/b1.png new file mode 100644 index 0000000..042e585 Binary files /dev/null and b/Textures/building/common/brd/b1.png differ diff --git a/Textures/building/common/ptc/b1_p1.png b/Textures/building/common/ptc/b1_p1.png new file mode 100644 index 0000000..d7834f3 Binary files /dev/null and b/Textures/building/common/ptc/b1_p1.png differ diff --git a/Textures/building/common/ptc/b1_p2.png b/Textures/building/common/ptc/b1_p2.png new file mode 100644 index 0000000..c300cda Binary files /dev/null and b/Textures/building/common/ptc/b1_p2.png differ diff --git a/Textures/landuse/residential-boundary/brd/b1.png b/Textures/landuse/residential-boundary/brd/b1.png index 9db9a74..d48775c 100644 Binary files a/Textures/landuse/residential-boundary/brd/b1.png and b/Textures/landuse/residential-boundary/brd/b1.png differ diff --git a/Textures/landuse/residential-boundary/brd/b2.png b/Textures/landuse/residential-boundary/brd/b2.png index aae185a..544ea5b 100644 Binary files a/Textures/landuse/residential-boundary/brd/b2.png and b/Textures/landuse/residential-boundary/brd/b2.png differ diff --git a/Textures/landuse/residential-boundary/brd/b3.png b/Textures/landuse/residential-boundary/brd/b3.png index e8af885..1479f91 100644 Binary files a/Textures/landuse/residential-boundary/brd/b3.png and b/Textures/landuse/residential-boundary/brd/b3.png differ diff --git a/Textures/landuse/residential-boundary/ptc/b1_p1.png b/Textures/landuse/residential-boundary/ptc/b1_p1.png index e54040b..9881fe7 100644 Binary files a/Textures/landuse/residential-boundary/ptc/b1_p1.png and b/Textures/landuse/residential-boundary/ptc/b1_p1.png differ diff --git a/Textures/landuse/residential-boundary/ptc/b1_p2.png b/Textures/landuse/residential-boundary/ptc/b1_p2.png index cdc40ba..86fca9e 100644 Binary files a/Textures/landuse/residential-boundary/ptc/b1_p2.png and b/Textures/landuse/residential-boundary/ptc/b1_p2.png differ diff --git a/Textures/landuse/residential-boundary/ptc/b2_p1.png b/Textures/landuse/residential-boundary/ptc/b2_p1.png index bb1e769..f83810c 100644 Binary files a/Textures/landuse/residential-boundary/ptc/b2_p1.png and b/Textures/landuse/residential-boundary/ptc/b2_p1.png differ diff --git a/Textures/landuse/residential-boundary/ptc/b2_p2.png b/Textures/landuse/residential-boundary/ptc/b2_p2.png index e8f8fa7..d413d0b 100644 Binary files a/Textures/landuse/residential-boundary/ptc/b2_p2.png and b/Textures/landuse/residential-boundary/ptc/b2_p2.png differ diff --git a/Textures/landuse/residential-boundary/ptc/b3_p1.png b/Textures/landuse/residential-boundary/ptc/b3_p1.png index aeb528b..cde53d3 100644 Binary files a/Textures/landuse/residential-boundary/ptc/b3_p1.png and b/Textures/landuse/residential-boundary/ptc/b3_p1.png differ diff --git a/Textures/landuse/residential-boundary/ptc/b3_p2.png b/Textures/landuse/residential-boundary/ptc/b3_p2.png index b1b96af..1f1c1e8 100644 Binary files a/Textures/landuse/residential-boundary/ptc/b3_p2.png and b/Textures/landuse/residential-boundary/ptc/b3_p2.png differ diff --git a/defines.py b/defines.py index 10dd016..22c8909 100644 --- a/defines.py +++ b/defines.py @@ -45,10 +45,6 @@ mstr_shadow_shift = 24 # The tags that cast shadows mstr_shadow_casters = [ ("landuse", "forest"), - ("building", "yes"), - ("building", "office"), - ("building", "retail"), - ("building", "industrial"), ("leisure", "nature_reserve") ] @@ -114,9 +110,9 @@ mstr_ortho_layers = [ ("highway", "pedestrian", 4), # Z-Order 4 ("highway", "motorway", 32), - ("highway", "primary", 14), + ("highway", "primary", 25), ("highway", "secondary", 13), - ("highway", "tertiary", 12), + ("highway", "tertiary", 20), ("highway", "unclassified", 12), ("highway", "living_street", 12), ("highway", "residential", 12), @@ -136,55 +132,55 @@ mstr_ortho_layers = [ # Blur values for the single masks of the ortho layers mstr_mask_blur = [ # Z-Order 0 - ("landuse", "residential", 5), - ("boundary", "administrative", 5), + ("landuse", "residential", 30), + ("boundary", "administrative", 30), # Z-Order 1 - ("landuse", "grass", 10), - ("landuse", "cemetery", 10), - ("landuse", "greenfield", 10), - ("landuse", "orchard", 10), - ("landuse", "meadow", 10), - ("barrier", "hedge", 4), - ("landuse", "recreation_ground", 10), - ("landuse", "vineyard", 10), - ("natural", "grassland", 10), - ("natural", "wetland", 10), - ("natural", "scrub", 10), - ("natural", "heath", 10), - ("leisure", "park", 10), - ("leisure", "golf_course", 15), - ("leisure", "dog_park", 12), - ("leisure", "garden", 12), - ("leisure", "sports_centre", 12), + ("landuse", "grass", 30), + ("landuse", "cemetery", 30), + ("landuse", "greenfield", 30), + ("landuse", "orchard", 30), + ("landuse", "meadow", 30), + ("barrier", "hedge", 12), + ("landuse", "recreation_ground", 30), + ("landuse", "vineyard", 30), + ("natural", "grassland", 30), + ("natural", "wetland", 30), + ("natural", "scrub", 30), + ("natural", "heath", 30), + ("leisure", "park", 30), + ("leisure", "golf_course", 35), + ("leisure", "dog_park", 35), + ("leisure", "garden", 20), + ("leisure", "sports_centre", 15), ("leisure", "pitch", 10), - ("landuse", "farmland", 10), - ("landuse", "farmyard", 10), + ("landuse", "farmland", 15), + ("landuse", "farmyard", 15), # Z-Order 2 - ("landuse", "forest", 10), - ("leisure", "nature_reserve", 10), - ("landuse", "military", 10), + ("landuse", "forest", 30), + ("leisure", "nature_reserve", 30), + ("landuse", "military", 30), # Z-Order 3 - ("natural", "bare_rock", 12), - ("natural", "water", 12), - ("natural", "bay", 12), - ("natural", "beach", 15), - ("water", "lake", 10), - ("water", "pond", 10), - ("water", "river", 10), + ("natural", "bare_rock", 25), + ("natural", "water", 20), + ("natural", "bay", 30), + ("natural", "beach", 30), + ("water", "lake", 30), + ("water", "pond", 30), + ("water", "river", 30), ("waterway", "river", 10), - ("waterway", "stream", 8), - ("amenity", "parking", 10), - ("highway", "pedestrian", 4), + ("waterway", "stream", 10), + ("amenity", "parking", 20), + ("highway", "pedestrian", 12), # Z-Order 4 - ("highway", "motorway", 4), - ("highway", "primary", 3), - ("highway", "secondary", 2), - ("highway", "tertiary", 2), - ("highway", "unclassified", 2), - ("highway", "living_street", 4), - ("highway", "residential", 4), - ("highway", "service", 4), - ("highway", "footway", 4), + ("highway", "motorway", 5), + ("highway", "primary", 5), + ("highway", "secondary", 5), + ("highway", "tertiary", 5), + ("highway", "unclassified", 10), + ("highway", "living_street", 10), + ("highway", "residential", 10), + ("highway", "service", 5), + ("highway", "footway", 5), ("highway", "track", 3), ("highway", "path", 3), ("railway", "rail", 4), diff --git a/layergen.py b/layergen.py index 074a3f6..da6d32a 100644 --- a/layergen.py +++ b/layergen.py @@ -128,7 +128,7 @@ class mstr_layergen: # There are some things we need to use sources for, and some things, we do not. # We need to differentiate that. - if (self._isline == False and self._tag != "building") or (self._is_completion == True): + if (self._isline == False) or (self._is_completion == True): # Determine where we get the our source material from root_folder = mstr_datafolder + "Textures\\" for s in mstr_ortho_layers: @@ -245,7 +245,10 @@ class mstr_layergen: if mask_pix[x, y][3] > 0: rgb=layer_pix[x,y] a=mask_pix[x,y] - layer_comp_pix[x, y] = ( rgb[0], rgb[1], rgb[2], a[3] ) + if self._value == "residential": + layer_comp_pix[x, y] = ( rgb[0], rgb[1], rgb[2], int(a[3]/2)) + if self._value != "residential": + layer_comp_pix[x, y] = ( rgb[0], rgb[1], rgb[2], a[3]) # For some things, we will need to add a border and then add this to the layer. layer_border = None @@ -256,6 +259,18 @@ class mstr_layergen: layer_border = self.genborder(osm_edge, "landuse", "meadow") layer_comp.alpha_composite(layer_border) + # If this is the completion layer, we may add some aditional patches to the image + # for more realism + if self._is_completion == True: + cl = randrange(1, 10) + for i in range(1, cl): + p = randrange(1, 2) + ptc = Image.open(mstr_datafolder + "Textures\\tile\\completion\\p"+str(p)+".png") + rdx = randrange(1, self._imgsize-1-ptc.width) + rdy = randrange(1, self._imgsize-1-ptc.height) + layer_comp.alpha_composite(ptc, (rdx, rdy)) + + # Store layer if self._is_completion == False: layer_comp.save( mstr_datafolder + "_cache\\" + str(self._latitude) + "-" + str(self._lat_number) + "_" + str(self._longitude) + "-" + str(self._lng_number) + "_" + self._tag + "-" + self._value + "_layer.png" ) @@ -344,7 +359,7 @@ class mstr_layergen: # If we encounter one of these road-specific tags, we need to proceed differently. - if self._isline == True or self._tag == "building": + if self._isline == True: # We will need the mask in question osm_mask = Image.open( mstr_datafolder + "_cache\\" + str(self._latitude) + "-" + str(self._lat_number) + "_" + str(self._longitude) + "-" + str(self._lng_number) + "_" + self._tag + "-" + self._value + ".png" ) @@ -389,11 +404,11 @@ class mstr_layergen: d = randrange(41, 61) layer_comp_pix[x, y] = ( d,d,d,a[3] ) if self._tag == "highway": - d = randrange(81, 101) + d = randrange(160,180) layer_comp_pix[x, y] = ( d,d,d,a[3] ) if self._tag == "waterway" and (self._value == "stream" or self._value == "river"): d = randrange(1, 15) - layer_comp_pix[x, y] = ( 19-d, 62-d, 71-d, a[3] ) + layer_comp_pix[x, y] = ( 129-d, 148-d, 159-d, a[3] ) if self._tag == "building": r = randrange(1, 20)