docs.unity3d.com
    Show / Hide Table of Contents

    Class SegmentationAsBuffer

    The role of this class is to take an incoming render texture, extract the index from the color channel and output an index buffer accessible on CPU side.

    Inheritance
    Object
    NodeRuntime
    Transcoder
    SegmentationAsBuffer
    SegmentationAsBufferNode
    Inherited Members
    Transcoder.inTranscode
    Transcoder.outTranscode
    Transcoder._computeShader
    Transcoder._computeKernelIdx
    Transcoder.EnableInterfaceOnChangeEvent()
    Transcoder.DisableInterfaceOnChangeEvent()
    Transcoder.InitializeComputeShader(String, String)
    Transcoder.Release()
    NodeRuntime._parent
    NodeRuntime._portList
    NodeRuntime._queryPath
    NodeRuntime._tickCPUTimeNs
    NodeRuntime.Initialize(SystemGraphComponent)
    NodeRuntime.InternalInitialize()
    NodeRuntime.Start()
    NodeRuntime.OnTick(Double, Double, Scheduler.ClockState, Scheduler.Signal)
    NodeRuntime.Update()
    NodeRuntime.FixedUpdate()
    NodeRuntime.OnPortAdded(String, Type, String, PortDirection, FieldExtra, IPortType)
    NodeRuntime.OnPortRemoved(String)
    NodeRuntime.InitializeDynamicPorts(SystemGraphComponent)
    NodeRuntime.QueryPath
    NodeRuntime.TickCPUTimeNs
    NodeRuntime.PortDataList
    Namespace: Mechatronics.SensorSDK
    Syntax
    public class SegmentationAsBuffer : Transcoder

    Fields

    _outputBuffer

    Internal reference on the compute buffer used to transcode the segmentation data from a render texture into a uint buffer.

    Declaration
    protected ComputeBuffer _outputBuffer
    Field Value
    Type Description
    ComputeBuffer

    _outSegmentationBuffer

    Internal reference on the output segmentation buffer.

    Declaration
    protected SegmentationBuffer _outSegmentationBuffer
    Field Value
    Type Description
    SegmentationBuffer

    renderTexture

    Declaration
    [Tooltip("RenderTexture with segmentation data.")]
    [Field("RenderTexture", PortDirection.Left, FieldExtra.Read)]
    [SerializeField]
    protected PortType<RenderTexture> renderTexture
    Field Value
    Type Description
    PortType<RenderTexture>

    segmentationBuffer

    Declaration
    [Tooltip("Buffer with indexes.")]
    [Field("SegmentationBuffer", PortDirection.Right, FieldExtra.Write)]
    [SerializeField]
    protected PortType<SegmentationBuffer> segmentationBuffer
    Field Value
    Type Description
    PortType<SegmentationBuffer>

    Methods

    Disable()

    Deactivate change event ports and release graphic resources.

    Declaration
    public override void Disable()
    Overrides
    NodeRuntime.Disable()

    Enable(Scheduler.ClockState)

    Setup the change event on ports an load the compute shader for the data transcoding.

    Declaration
    public override void Enable(Scheduler.ClockState clockState)
    Parameters
    Type Name Description
    Scheduler.ClockState clockState

    The parameters of the waveform associated to this node

    Overrides
    NodeRuntime.Enable(Scheduler.ClockState)

    PrepareOutputBuffer(Int32)

    Create or resize the compute buffer used to store transcoded data.

    Declaration
    protected virtual void PrepareOutputBuffer(int bufferSizeRequired)
    Parameters
    Type Name Description
    Int32 bufferSizeRequired

    Size in bytes required to store the data

    Transcode(CustomPassContext)

    Run the compute shader to convert data from the render texture to the compute buffer and request a read back.

    Declaration
    protected override void Transcode(CustomPassContext ctx)
    Parameters
    Type Name Description
    CustomPassContext ctx
    Overrides
    Transcoder.Transcode(CustomPassContext)
    Back to top
    Terms of use
    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