Overhaul Map Drawing#460
Open
Azrail09Code wants to merge 19 commits into
Open
Conversation
…ng loaded in when using Parallax
…in to reduce RAM usage. Something still goes wrong with altimetry on first load - TerrainConfig isn't correct until map switch.
…d the baked lighting improvements back in now that I know they rely on Y axis normal instead of Z.
SCANUtil palette generation now copies all parameters from existing definitions before overwriting mapColor, preserving display name. All legend entry calls now made with palette references to allow recolouring. Remove duplicate code from getLegend() generation - better optimizing of block splitting required.
…s yet though in stock - will work on this.
Removed all instances of data.TerrainConfig and replaced with SCANUtil getTerrainConfig methods for CelestialBody, SCANdata and string. Change legend numbering to round to the nearest 10m instead of 100m (pesky little asteroids). Want to add dynamic rounding here so we get x significant figures instead.
…NTerrainConfig. Seriously, why define both name AND index, then overwrite the intuitive one if it doesn't match the other. Just let us define off the name.
Phantomical
reviewed
Jul 7, 2026
| string baseFolder = System.IO.Directory.GetParent(KSPUtil.ApplicationRootPath).FullName; | ||
|
|
||
| // Attempt to load heightMap | ||
| if (memoryMappedHeightMap == null && node.GetValue("heightMap") != null) |
There was a problem hiding this comment.
As a small code cleanliness suggestion, try node.TryGetValue("heightMap", out var path) instead.
Phantomical
reviewed
Jul 8, 2026
Comment on lines
+40
to
+41
| private static FieldInfo targetField; | ||
| private static FieldInfo hiddenField; |
There was a problem hiding this comment.
Because these are only set in the static constructor you can mark them as readonly. In general it's good practice to do so.
Author
|
Time to try this on CKAN! |
|
@JonnyOThan could you take a look at this when you get a chance? It looks alright to me, but I'm not that familiar with SCANsat |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Go through the old map drawing code and try streamlining it - removing duplicate instances of code drawing.
Add KSPTextureLoader support for memory mapping textures to planets based on local texture paths inside KSP (reduces the RAM overhead). Fix RealSolarSystem / Sol rendering issues with manual specified textures. Now actually usable with the high res planet packs!
Add support for DXT5 and BC5 textures (thanks Admiral!). Correctly selects Y axis from these textures if detected for normal map shading. Improved shading code for visual style to always be applies (rather than only on high vis) and remove multiple definitions.
Removed index field from scan color configs - terrain now uses only the name reference instead of the combined mess it was before. TerrainConfigs are generated with better accuracy if not specified, and display to 3sf in game instead of just to the nearest 100m (required for Sol asteroids that were less than 280m across). Also removed redundant assignment of TerrainConfigs (didn't need to be defined in a dict AND scandata. Dict now is sole defined location).
Add auto colouring of greyscale biome maps (once again thanks Admiral!). I only tweaked how these maps were assigned to make sure these wouldn't overwrite existing coloured configs and that colour references were consistent across maps.