Automap (client) [VS plugin mod]
Revisão | a2045b2075fdfc9b50d6f6ae2bd7a227a6ea1832 (tree) |
---|---|
Hora | 2021-05-30 06:09:21 |
Autor | melchior <melchior@user...> |
Commiter | melchior |
Tweaked slope shading
@@ -126,10 +126,7 @@ namespace Automap | ||
126 | 126 | } |
127 | 127 | } else missingRainmap++; |
128 | 128 | } |
129 | - | |
130 | - ushort avgOverlap_Y = ( ushort )overlapHeightmap.OfType<ushort>( ).Average((ushort sel) => sel == 0 ? targetColMeta.YMax : sel); | |
131 | - //TODO: Row - then - Column averaging at Edges? | |
132 | - | |
129 | + | |
133 | 130 | #if DEBUG |
134 | 131 | var badHeightData = overlapHeightmap.OfType<ushort>( ).Count((ushort arg) => arg == 0); |
135 | 132 |
@@ -158,7 +155,7 @@ namespace Automap | ||
158 | 155 | continue; |
159 | 156 | } |
160 | 157 | |
161 | - float slopeBoost = 1f; | |
158 | + float slopeBoost = 0.95f; | |
162 | 159 | int northH, northWestH, westH; |
163 | 160 | |
164 | 161 | int north_X = localX + 1; |
@@ -169,12 +166,12 @@ namespace Automap | ||
169 | 166 | int northWest_Z = localZ; |
170 | 167 | bool edge = localX == 0 || localZ == 0; |
171 | 168 | |
172 | - northH = Math.Sign(localY - (overlapHeightmap[north_X, north_Z] == 0 ? localY : overlapHeightmap[north_X, north_Z])); | |
173 | - northWestH = Math.Sign(localY - (overlapHeightmap[northWest_X, northWest_Z] == 0 ? localY : overlapHeightmap[northWest_X, northWest_Z])); | |
174 | - westH = Math.Sign(localY - (overlapHeightmap[west_X, west_Z] == 0 ? localY : overlapHeightmap[west_X, west_Z])); | |
169 | + northH = Math.Sign(localY - (overlapHeightmap[north_X, north_Z] <= 1 ? localY : overlapHeightmap[north_X, north_Z])); | |
170 | + northWestH = Math.Sign(localY - (overlapHeightmap[northWest_X, northWest_Z] <= 1 ? localY : overlapHeightmap[northWest_X, northWest_Z])); | |
171 | + westH = Math.Sign(localY - (overlapHeightmap[west_X, west_Z] <= 1 ? localY : overlapHeightmap[west_X, west_Z])); | |
175 | 172 | |
176 | 173 | float slopeness = (northH + northWestH + westH); |
177 | - float tolerance = edge ? 2.0f : 0f; | |
174 | + float tolerance = edge ? 1.0f : 0f; | |
178 | 175 | |
179 | 176 | |
180 | 177 | if (slopeness > tolerance) slopeBoost = 1.2f; |