Skip to content

t1k:unity:rendering:amplify-impostors

FieldValue
Modulerendering
Version5.39.1
Effortmedium
Tools—

Keywords: Amplify, impostors, LOD, rendering

/t1k:unity:rendering:amplify-impostors

  • Impostor — A flat billboard that fakes a 3D object from pre-baked multi-angle snapshots
  • Octahedron — Impostor type mapping views onto an octahedral UV layout (best quality, recommended)
  • HemiOctahedron — Half-octahedron for ground-based objects (trees, buildings) viewed from above
  • Spherical — Traditional billboard with parallax depth (simplest, lowest quality)
  • Atlas — Texture containing all baked view angles (albedo, normals, specular, emission, depth)
  • BakePreset — ScriptableObject defining output textures, compression, and format settings

Reference guide for Amplify Impostors v1.0.3 — a component-based impostor baking tool for Unity 6. Use to replace high-poly models (Synty characters, trees, buildings) with ultra-lightweight billboards for mass-spawned DOTS entities or distant LOD levels.

Render Pipeline: URP ONLY — This project exclusively uses URP (Universal Render Pipeline). All shaders, materials, impostor baking, and rendering must target URP. Never use Built-in RP or HDRP shaders/materials. When baking impostors, always ensure URP shader package is imported (AmplifyImpostors/Plugins/EditorResources/Shaders/Runtime/URP/).

Key use case in this project: Synty PolygonKnights characters (5 SkinnedMeshRenderers + 50 bones each) are too heavy for DOTS mass spawning. Impostors reduce each unit to 1 quad (~4 tris) with baked appearance.

CRITICAL GOTCHA — URP shader must be imported + applied: Amplify ships URP shaders as .unitypackage files in AmplifyImpostors/Plugins/EditorResources/Shaders/. You MUST import the matching version (e.g., URP Shaders 17.3.unitypackage for URP 17.3). After baking, materials default to the non-URP shader (Hidden/Amplify Impostors/Octahedron Impostor) which renders pink/magenta. Run Tools/DOTSBattlefield/Fix Impostor Shaders for URP to batch-swap all materials to URP variants.

Two material strategies (in ImpostorMaterialHelper, DOTSBattlefield.Editor):

  • MonoBehaviour GameObjects (trees, LODGroups): Use GetUrpImpostorMaterial() — swaps shader to Octahedron Impostor URP, preserves view-dependent billboard rendering
  • ECS entities (units in SubScene): Use LoadOrCreateUrpLitMaterial() — creates standard URP/Lit with alpha cutout. Amplify URP shader is still NOT SRP Batcher / BRG compatible (_AI_ForwardBias cbuffer)

🚨 Amplify’s SRP support table is HARDCODED and caps at URP 17.3

Section titled “🚨 Amplify’s SRP support table is HARDCODED and caps at URP 17.3”

Root-caused + fixed 2026-07-31 (Unity 6000.5.6f1 / URP 17.5.0). Full mechanism, verified line numbers, and the fix: urp-version-detection.md (references/urp-version-detection.md).

In Plugins/Editor/AIPackageManagerHelper.cs, SRPPackageSupport (L73-84) tops out at AI_SRP_17_3 = 170300. On a newer URP, Update() (L284) computes a higher baseline (17.5.0 → 170500), the exact-match TryGetValue at L303 fails, m_packageURPVersion stays at its 0 initializer (L103), and ApplySRP() (L354-360) rewrites AmplifyImpostorsConfig.cginc to #define AI_URP_VERSION 0 — i.e. “no SRP detected”. TemplatePostProcessor (L431/L433) re-arms detection on every asset import, so this repeats on every domain reload.

⛔ Do NOT fix the .cginc — it is generated output. Hand-editing it or git checkout-ing it back does not survive one reload. The fix belongs in AIPackageManagerHelper.Update(): clamp to the newest supported baseline at-or-below the detected one instead of giving up on an exact-match miss. Prefer the clamp over adding an AI_SRP_17_5 row — Amplify ships no 17.5 shader set, so a new row would point at the 17.3 GUIDs anyway, and the clamp also survives 17.6 / 18.x.

Blast radius is smaller than the churn suggests. AI_URP_VERSION is written-but-never-read — no shipped shader branches on it (0 hits across all 40 .unitypackage payloads) — so the reset define is a symptom, not the breakage, and it was never a pink-impostor mechanism; correspondingly the fix changes zero shader bytes. The baker is independent too: AmplifyImpostor.cs never references AIPackageManagerHelper, detecting the pipeline itself via RenderPipelineManager.currentPipeline (L793/L798) and picking the shader by GUID (L64) — broken detection could not misroute a bake. The one real consequence is that CheckPackageImport(AIImportFlags.URP, …) never ran, so Amplify stopped enforcing that the on-disk URP shader set matches the detected URP; the fix restores that (plus the .cginc stops churning in git status).

Also NOT broken (checked, so nobody re-chases it): all 18 URP/core ShaderLibrary includes the Amplify URP shaders depend on (Core.hlsl, Lighting.hlsl, Shadows.hlsl, GBufferOutput.hlsl, LODCrossFade.hlsl, UnityInstancing.hlsl, …) still exist in URP 17.5. No include path moved between 17.3 and 17.5. URP is still returned by Client.List despite being a builtin package in 6000.5 (source=BuiltIn) — the builtin-package hypothesis is false.

Residual (open, low): the shaders on disk are Amplify’s 17.3 build running on URP 17.5 — Amplify ships no 17.5 set. Variants compile lazily at draw time, so a clean import is not proof; a Play-mode pass confirming LOD1 impostors are not pink/black is the honest close. This is independent of the define and would exist even with a 17.5 row in the table.

  • Creating impostors from Synty or other high-poly models
  • Setting up LOD groups with impostor as final LOD level
  • Baking impostor atlases (editor workflow or programmatic)
  • Configuring impostor atlas resolution, frame count, pixel padding
  • Optimizing distant rendering for mass-spawned entities
  • Debugging pink/missing impostor shaders (URP shader package)
  • Integrating impostors with DOTS Entities Graphics
TopicReference File
Impostor types, baking workflow, parameters, LOD integrationbaking-guide.md (references/baking-guide.md)
API reference, enums, programmatic baking, editor scriptingapi-reference.md (references/api-reference.md)
DOTS integration, ECS rendering, GPU instancing, performancedots-integration.md (references/dots-integration.md)
Advanced API patterns, batch baking, custom preset configapi-advanced-guide.md (references/api-advanced-guide.md)
URP auto-detection failure on URP > 17.3, blast radius, the clamp fixurp-version-detection.md (references/urp-version-detection.md)
  1. Import URP shaders first — Before baking, import AmplifyImpostors/Plugins/EditorResources/Shaders/URP Shaders 17.3.unitypackage. 17.3 is the newest set Amplify ships — on URP 17.5 (Unity 6000.5) it is still the correct package to import, and detection clamps down to it (see the SRP-table gotcha above)
  2. Octahedron is default — Use ImpostorType.Octahedron for characters/props. Use HemiOctahedron only for trees/foliage viewed from above
  3. 8x8 frames at 2048 — Project default (ImpostorBakeConfig). For hero characters, increase to 16x16 for more viewing angles. For mass units, reduce to 1024 resolution to save VRAM
  4. Run “Fix Impostor Shaders for URP” after baking — Baked materials default to non-URP shader. Menu: Tools/DOTSBattlefield/Fix Impostor Shaders for URP
  5. Two material strategies — MonoBehaviour: GetUrpImpostorMaterial() (Amplify URP shader). ECS entities: LoadOrCreateUrpLitMaterial() (standard URP/Lit, SRP Batcher safe)
  6. LODGroup integration — Use LODReplacement.ReplaceLast to auto-insert impostor as final LOD
  7. Bake from prefab — Add AmplifyImpostor component to prefab, set renderers, bake. Output: .asset + textures
  8. Linux baking works — Fixed in v1.0.1 (GLCore fix)
ScenarioRecommendation
Mass units (100+)8x8 frames, 1024 atlas, Octahedron
Distant trees/foliage16x16 frames, 2048 atlas, HemiOctahedron
Hero characters (close-up)16x16 frames, 2048 atlas, Octahedron
Buildings/static props8x8 frames, 2048 atlas, Octahedron

See also. This table is keyed by bake scenario; t1k:unity:optimize:assets’s pinned contract records these frame/atlas/projection combinations as having no v1 consumer, so they are not duplicated into budgets.json.

  • Synty characters need T-pose bake: Animated characters should be in bind pose when baking. Disable Animator before bake
  • SubScene baking: Impostor GameObjects (MeshFilter + MeshRenderer + impostor material) bake cleanly into ECS entities via SubScene. No SkinnedMeshRenderer = no bone overhead
  • Multiple materials: If source has multiple materials, all are baked into single atlas. No material sorting needed
  • Pixel padding: Keep at 32 (project default in ImpostorBakeConfig). Lower values (e.g. 16) cause atlas frame bleeding — visible as noise/artifacts around impostor edges, especially at distance where mipmaps kick in
  • Shadow artifacts: Use Forward Bias slider (v1.0.0+) to fix self-shadowing issues
  • Dithering crossfade: Supported for smooth LOD transitions — enable in LODGroup settings
  • Custom shader property mapping (CRITICAL — Synty): Synty materials use Synty/Generic_Basic shader with _Albedo_Map property. Amplify’s baking shader expects _BaseMap/_MainTex. Fix: ImpostorBatchBaker.NormalizeMaterialsForBaking() temporarily swaps renderers to URP/Lit with correct texture mappings (_Albedo_Map→_BaseMap, _Normal_Map→_BumpMap) before RenderAllDeferredGroups(), then restores originals
  • URP Forward+ GBuffer fallback (CRITICAL — double-lit impostors): URP/Lit in Forward/Forward+ mode has NO GBuffer pass (only 8 passes: ForwardLit, ShadowCaster, DepthOnly, etc.). Amplify’s RenderAllDeferredGroups() searches for “DEFERRED”/“GBuffer” → falls back to pass 0 (ForwardLit), which bakes FULLY LIT colors into the atlas → bright/washed-out impostors at runtime (double-lighting). Fix: Custom bake shader Assets/AmplifyImpostors/Plugins/EditorResources/Shaders/Baking/ImpostorBakeGBuffer.shader outputs raw material properties to 5 MRT targets (albedo, normalWS, specular, occlusion, emission + SV_Depth), bypassing URP lighting entirely. ImpostorBatchBaker.EnsurePresetWithBakeShader() loads global BakePreset and assigns Hidden/Impostors/Baking/GBufferBake before baking. RestorePresetBakeShader() nulls it after. The Tools/DOTSBattlefield/Bake All Impostors menu item handles this automatically
  • “Resize Textures?” dialog spam: Amplify shows EditorUtility.DisplayDialog for each impostor when resolution changes. Fix: ImpostorBatchBaker sets EditorPrefs.SetInt("IMPOSTORS_GLOBALTEXIMPORT", 1) before baking (1 = always resize), restores original value after. This EditorPref controls the behavior in AmplifyImpostor.cs:1177
  • LOD threshold tuning: Small objects (walls ~4m, obstacles ~1-3m) need very low LOD0 transition values. At 0.10f (10% screen height), these objects are almost always below threshold → impostor shown at close range. Recommended: 0.02f for LOD0 (switches to impostor when < 2% screen height), 0.005f for LOD1 cull. Large trees can use 0.15f / 0.01f
  • Bake leftover cleanup (AUTOMATIC): RenderAllDeferredGroups() creates temporary “Impostor” GameObjects at scene root during baking. ImpostorBatchBaker.CleanupLeftoverImpostorObjects() auto-deletes them after batch baking completes — no manual cleanup needed

A visible change made with this skill (UI, sprites, 3D, shaders, VFX, animation, lighting, scene layout; audio excluded) follows core rule visual-change-discord-notice:

  • Capture OLD before the first edit and NEW after the last (screen: ScreenCapture in Play mode per t1k-unity-editor-cli, windowed or Xvfb only because rendering is needed; 3D, shader, VFX: same-scene frame grab; 2D asset: the file).
  • Return the paths and a draft Discord post to the orchestrator, which posts; the PR links the post or carries visual-notice-waiver: <reason>. Logic only: “no visible change”. No capture: “screenshots pending: ”, never a fake image.