Skip to content

A Civilization-style strategy game about governing Israel from 15 May 1948. Real ministers, real map, every fact sourced. Unity + deterministic C# sim.

Shot rigs: the last two rigs set the aspect through ShotCamera.Configure (Refs #2882) (#3082)

Eyal Golan1ee7ab26b2b2
diff --git a/unity/Assets/Tests/EditMode/GroundDetailShots.cs b/unity/Assets/Tests/EditMode/GroundDetailShots.cs
index ce259d548..c8f29ae42 100644
--- a/unity/Assets/Tests/EditMode/GroundDetailShots.cs
+++ b/unity/Assets/Tests/EditMode/GroundDetailShots.cs
@@ -93,9 +93,10 @@ public class GroundDetailShots
yield return CivMovementShots.Boot(false, saveDir, (t, p, u, g) => { rt = t; ps = p; });
UiTexture = rt;
yield return Frames(5);
- // CameraRig.Apply freezes the projection at the camera's own aspect, and a batch run's default is 4:3: every still
- // would come out 1.33 times too wide (as UnitScaleShots). The opening's look-at follows the aspect, so it is set again.
- Camera.main.aspect = 16f / 9f;
+ // The camera takes the 1920 x 1080 frame Shot renders through ShotCamera.Configure (#2882): a batch run's default
+ // aspect is 4:3, which would draw every still 1.33 times too wide. The opening's look-at follows the aspect, so it is
+ // set again.
+ ShotCamera.Configure(Camera.main, 1920, 1080);
var rig = Camera.main.GetComponent<CameraRig>();
var opening = Object.FindFirstObjectByType<MapScene>();
rig.LookAt = CameraRig.OpeningLookAt(opening.Frame, Camera.main.aspect, opening.Settlements.First(s => s.Id == "tel_aviv"), opening.Settlements.First(s => s.Id == "jaffa"));
diff --git a/unity/Assets/Tests/EditMode/KitAtlasShots.cs b/unity/Assets/Tests/EditMode/KitAtlasShots.cs
index bc3a472ea..4c53fb143 100644
--- a/unity/Assets/Tests/EditMode/KitAtlasShots.cs
+++ b/unity/Assets/Tests/EditMode/KitAtlasShots.cs
@@ -109,12 +109,12 @@ public class KitAtlasShots
Shot(name);
}
- /// <summary>CameraRig.Apply freezes the projection at the camera's own aspect, and a batch run's default is 4:3, which would
- /// draw every still 1.33 times too wide: so the camera takes the still's aspect first, and each SHOT line states it.</summary>
+ /// <summary>A batch run's default aspect is 4:3, which would draw every still 1.33 times too wide: so the camera takes the
+ /// still's frame through ShotCamera.Configure (#2882), and each SHOT line states its aspect.</summary>
IEnumerator Boot()
{
yield return CivMovementShots.Boot(false, saveDir, (t, p, u, g) => { rt = t; ps = p; });
- Camera.main.aspect = (float)CivMovementShots.Width / CivMovementShots.Height;
+ ShotCamera.Configure(Camera.main, CivMovementShots.Width, CivMovementShots.Height);
}
[UnityTest]