Skip to content

Commit

Permalink
Report missing tag as error + comment tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
mminer committed May 23, 2021
1 parent 8c11c00 commit 9b3fc96
Showing 1 changed file with 7 additions and 13 deletions.
20 changes: 7 additions & 13 deletions Editor/BigCameraInput.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
namespace UnityEditor.BigImageRecorder
{
/// <summary>
/// Input that divides a tagged camera's projection matrix and renders the tiles to individual render textures.
/// Recorder input that divides a camera's projection matrix and renders the tiles to individual render textures.
/// </summary>
class BigCameraInput : RecorderInput
{
Expand Down Expand Up @@ -49,8 +49,8 @@ protected override void NewFrameReady(RecordingSession session)
}
}

camera.targetTexture = originalTargetTexture;
camera.ResetProjectionMatrix();
camera.targetTexture = originalTargetTexture;
}

static RenderTexture[,] CreateOutputRenderTextures(BigCameraInputSettings inputSettings)
Expand All @@ -61,13 +61,7 @@ protected override void NewFrameReady(RecordingSession session)
{
for (var column = 0; column < inputSettings.Columns; column++)
{
var renderTexture = new RenderTexture(
inputSettings.TileWidth,
inputSettings.TileHeight,
0,
RenderTextureFormat.ARGB32,
RenderTextureReadWrite.Default);

var renderTexture = new RenderTexture(inputSettings.TileWidth, inputSettings.TileHeight, 0);
renderTexture.Create();
outputRenderTextures[row, column] = renderTexture;
}
Expand All @@ -86,9 +80,9 @@ protected override void NewFrameReady(RecordingSession session)
//
// Say we want to split the projection matrix into vertical thirds. To get the three projection matrices:
// [ | | ]
// Left: left * 1; right * -1/3
// Center: left * 1/3; right * 1/3
// Right: left * -1/3; right * 1
// Left: left * 1, right * -1/3
// Center: left * 1/3, right * 1/3
// 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;
Expand Down Expand Up @@ -139,7 +133,7 @@ static Camera GetTargetCamera(string cameraTag)
}
catch (UnityException)
{
Debug.LogWarning($"Tag '{cameraTag}' does not exist.");
Debug.LogError($"Tag '{cameraTag}' does not exist.");
return null;
}
}
Expand Down

0 comments on commit 9b3fc96

Please sign in to comment.