docs.unity3d.com
    Show / Hide Table of Contents

    Class PhotosensorArray

    The role of this class is to emulate the aggregation of multiple photosensor grouped into a 2D array. This is also called a CCD or CMOS sensors. Used to capture light on each photosensor one-by-one.

    Here are some interesting references to understand better the implementation: The path tracing code in HDRP: https://blog.selfshadow.com/publications/s2016-shading-course/unity/s2016_pbs_unity_hdri_notes.pdf

    The metric of tracing rays with thick lens model is being referenced: https://www.cs.utexas.edu/~fussell/courses/cs395t/lens.pdf

    Inheritance
    Object
    NodeRuntime
    PhotosensorArray
    PhotosensorArrayNode
    Inherited Members
    NodeRuntime._parent
    NodeRuntime._portList
    NodeRuntime._queryPath
    NodeRuntime._tickCPUTimeNs
    NodeRuntime.Initialize(SystemGraphComponent)
    NodeRuntime.InternalInitialize()
    NodeRuntime.Start()
    NodeRuntime.Enable(Scheduler.ClockState)
    NodeRuntime.Disable()
    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 PhotosensorArray : NodeRuntime

    Fields

    _customPassesDesc

    Keep a list of custom pass added to the camera volume. Used to hook a unity camera just before the post processing step. We take the buffer and do the post processing step ourself in the graph.

    Declaration
    protected List<CustomPassDescriptor> _customPassesDesc
    Field Value
    Type Description
    List<CustomPassDescriptor>

    _sensorData

    Keep the photosensor array information. Useful when building a unity camera to match the description.

    Declaration
    protected PhotosensorArray.PhotosensorArrayDescription _sensorData
    Field Value
    Type Description
    PhotosensorArray.PhotosensorArrayDescription

    arrayHeight

    Declaration
    [Tooltip("Vertical number of photocells/pixels")]
    [Field("ArrayHeight", PortDirection.Left, FieldExtra.Read)]
    [SerializeField]
    protected PortType<uint> arrayHeight
    Field Value
    Type Description
    PortType<UInt32>

    arrayWidth

    Declaration
    [Tooltip("Horizontal number of photocells/pixels")]
    [Field("ArrayWidth", PortDirection.Left, FieldExtra.Read)]
    [SerializeField]
    protected PortType<uint> arrayWidth
    Field Value
    Type Description
    PortType<UInt32>

    BaseIso

    The ISO film speed value corresponding to a gain of 1.

    Declaration
    protected const int BaseIso = 1600
    Field Value
    Type Description
    Int32

    Read-only.

    DefaultExposureTime

    The amount of time the photosensor is capturing light, in seconds.

    Declaration
    public const float DefaultExposureTime = 0.005F
    Field Value
    Type Description
    Single

    The default value is 0.005. Read-only.

    DefaultGain

    The amplification factor applied to the captured light.

    Declaration
    public const float DefaultGain = 1F
    Field Value
    Type Description
    Single

    The default value is 1. Read-only.

    exposureTime

    Declaration
    [Tooltip("The amount of time the photosensor is capturing light, in seconds")]
    [Field("ExposureTime", PortDirection.Left, FieldExtra.Read)]
    [SerializeField]
    protected PortType<float> exposureTime
    Field Value
    Type Description
    PortType<Single>

    fov

    Declaration
    [Tooltip("Field of view (Driven by focal length and sensor size)")]
    [Field("Fov", PortDirection.Right, FieldExtra.Write)]
    [SerializeField]
    protected PortType<float> fov
    Field Value
    Type Description
    PortType<Single>

    gain

    Declaration
    [Tooltip("Amplification factor applied to the captured light")]
    [Field("Gain", PortDirection.Left, FieldExtra.Read)]
    [SerializeField]
    protected PortType<float> gain
    Field Value
    Type Description
    PortType<Single>

    outSamples

    Declaration
    [Tooltip("Callback from the custom pass that generate new samples.  It will call all NewSampleEvent connected to it.")]
    [Field("RGBSamples", PortDirection.Right, FieldExtra.Write)]
    [SerializeField]
    protected PortType<RenderTexture> outSamples
    Field Value
    Type Description
    PortType<RenderTexture>

    outTranscode

    Declaration
    [Field("OutTranscode", PortDirection.Right, FieldExtra.Write)]
    [SerializeField]
    protected PortType<CustomPassContext> outTranscode
    Field Value
    Type Description
    PortType<CustomPassContext>

    renderingOrder

    Declaration
    [Tooltip("Specify which camera will be rendered first when having many camera in the graph.")]
    [Field("Order", PortDirection.Left, FieldExtra.Read)]
    [SerializeField]
    protected PortType<float> renderingOrder
    Field Value
    Type Description
    PortType<Single>

    samplingRequest

    Declaration
    [Tooltip("Request the sensor to take a capture.")]
    [Field("SamplingRequest", PortDirection.Left, FieldExtra.Read | FieldExtra.ChangeEvent)]
    [SerializeField]
    protected PortType<SamplingRequest> samplingRequest
    Field Value
    Type Description
    PortType<SamplingRequest>

    sensorHeight

    Declaration
    [Tooltip("Height of the sensor in millimeters")]
    [Field("SensorHeight", PortDirection.Left, FieldExtra.Read)]
    [SerializeField]
    protected PortType<float> sensorHeight
    Field Value
    Type Description
    PortType<Single>

    sensorWidth

    Declaration
    [Tooltip("Width of the sensor in millimeters")]
    [Field("SensorWidth", PortDirection.Left, FieldExtra.Read)]
    [SerializeField]
    protected PortType<float> sensorWidth
    Field Value
    Type Description
    PortType<Single>

    Methods

    DisableOnSamplingRequestEvent()

    Disable change event on the sampling request port.

    Declaration
    protected void DisableOnSamplingRequestEvent()

    EnableOnSamplingRequestEvent()

    Enable change event on the sampling request port.

    Declaration
    protected void EnableOnSamplingRequestEvent()

    EquivalentIso(Single)

    Returns the ISO film speed equivalent to the given gain factor.

    Declaration
    public static int EquivalentIso(float gain)
    Parameters
    Type Name Description
    Single gain

    Gain factor.

    Returns
    Type Description
    Int32

    Equivalent ISO film speed.

    FillSensorDescription()

    Fill internal sensor description from the node interface.

    Declaration
    protected virtual void FillSensorDescription()

    InternalOnSamplingRequest()

    Allows any child to be notified when OnSamplingRequest is called, to add any other process.

    Declaration
    protected virtual void InternalOnSamplingRequest()
    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