]> marstr Code Repo - orthographic/commitdiff
Adjustments to building rendering, adjustments to blur of element renderings, changes...
authormarstr <marcus@marstr.online>
Wed, 28 Aug 2024 21:27:55 +0000 (23:27 +0200)
committermarstr <marcus@marstr.online>
Wed, 28 Aug 2024 21:27:55 +0000 (23:27 +0200)
14 files changed:
Textures/building/common/brd/b1.png [new file with mode: 0644]
Textures/building/common/ptc/b1_p1.png [new file with mode: 0644]
Textures/building/common/ptc/b1_p2.png [new file with mode: 0644]
Textures/landuse/residential-boundary/brd/b1.png
Textures/landuse/residential-boundary/brd/b2.png
Textures/landuse/residential-boundary/brd/b3.png
Textures/landuse/residential-boundary/ptc/b1_p1.png
Textures/landuse/residential-boundary/ptc/b1_p2.png
Textures/landuse/residential-boundary/ptc/b2_p1.png
Textures/landuse/residential-boundary/ptc/b2_p2.png
Textures/landuse/residential-boundary/ptc/b3_p1.png
Textures/landuse/residential-boundary/ptc/b3_p2.png
defines.py
layergen.py

diff --git a/Textures/building/common/brd/b1.png b/Textures/building/common/brd/b1.png
new file mode 100644 (file)
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 (file)
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 (file)
index 0000000..c300cda
Binary files /dev/null and b/Textures/building/common/ptc/b1_p2.png differ
index 9db9a74e6475dd67c2882a2b7cd52b95a1b4fa29..d48775c0f706a269c96d07b56087bbfe79b7ed2d 100644 (file)
Binary files a/Textures/landuse/residential-boundary/brd/b1.png and b/Textures/landuse/residential-boundary/brd/b1.png differ
index aae185aeef793f8a23b5b7f31c25ef57b6c33cfb..544ea5b9cae631092b7580065c6bd2662161a18e 100644 (file)
Binary files a/Textures/landuse/residential-boundary/brd/b2.png and b/Textures/landuse/residential-boundary/brd/b2.png differ
index e8af8851bb047ac6f6256cde9e8d0d3bc0ef9155..1479f91e12f07d05ae47809515f196af33e0a71a 100644 (file)
Binary files a/Textures/landuse/residential-boundary/brd/b3.png and b/Textures/landuse/residential-boundary/brd/b3.png differ
index e54040b192cea1bdc9e9bec7bea7d751557e231c..9881fe71d86bfa595a11ece82114251805293f5f 100644 (file)
Binary files a/Textures/landuse/residential-boundary/ptc/b1_p1.png and b/Textures/landuse/residential-boundary/ptc/b1_p1.png differ
index cdc40babd29806021dc4a822b4b7a1856adca0ac..86fca9e34c5400df8b851b8bbd90aada177c5395 100644 (file)
Binary files a/Textures/landuse/residential-boundary/ptc/b1_p2.png and b/Textures/landuse/residential-boundary/ptc/b1_p2.png differ
index bb1e7692ea74356705c74876f058adf70eb800ff..f83810cf9be6d89e78d8d4345b24093d031558d3 100644 (file)
Binary files a/Textures/landuse/residential-boundary/ptc/b2_p1.png and b/Textures/landuse/residential-boundary/ptc/b2_p1.png differ
index e8f8fa7ee4c093f799b73f4a6316302ace79e9aa..d413d0be00d2bb3ddf7df87f2155410f8efa0440 100644 (file)
Binary files a/Textures/landuse/residential-boundary/ptc/b2_p2.png and b/Textures/landuse/residential-boundary/ptc/b2_p2.png differ
index aeb528bf5716128a552932f7bbebc1ec7a89d2e3..cde53d335d5b500b50952d41b2e37507615377a9 100644 (file)
Binary files a/Textures/landuse/residential-boundary/ptc/b3_p1.png and b/Textures/landuse/residential-boundary/ptc/b3_p1.png differ
index b1b96afffc37ecf119417cd224d769a4c3041bb3..1f1c1e8356c800b6b53fd95fc8fc124121b4c1cd 100644 (file)
Binary files a/Textures/landuse/residential-boundary/ptc/b3_p2.png and b/Textures/landuse/residential-boundary/ptc/b3_p2.png differ
index 10dd016acb61b07bc18638065808d5e2cd8f44d4..22c8909ff3f96bf39c276f2d58d66f0058da1fcb 100644 (file)
@@ -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),
index 074a3f6ed7a6569f876f276eaab24f2b893c95da..da6d32a73bc3a3064ba95ef6d39ca21d9b62832d 100644 (file)
@@ -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)