Skip to content

Commit

Permalink
Bug fix on render texture allocation
Browse files Browse the repository at this point in the history
- Fixed: Temporary render texture doesn't have proper depth.
- Improved: Supports MSAA options.
  • Loading branch information
keijiro committed Oct 31, 2018
1 parent 5dae267 commit c828499
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions Assets/FFmpegOut/Runtime/CameraCapture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,12 @@ public float frameRate {

RenderTextureFormat GetTargetFormat(Camera camera)
{
return camera.allowHDR ? RenderTextureFormat.DefaultHDR : RenderTextureFormat.Default;
return camera.allowHDR ? RenderTextureFormat.DefaultHDR : RenderTextureFormat.Default;
}

int GetAntiAliasingLevel(Camera camera)
{
return camera.allowMSAA ? QualitySettings.antiAliasing : 1;
}

#endregion
Expand Down Expand Up @@ -133,7 +138,8 @@ void Update()
// object to keep frames presented on the screen.
if (camera.targetTexture == null)
{
_tempRT = new RenderTexture(_width, _height, 0, GetTargetFormat(camera));
_tempRT = new RenderTexture(_width, _height, 24, GetTargetFormat(camera));
_tempRT.antiAliasing = GetAntiAliasingLevel(camera);
camera.targetTexture = _tempRT;
_blitter = Blitter.CreateInstance(camera);
}
Expand Down

0 comments on commit c828499

Please sign in to comment.