Class RenderTextureReader<T> | Perception | 0.5.0-preview.1
docs.unity3d.com
    Show / Hide Table of Contents

    Class RenderTextureReader<T>

    RenderTextureReader reads a RenderTexture from the GPU each frame and passes the data back through a provided callback.

    Inheritance
    Object
    RenderTextureReader<T>
    Inherited Members
    Object.ToString()
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Namespace: UnityEngine.Perception.GroundTruth
    Syntax
    public class RenderTextureReader<T> : IDisposable where T : struct
    Type Parameters
    Name Description
    T

    The type of the raw texture data to be provided.

    Constructors

    RenderTextureReader(RenderTexture, Camera, Action<Int32, NativeArray<T>, RenderTexture>)

    Creates a new RenderTextureReader<T> for the given RenderTexture, Camera, and image readback callback

    Declaration
    public RenderTextureReader(RenderTexture source, Camera cameraRenderingToSource, Action<int, NativeArray<T>, RenderTexture> imageReadCallback)
    Parameters
    Type Name Description
    RenderTexture source

    The RenderTexture to read from.

    Camera cameraRenderingToSource

    The Camera which renders to the given renderTexture. This is used to determine when to read from the texture.

    Action<Int32, NativeArray<T>, RenderTexture> imageReadCallback

    The callback to call after reading the texture

    Methods

    Dispose()

    Shut down the reader, waiting for all requests to return.

    Declaration
    public void Dispose()
    Implements
    IDisposable.Dispose()

    WaitForAllImages()

    Synchronously wait for all image requests to complete.

    Declaration
    public void WaitForAllImages()
    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023