浏览代码

Cleaning up RenderTextureReader.cs

/main
Jon Hogins 4 年前
当前提交
2dee2985
共有 1 个文件被更改,包括 1 次插入13 次删除
  1. 14
      com.unity.perception/Runtime/GroundTruth/RenderTextureReader.cs

14
com.unity.perception/Runtime/GroundTruth/RenderTextureReader.cs


namespace UnityEngine.Perception.GroundTruth
{
/// <summary>
/// RenderTextureReader reads a RenderTexture from the GPU each frame and passes the data back through a provided callback.
/// RenderTextureReader reads a RenderTexture from the GPU whenever Capture is called and passes the data back through a provided callback.
/// </summary>
/// <typeparam name="T">The type of the raw texture data to be provided.</typeparam>
class RenderTextureReader<T> : IDisposable where T : struct

public void Capture(ScriptableRenderContext context, Action<int, NativeArray<T>, RenderTexture> imageReadCallback)
{
// #if UNITY_EDITOR
// if (UnityEditor.EditorApplication.isPaused)
// return;
// #endif
// if (!cameras.Contains(m_CameraRenderingToSource))
// return;
//
// if (m_NextFrameToCapture > Time.frameCount)
// return;
//
// m_NextFrameToCapture = Time.frameCount + 1;
if (!GraphicsUtilities.SupportsAsyncReadback())
{
RenderTexture.active = m_Source;

正在加载...
取消
保存