Prototype for Paradox-like territory maps. For educational purposes and meant to be a starting-point for those that want to create their own grand strategy games in Unity and are having difficulties on where to start.
Created following this amazing resource written by a Paradox dev that details how the Gradient borders were done in Imperator Rome: https://www.intel.com/content/dam/develop/external/us/en/documents/optimized-gradient-border-rendering-in-imperator-rome.pdf
- Faction Map Mode, where the borders are drawn only between factions, and a Province Map Mode, where borders are drawn between all provinces
-
Factions - Provinces can have two colors, a border color and a fill color
-
Easily update the colors of factions and borders, so that you can show custom map modes, such as diplomacy (green for allies, red for enemies), income (red for negative, green for positive) and etc
-
Smooth borders
- Customizable properties on the Territory Shader, for border width and alpha, fill width and alpha, etc
- Code for procedurally generating the texture lookup map. Useful for Stellaris-like games where the campaign map is procedurally generated when the campaign starts
- Create a hand-drawn texture lookup map (one color for each province) or procedurally generate it
- Pass the texture lookup map into the border detection seed shader
-
Pass the generated seed into the jump-flood algorithm shader
-
Pass the result of the jump-flood algorithm into the distance field generator shader
- Pass the generated distance field texture into the final Territory shader
- If using 8192 textures or above, there is a performance spike when refreshing the distance field texture (which as it stands, must be done every time a province changes hands or when the map mode changes from Faction borders to Province borders)
- If using 4096 textures or below, the generated distance field texture may have some gaps and artifacts in near-straight lines, which in turn affect the final borders, such as below