Skip to content

t1k:unity:dots-rendering:perspective-isometric

FieldValue
Moduledots-rendering
Version2.1.7
Efforthigh
Tools

Keywords: 2.5D, DOTS, isometric, perspective

/t1k:unity:dots-rendering:perspective-isometric

  • Isometric, dimetric, 3/4 view, billboard sprite, BillboardSprite shader
  • Perspective camera with tilt angle, billboard quad rendering
  • DOTS instancing, _Cutoff instanced property
  • Simulation: XZ plane (always). Navigation, physics, AI on XZ
  • Presentation: Perspective camera tilted ~30 degrees. Sprites on billboard quads that always face camera
  • No coordinate remapping — camera angle provides the isometric look naturally
  • Perspective (not orthographic) with ~60 degree FOV
  • Position: (0, height, -backOffset), rotation: (TiltAngle, 0, 0)
  • Auto-zoom: adjust distance based on battle AABB extents and FOV
  • Smooth lerp position and distance -> See references/isometric-camera-guide.md
  • BillboardSprite.shader — custom HLSL shader in dots-rpg/Runtime/Rendering/
  • 3 URP passes: Forward, ShadowCaster, DepthOnly
  • Billboard vertex transform: offset from object center along camera right/up vectors
  • _Cutoff is DOTS-instanced for per-entity alpha clip control
  • Cutout rendering (AlphaTest queue) for SRP Batcher compatibility -> See references/isometric-rendering-guide.md
  • Standard XZ NavMeshSurface on visible ground plane
  • NavigationAuthoring.EnableGrounding = false (flat billboard quads, no Y physics)
  • Obstacles are visible 3D cubes with URP/Lit materials (unlike 2D where they are invisible)
  • NavMeshObstacle.carving = true + (StaticEditorFlags)8 + area 1 (Not Walkable)
  • SpriteAnimationAuthoring for sprite sheet UV animation (same as 2D)
  • Front-facing character silhouette sprites (not side-profile like side-view)
  • Billboard shader handles camera-facing orientation automatically
  • Direction-aware sprites possible via multiple sprite sheets + facing direction
// Object center in world space
float3 centerWS = TransformObjectToWorld(float3(0, 0, 0));
// Extract per-axis scale from object-to-world matrix
float3 scaleX = float3(UNITY_MATRIX_M[0][0], UNITY_MATRIX_M[1][0], UNITY_MATRIX_M[2][0]);
float3 scaleY = float3(UNITY_MATRIX_M[0][1], UNITY_MATRIX_M[1][1], UNITY_MATRIX_M[2][1]);
// Camera right and up vectors
float3 camRight = normalize(UNITY_MATRIX_V[0].xyz);
float3 camUp = normalize(UNITY_MATRIX_V[1].xyz);
// Billboard: offset from center along camera-plane axes
float3 worldPos = centerWS
+ camRight * input.positionOS.x * length(scaleX)
+ camUp * input.positionOS.y * length(scaleY);
#ifdef DOTS_INSTANCING_ON
UNITY_DOTS_INSTANCING_START(MaterialPropertyMetadata)
UNITY_DOTS_INSTANCED_PROP(float4, _BaseMap_ST)
UNITY_DOTS_INSTANCED_PROP(float4, _BaseColor)
UNITY_DOTS_INSTANCED_PROP(float , _Cutoff)
UNITY_DOTS_INSTANCING_END(MaterialPropertyMetadata)
#endif
#IssueFix
1Billboard shader needs #pragma target 4.5 for DOTS instancingWithout it, UNITY_DOTS_INSTANCED_PROP macros fail silently
2Shadow acne on billboard quadsUse ApplyShadowBias() in ShadowCaster pass with billboard normal
3Billboard normal for shadows = -normalize(UNITY_MATRIX_V[2].xyz)Camera forward as approximate face normal
4Cull Off required on all passesBillboard quads can face either direction relative to light
5Ground material uses URP/Lit (not Unlit)Iso view shows ground surface, needs lighting
  • dots-ecs — ECS fundamentals
  • dots-rpg — BillboardSprite.shader, SpriteAnimation components
  • dots-graphics — DOTS instancing, MaterialProperty overrides
  • dots-shader — Custom HLSL shader authoring agent
  • unity-urp — URP shader library, render passes
  • agents-navigation — XZ pathfinding
FileCoverage
references/isometric-rendering-guide.mdBillboard shader, DOTS instancing, cutout materials, shadow pass
references/isometric-camera-guide.mdPerspective iso camera, auto-zoom, tilt math, FOV-based framing