Skip to content

t1k:unity:rendering:amplify-impostors

FieldValue
Modulerendering
Version3.1.7
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)
  • 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
API reference, enums, programmatic baking, editor scriptingapi-reference.md
DOTS integration, ECS rendering, GPU instancing, performancedots-integration.md
Advanced API patterns, batch baking, custom preset configapi-advanced-guide.md
  1. Import URP shaders first — Before baking, import AmplifyImpostors/Plugins/EditorResources/Shaders/URP Shaders 17.3.unitypackage (matches Unity 6.3)
  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
  • 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