Files
eagle0/docs/URP_SHADER_DEBT_INVENTORY.md

9.1 KiB

URP Shader Debt Inventory

Last refreshed: 2026-06-14

This inventory classifies remaining Built-in Render Pipeline shader patterns after the completed URP switch. The project is running URP, but some package shader source files still use Built-in-era helpers or features. That is package/vendor debt, not evidence that the old pipeline is active and not an active migration blocker.

Scan Method

The scan looked for these patterns in Unity shader-like assets:

  • GrabPass
  • #pragma surface
  • UnityCG.cginc
  • UnityUI.cginc
  • UNITY_MATRIX_
  • sampler2D _GrabTexture
  • tessell
  • Tessellation

It then mapped every matching shader asset to its Unity GUID and scanned production serialized assets under:

  • Assets/Scenes/
  • Assets/Eagle/
  • Assets/Shardok/
  • Assets/ConnectionHandler/
  • Assets/UI/
  • Assets/common/
  • Assets/Tutorial/
  • Assets/Resources/
  • Assets/Materials/

This catches serialized production references. It does not prove runtime code never loads an asset by path, but it separates game-path shader debt from package/demo noise well enough to decide whether future rendering work is needed.

Summary

Bucket Shader Assets With Built-in Patterns Serialized Production References
Project-owned production shaders 0 0 referenced
Project-owned runtime-loaded shaders 0 0 serialized refs
Project-owned unreferenced shaders 0 0 referenced
TextMeshPro package shaders 17 1 referenced
Third-party/package shaders 25 0 referenced

Project-owned runtime-created materials now use serialized shader or material references for Eagle weather, Eagle fireworks, Shardok foreground UI/effects, and Shardok foreground text. Remaining production Shader.Find usage is limited to Unity/URP-provided shader names inside BeastMaterialCompatibility, plus third-party package code outside our ownership.

Completed Project-Owned Shader Hardening

These production shaders have been converted to URP-compatible HLSL and passed the Windows Unity build after merge.

Shader Production References Completion Notes
Assets/Eagle/Shaders/ProvinceMapShader.shader Assets/Eagle/Materials/ProvinceMapMaterial.mat Converted with province color, border, ocean, and UI clipping behavior preserved.
Assets/Eagle/Shaders/ProvinceWeatherMapShader.shader Assets/Eagle/Materials/ProvinceWeatherMapMaterial.mat Converted with weather lookup, overlay alignment, clipping, and initialized effect/tint values.
Assets/Eagle/Shaders/ProvinceWeatherShader.shader Assets/Eagle/Weather/BlizzardEffect.mat, Assets/Eagle/Weather/DroughtEffect.mat, Assets/Eagle/Weather/FloodEffect.mat Converted for the live drought/flood/blizzard material path.
Assets/Eagle/Shaders/ProvinceParticleShader.shader Assets/Eagle/Effects/ProvinceParticleMaterial.mat Converted for Eagle map province particles. Weather effect prefabs serialize the shared particle material instead of relying on shader-name fallback.
Assets/Eagle/Shaders/ClipRectParticleUnlit.shader Assets/Eagle/Effects/Fireworks.prefab, Assets/Eagle/Effects/ParticleAlphaBlendMaterial.mat, Assets/Eagle/Effects/ParticleStandardUnlitMaterial.mat Converted for Eagle one-shot effects and clipped particle UI paths; Fireworks serializes this shader instead of using shader-name fallback.
Assets/Eagle/maskShader.shader Formerly Assets/Eagle/Materials/map_color_nolabels.mat, Assets/Eagle/Materials/map_color_whitened.mat Deleted after confirming the serialized material path was stale.
Assets/Hex Mesh Shader.shader None Deleted after confirming no serialized or code references to the asset, shader name, or GUID.
Assets/Shardok/ShardokFireOverlay.shader Assets/Shardok/ShardokFireOverlay.mat Converted with the Shardok fire overlay layering path preserved.
Assets/Shardok/Shaders/ForegroundUIOverlay.shader Serialized Shardok foreground UI/effect shader references URP pass is serialized on the Shardok scene/container and included in ProjectSettings/GraphicsSettings.asset; the stale Built-in fallback pass has been removed.
Assets/TextMesh Pro/Resources/Shaders/TMP_SDF Overlay.shader Serialized Shardok foreground text shader references Serialized on the Shardok scene/container and included in ProjectSettings/GraphicsSettings.asset for required foreground text overlay material.

CI Guardrails

  • URPPipelineSettingsTests keeps Graphics and Quality settings on the same URP pipeline asset.
  • RuntimeShaderValidationTests keeps required runtime shader assets present, serialized Shardok foreground shader references assigned, and player-runtime-only shaders listed in Always Included Shaders.
  • WeatherEffectMaterialTests keeps Eagle flood/blizzard prefabs wired to the shared URP province particle material and prevents shader-name fallbacks from returning to those runtime paths.
  • EpidemicEffectMaterialTests keeps Eagle epidemic particles wired to the shared clipped particle material.
  • EagleMapMaterialWiringTests keeps Eagle map/weather controllers wired to the project map materials and expected URP shaders.
  • ProjectShaderPatternTests fails if project-owned Eagle/Shardok shaders reintroduce the scanned Built-in-only patterns.
  • RuntimeShaderFindUsageTests fails if project-owned Eagle/Shardok runtime scripts reintroduce shader-name lookups outside documented compatibility shims.
  • BeastMaterialCompatibilityTests keeps runtime third-party beast material conversion covered.
  • ProvinceBeastsControllerTests keeps Eagle beast content names routed to specific animated effect prefabs instead of silently falling back to the generic circling-bird effect.
  • FireworksEffectTests keeps the fireworks prefab wired to the project-owned clipped particle shader and prevents shader-name fallback from returning.
  • TutorialSpriteAssetTests keeps tutorial TMP sprite assets and the shared dialogue panel instruction sprite asset renderable.
  • ProvinceActionAnimatorSpriteTests keeps Eagle action animation sprite fields assigned in the Eagle scene.
  • PostProcessingStackRemovalTests keeps legacy Post Processing Stack v2 package and runtime/project-setting references from returning.
  • ProductionShaderReferenceTests keeps shaders with Built-in-only patterns, and materials that use them, off the production serialized asset path except for the package-managed TextMeshPro shader family.

Highest Priority: Referenced Project-Owned Shader Debt

No project-owned production shader under Assets/Eagle or Assets/Shardok currently contains the scanned Built-in-era shader patterns.

Shader Patterns Production References Recommended Action
None None None No active migration work. Re-run inventory after future rendering changes.

Referenced Package Shader

Shader Patterns Production References Recommended Action
Assets/TextMesh Pro/Resources/Shaders/TMP_Sprite.shader UnityCG.cginc, UnityUI.cginc, UNITY_MATRIX_ 16 tutorial sprite assets under Assets/Tutorial/Sprite Assets/ Leave alone unless Unity/URP surfaces a visible TextMeshPro sprite regression. Prefer package/vendor updates over hand-editing TMP package shaders.

Third-Party And Package Hits Without Serialized Production References

These files still contain Built-in-only shader patterns, but the current GUID scan did not find serialized production references. Treat them as package/demo cleanup, not as urgent game-path blockers.

Package Area Examples Patterns Recommended Action
Polytope Studio characters/weapons/props Modular NPC, armor, weapons, props shaders #pragma surface, UnityCG.cginc Keep runtime beast material compatibility in place; only import/replace vendor URP materials if we intentionally remove the compatibility shim.
Polytope Studio environment/water Water, vegetation, rock shaders GrabPass, #pragma surface, UnityCG.cginc, tessellation Ignore unless production starts referencing these assets. Water shaders are the only remaining GrabPass hits.
RRFreelance Orc/Ogre Ogre, armor, weapon shaders #pragma surface, UnityCG.cginc Current production references are handled by compatibility/material fixes; do not hand-convert unless a visible ogre regression returns.
TextMeshPro package shaders TMP SDF/bitmap/surface shaders UnityCG.cginc, UnityUI.cginc, UNITY_MATRIX_, surface shader variants Prefer package updates. Avoid editing package shaders unless a concrete TMP visual regression exists.
Clown.fat and TileableBridgePack Toony shaders, bridge cutout shader #pragma surface, UnityCG.cginc, UNITY_MATRIX_ Leave as low priority unless a production reference appears.

Maintenance Guidance

Runtime visual QA for the URP migration was completed during playtesting and known regressions from that pass were fixed. Leave unreferenced third-party/package shaders alone until they have a visible regression or production reference.

Future rendering PRs should use docs/URP_VISUAL_BASELINE_CHECKLIST.md and include affected screenshots in an ignored local directory, not in git.