using System;
using UnityEngine;
///
/// A class that represents the settings when capturing accumulations.
///
[Serializable]
public class AccumulationSettings
{
///
/// The type of Shutter Profile to use for the accumulation.
///
public enum ShutterProfileType
{
///
/// Specifies the Shutter Profile as a trapezoid. The range indicates when the shutter remains fully open between linear opening and linear closing.
///
Range = 0,
///
/// Specifies the Shutter Profile as a curve through the selection of an animation curve.
///
Curve
}
///
/// Indicates whether this Recorder is set to capture and accumulate multiple sub-frames or not.
///
public bool CaptureAccumulation
{
get { return captureAccumulation; }
set { captureAccumulation = value; }
}
[SerializeField] private bool captureAccumulation;
///
/// The number of sub-frames to capture and accumulate on each final recorded frame.
///
public int Samples
{
get { return samples; }
set
{
if (value < 1)
{
throw new ArgumentOutOfRangeException();
}
samples = value;
}
}
[SerializeField, Min(1)] private int samples = 1;
///
/// The portion of the interval between two subsequent frames in which the shutter actually opens and closes according to the specified shutter profile. The value 1.0f applies the shutter profile to the whole interval between the two frames, while the value 0.0f disables the shutter and the accumulation. Any value in between proportionally rescales the shutter profile and makes the shutter remain closed for the rest of the interval to the next frame.
///
public float ShutterInterval
{
get { return shutterInterval; }
set { shutterInterval = value; }
}
[SerializeField] private float shutterInterval = 1.0f;
///
/// The type of response profile that simulates a physical motion of camera shutter: either a range or an animation curve.
///
public ShutterProfileType ShutterType
{
get { return shutterProfileType; }
set { shutterProfileType = value; }
}
[SerializeField] private ShutterProfileType shutterProfileType;
///
/// Stores an animation curve to use as the shutter profile.
///
public AnimationCurve ShutterProfileCurve
{
get { return shutterProfileCurve; }
set { shutterProfileCurve = value; }
}
[SerializeField] private AnimationCurve shutterProfileCurve = AnimationCurve.Constant(0, 1, 1);
///
/// The time when the full open state of the shutter starts, normalized to the full shutter profile length. This automatically defines the slope of the linear opening from the profile start time.
///
public float ShutterFullyOpen
{
get { return shutterFullyOpen; }
set { shutterFullyOpen = value; }
}
[SerializeField] private float shutterFullyOpen = 0.25f;
///
/// The time when the full open state of the shutter ends, normalized to the full shutter profile length. This automatically defines the slope of the linear closing to the profile end time.
///
public float ShutterBeginsClosing
{
get { return shutterBeginsClosing; }
set { shutterBeginsClosing = value; }
}
[SerializeField] private float shutterBeginsClosing = 0.75f;
///
/// Indicates whether this Recorder is set to use subpixel jitter antialiasing or not.
///
public bool UseSubPixelJitter
{
get { return useSubPixelJitter; }
set { useSubPixelJitter = value; }
}
[SerializeField] bool useSubPixelJitter = true;
}