SHA256
Fix Single Frame Delay in Capture
This commit is contained in:
2 files changed
+10
-2
No files matched your search
@@ -1,3 +1,4 @@
|
|||||||
|
using System.Collections;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
@@ -16,10 +17,17 @@ namespace ADOFAIRenderer.Core
|
|||||||
|
|
||||||
private void LateUpdate()
|
private void LateUpdate()
|
||||||
{
|
{
|
||||||
|
StartCoroutine(PostFrameCoroutine());
|
||||||
|
}
|
||||||
|
|
||||||
|
private IEnumerator PostFrameCoroutine()
|
||||||
|
{
|
||||||
|
yield return new WaitForEndOfFrame();
|
||||||
|
|
||||||
var val = (MeshRenderer)_camQuadMeshField!.GetValue(scrCamera.instance);
|
var val = (MeshRenderer)_camQuadMeshField!.GetValue(scrCamera.instance);
|
||||||
if (RenderManager.Instance)
|
if (RenderManager.Instance)
|
||||||
{
|
{
|
||||||
RenderManager.Instance.OnPostRender(val.material.mainTexture as RenderTexture);
|
RenderManager.Instance.OnPostFrame(val.sharedMaterial.mainTexture as RenderTexture);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -293,7 +293,7 @@ namespace ADOFAIRenderer.Core
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ReSharper disable once Unity.IncorrectMethodSignature
|
// ReSharper disable once Unity.IncorrectMethodSignature
|
||||||
public void OnPostRender(RenderTexture? texture)
|
public void OnPostFrame(RenderTexture? texture)
|
||||||
{
|
{
|
||||||
if (!IsCapturing || !texture) return;
|
if (!IsCapturing || !texture) return;
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user