Skip to content

Commit

Permalink
Use aspect ratio of output instead of camera's
Browse files Browse the repository at this point in the history
  • Loading branch information
mminer committed May 23, 2021
1 parent 6f400a2 commit 7743ef8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Editor/BigCameraInput.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ protected override void NewFrameReady(RecordingSession session)
// Right: left * -1/3, right * 1
var top = camera.nearClipPlane * Mathf.Tan(camera.fieldOfView * 0.5f * Mathf.Deg2Rad);
var bottom = -top;
var left = bottom * camera.aspect;
var right = top * camera.aspect;
var left = bottom * inputSettings.AspectRatio;
var right = top * inputSettings.AspectRatio;

// How much of the final image each tile accounts for.
var horizontalTilePercent = 1f / inputSettings.Columns;
Expand Down
2 changes: 2 additions & 0 deletions Editor/BigCameraInputSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ class BigCameraInputSettings : ImageInputSettings
{
protected override Type InputType => typeof(BigCameraInput);

public float AspectRatio => (float)OutputWidth / OutputHeight;

public string CameraTag => cameraTag;

[SerializeField] string cameraTag = "MainCamera";
Expand Down

0 comments on commit 7743ef8

Please sign in to comment.