This commit is contained in:
2025-11-14 18:44:06 +08:00
parent 10156da245
commit 22e867d077
7013 changed files with 2572882 additions and 1804 deletions

View File

@@ -0,0 +1,71 @@
using System;
namespace UnityEngine.PostProcessing
{
[Serializable]
public class AmbientOcclusionModel : PostProcessingModel
{
public enum SampleCount
{
Lowest = 3,
Low = 6,
Medium = 10,
High = 16
}
[Serializable]
public struct Settings
{
[Range(0, 4), Tooltip("Degree of darkness produced by the effect.")]
public float intensity;
[Min(1e-4f), Tooltip("Radius of sample points, which affects extent of darkened areas.")]
public float radius;
[Tooltip("Number of sample points, which affects quality and performance.")]
public SampleCount sampleCount;
[Tooltip("Halves the resolution of the effect to increase performance at the cost of visual quality.")]
public bool downsampling;
[Tooltip("Forces compatibility with Forward rendered objects when working with the Deferred rendering path.")]
public bool forceForwardCompatibility;
[Tooltip("Enables the ambient-only mode in that the effect only affects ambient lighting. This mode is only available with the Deferred rendering path and HDR rendering.")]
public bool ambientOnly;
[Tooltip("Toggles the use of a higher precision depth texture with the forward rendering path (may impact performances). Has no effect with the deferred rendering path.")]
public bool highPrecision;
public static Settings defaultSettings
{
get
{
return new Settings
{
intensity = 1f,
radius = 0.3f,
sampleCount = SampleCount.Medium,
downsampling = true,
forceForwardCompatibility = false,
ambientOnly = false,
highPrecision = false
};
}
}
}
[SerializeField]
Settings m_Settings = Settings.defaultSettings;
public Settings settings
{
get { return m_Settings; }
set { m_Settings = value; }
}
public override void Reset()
{
m_Settings = Settings.defaultSettings;
}
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 564228afc5cbd5f49beb80038b4b7af2
timeCreated: 1462280796
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,242 @@
using System;
namespace UnityEngine.PostProcessing
{
[Serializable]
public class AntialiasingModel : PostProcessingModel
{
public enum Method
{
Fxaa,
Taa
}
// Most settings aren't exposed to the user anymore, presets are enough. Still, I'm leaving
// the tooltip attributes in case an user wants to customize each preset.
#region FXAA Settings
public enum FxaaPreset
{
ExtremePerformance,
Performance,
Default,
Quality,
ExtremeQuality
}
[Serializable]
public struct FxaaQualitySettings
{
[Tooltip("The amount of desired sub-pixel aliasing removal. Effects the sharpeness of the output.")]
[Range(0f, 1f)]
public float subpixelAliasingRemovalAmount;
[Tooltip("The minimum amount of local contrast required to qualify a region as containing an edge.")]
[Range(0.063f, 0.333f)]
public float edgeDetectionThreshold;
[Tooltip("Local contrast adaptation value to disallow the algorithm from executing on the darker regions.")]
[Range(0f, 0.0833f)]
public float minimumRequiredLuminance;
public static FxaaQualitySettings[] presets =
{
// ExtremePerformance
new FxaaQualitySettings
{
subpixelAliasingRemovalAmount = 0f,
edgeDetectionThreshold = 0.333f,
minimumRequiredLuminance = 0.0833f
},
// Performance
new FxaaQualitySettings
{
subpixelAliasingRemovalAmount = 0.25f,
edgeDetectionThreshold = 0.25f,
minimumRequiredLuminance = 0.0833f
},
// Default
new FxaaQualitySettings
{
subpixelAliasingRemovalAmount = 0.75f,
edgeDetectionThreshold = 0.166f,
minimumRequiredLuminance = 0.0833f
},
// Quality
new FxaaQualitySettings
{
subpixelAliasingRemovalAmount = 1f,
edgeDetectionThreshold = 0.125f,
minimumRequiredLuminance = 0.0625f
},
// ExtremeQuality
new FxaaQualitySettings
{
subpixelAliasingRemovalAmount = 1f,
edgeDetectionThreshold = 0.063f,
minimumRequiredLuminance = 0.0312f
}
};
}
[Serializable]
public struct FxaaConsoleSettings
{
[Tooltip("The amount of spread applied to the sampling coordinates while sampling for subpixel information.")]
[Range(0.33f, 0.5f)]
public float subpixelSpreadAmount;
[Tooltip("This value dictates how sharp the edges in the image are kept; a higher value implies sharper edges.")]
[Range(2f, 8f)]
public float edgeSharpnessAmount;
[Tooltip("The minimum amount of local contrast required to qualify a region as containing an edge.")]
[Range(0.125f, 0.25f)]
public float edgeDetectionThreshold;
[Tooltip("Local contrast adaptation value to disallow the algorithm from executing on the darker regions.")]
[Range(0.04f, 0.06f)]
public float minimumRequiredLuminance;
public static FxaaConsoleSettings[] presets =
{
// ExtremePerformance
new FxaaConsoleSettings
{
subpixelSpreadAmount = 0.33f,
edgeSharpnessAmount = 8f,
edgeDetectionThreshold = 0.25f,
minimumRequiredLuminance = 0.06f
},
// Performance
new FxaaConsoleSettings
{
subpixelSpreadAmount = 0.33f,
edgeSharpnessAmount = 8f,
edgeDetectionThreshold = 0.125f,
minimumRequiredLuminance = 0.06f
},
// Default
new FxaaConsoleSettings
{
subpixelSpreadAmount = 0.5f,
edgeSharpnessAmount = 8f,
edgeDetectionThreshold = 0.125f,
minimumRequiredLuminance = 0.05f
},
// Quality
new FxaaConsoleSettings
{
subpixelSpreadAmount = 0.5f,
edgeSharpnessAmount = 4f,
edgeDetectionThreshold = 0.125f,
minimumRequiredLuminance = 0.04f
},
// ExtremeQuality
new FxaaConsoleSettings
{
subpixelSpreadAmount = 0.5f,
edgeSharpnessAmount = 2f,
edgeDetectionThreshold = 0.125f,
minimumRequiredLuminance = 0.04f
}
};
}
[Serializable]
public struct FxaaSettings
{
public FxaaPreset preset;
public static FxaaSettings defaultSettings
{
get
{
return new FxaaSettings
{
preset = FxaaPreset.Default
};
}
}
}
#endregion
#region TAA Settings
[Serializable]
public struct TaaSettings
{
[Tooltip("The diameter (in texels) inside which jitter samples are spread. Smaller values result in crisper but more aliased output, while larger values result in more stable but blurrier output.")]
[Range(0.1f, 1f)]
public float jitterSpread;
[Tooltip("Controls the amount of sharpening applied to the color buffer.")]
[Range(0f, 3f)]
public float sharpen;
[Tooltip("The blend coefficient for a stationary fragment. Controls the percentage of history sample blended into the final color.")]
[Range(0f, 0.99f)]
public float stationaryBlending;
[Tooltip("The blend coefficient for a fragment with significant motion. Controls the percentage of history sample blended into the final color.")]
[Range(0f, 0.99f)]
public float motionBlending;
public static TaaSettings defaultSettings
{
get
{
return new TaaSettings
{
jitterSpread = 0.75f,
sharpen = 0.3f,
stationaryBlending = 0.95f,
motionBlending = 0.85f
};
}
}
}
#endregion
[Serializable]
public struct Settings
{
public Method method;
public FxaaSettings fxaaSettings;
public TaaSettings taaSettings;
public static Settings defaultSettings
{
get
{
return new Settings
{
method = Method.Fxaa,
fxaaSettings = FxaaSettings.defaultSettings,
taaSettings = TaaSettings.defaultSettings
};
}
}
}
[SerializeField]
Settings m_Settings = Settings.defaultSettings;
public Settings settings
{
get { return m_Settings; }
set { m_Settings = value; }
}
public override void Reset()
{
m_Settings = Settings.defaultSettings;
}
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: cb9a239ec5f20ca4cb5d0391441588de
timeCreated: 1467126855
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,102 @@
using System;
namespace UnityEngine.PostProcessing
{
[Serializable]
public class BloomModel : PostProcessingModel
{
[Serializable]
public struct BloomSettings
{
[Min(0f), Tooltip("Strength of the bloom filter.")]
public float intensity;
[Min(0f), Tooltip("Filters out pixels under this level of brightness.")]
public float threshold;
public float thresholdLinear
{
set { threshold = Mathf.LinearToGammaSpace(value); }
get { return Mathf.GammaToLinearSpace(threshold); }
}
[Range(0f, 1f), Tooltip("Makes transition between under/over-threshold gradual (0 = hard threshold, 1 = soft threshold).")]
public float softKnee;
[Range(1f, 7f), Tooltip("Changes extent of veiling effects in a screen resolution-independent fashion.")]
public float radius;
[Tooltip("Reduces flashing noise with an additional filter.")]
public bool antiFlicker;
public static BloomSettings defaultSettings
{
get
{
return new BloomSettings
{
intensity = 0.5f,
threshold = 1.1f,
softKnee = 0.5f,
radius = 4f,
antiFlicker = false,
};
}
}
}
[Serializable]
public struct LensDirtSettings
{
[Tooltip("Dirtiness texture to add smudges or dust to the lens.")]
public Texture texture;
[Min(0f), Tooltip("Amount of lens dirtiness.")]
public float intensity;
public static LensDirtSettings defaultSettings
{
get
{
return new LensDirtSettings
{
texture = null,
intensity = 3f
};
}
}
}
[Serializable]
public struct Settings
{
public BloomSettings bloom;
public LensDirtSettings lensDirt;
public static Settings defaultSettings
{
get
{
return new Settings
{
bloom = BloomSettings.defaultSettings,
lensDirt = LensDirtSettings.defaultSettings
};
}
}
}
[SerializeField]
Settings m_Settings = Settings.defaultSettings;
public Settings settings
{
get { return m_Settings; }
set { m_Settings = value; }
}
public override void Reset()
{
m_Settings = Settings.defaultSettings;
}
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: e215a6ec29d100f489c186f289526f06
timeCreated: 1467126855
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,133 @@
using System;
namespace UnityEngine.PostProcessing
{
[Serializable]
public class BuiltinDebugViewsModel : PostProcessingModel
{
[Serializable]
public struct DepthSettings
{
[Range(0f, 1f), Tooltip("Scales the camera far plane before displaying the depth map.")]
public float scale;
public static DepthSettings defaultSettings
{
get
{
return new DepthSettings
{
scale = 1f
};
}
}
}
[Serializable]
public struct MotionVectorsSettings
{
[Range(0f, 1f), Tooltip("Opacity of the source render.")]
public float sourceOpacity;
[Range(0f, 1f), Tooltip("Opacity of the per-pixel motion vector colors.")]
public float motionImageOpacity;
[Min(0f), Tooltip("Because motion vectors are mainly very small vectors, you can use this setting to make them more visible.")]
public float motionImageAmplitude;
[Range(0f, 1f), Tooltip("Opacity for the motion vector arrows.")]
public float motionVectorsOpacity;
[Range(8, 64), Tooltip("The arrow density on screen.")]
public int motionVectorsResolution;
[Min(0f), Tooltip("Tweaks the arrows length.")]
public float motionVectorsAmplitude;
public static MotionVectorsSettings defaultSettings
{
get
{
return new MotionVectorsSettings
{
sourceOpacity = 1f,
motionImageOpacity = 0f,
motionImageAmplitude = 16f,
motionVectorsOpacity = 1f,
motionVectorsResolution = 24,
motionVectorsAmplitude = 64f
};
}
}
}
public enum Mode
{
None,
Depth,
Normals,
MotionVectors,
AmbientOcclusion,
EyeAdaptation,
FocusPlane,
PreGradingLog,
LogLut,
UserLut
}
[Serializable]
public struct Settings
{
public Mode mode;
public DepthSettings depth;
public MotionVectorsSettings motionVectors;
public static Settings defaultSettings
{
get
{
return new Settings
{
mode = Mode.None,
depth = DepthSettings.defaultSettings,
motionVectors = MotionVectorsSettings.defaultSettings
};
}
}
}
[SerializeField]
Settings m_Settings = Settings.defaultSettings;
public Settings settings
{
get { return m_Settings; }
set { m_Settings = value; }
}
public bool willInterrupt
{
get
{
return !IsModeActive(Mode.None)
&& !IsModeActive(Mode.EyeAdaptation)
&& !IsModeActive(Mode.PreGradingLog)
&& !IsModeActive(Mode.LogLut)
&& !IsModeActive(Mode.UserLut);
}
}
public override void Reset()
{
settings = Settings.defaultSettings;
}
public bool IsModeActive(Mode mode)
{
return m_Settings.mode == mode;
}
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 33d6d1a4b7b3dec40819019a25605191
timeCreated: 1467970684
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,43 @@
using System;
namespace UnityEngine.PostProcessing
{
[Serializable]
public class ChromaticAberrationModel : PostProcessingModel
{
[Serializable]
public struct Settings
{
[Tooltip("Shift the hue of chromatic aberrations.")]
public Texture2D spectralTexture;
[Range(0f, 1f), Tooltip("Amount of tangential distortion.")]
public float intensity;
public static Settings defaultSettings
{
get
{
return new Settings
{
spectralTexture = null,
intensity = 0.1f
};
}
}
}
[SerializeField]
Settings m_Settings = Settings.defaultSettings;
public Settings settings
{
get { return m_Settings; }
set { m_Settings = value; }
}
public override void Reset()
{
m_Settings = Settings.defaultSettings;
}
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 8da01668697617e43879715e835a2367
timeCreated: 1467126855
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,311 @@
using System;
namespace UnityEngine.PostProcessing
{
[Serializable]
public class ColorGradingModel : PostProcessingModel
{
public enum Tonemapper
{
None,
/// <summary>
/// ACES Filmic reference tonemapper.
/// </summary>
ACES,
/// <summary>
/// Neutral tonemapper (based off John Hable's & Jim Hejl's work).
/// </summary>
Neutral
}
[Serializable]
public struct TonemappingSettings
{
[Tooltip("Tonemapping algorithm to use at the end of the color grading process. Use \"Neutral\" if you need a customizable tonemapper or \"Filmic\" to give a standard filmic look to your scenes.")]
public Tonemapper tonemapper;
// Neutral settings
[Range(-0.1f, 0.1f)]
public float neutralBlackIn;
[Range(1f, 20f)]
public float neutralWhiteIn;
[Range(-0.09f, 0.1f)]
public float neutralBlackOut;
[Range(1f, 19f)]
public float neutralWhiteOut;
[Range(0.1f, 20f)]
public float neutralWhiteLevel;
[Range(1f, 10f)]
public float neutralWhiteClip;
public static TonemappingSettings defaultSettings
{
get
{
return new TonemappingSettings
{
tonemapper = Tonemapper.Neutral,
neutralBlackIn = 0.02f,
neutralWhiteIn = 10f,
neutralBlackOut = 0f,
neutralWhiteOut = 10f,
neutralWhiteLevel = 5.3f,
neutralWhiteClip = 10f
};
}
}
}
[Serializable]
public struct BasicSettings
{
[Tooltip("Adjusts the overall exposure of the scene in EV units. This is applied after HDR effect and right before tonemapping so it won't affect previous effects in the chain.")]
public float postExposure;
[Range(-100f, 100f), Tooltip("Sets the white balance to a custom color temperature.")]
public float temperature;
[Range(-100f, 100f), Tooltip("Sets the white balance to compensate for a green or magenta tint.")]
public float tint;
[Range(-180f, 180f), Tooltip("Shift the hue of all colors.")]
public float hueShift;
[Range(0f, 2f), Tooltip("Pushes the intensity of all colors.")]
public float saturation;
[Range(0f, 2f), Tooltip("Expands or shrinks the overall range of tonal values.")]
public float contrast;
public static BasicSettings defaultSettings
{
get
{
return new BasicSettings
{
postExposure = 0f,
temperature = 0f,
tint = 0f,
hueShift = 0f,
saturation = 1f,
contrast = 1f,
};
}
}
}
[Serializable]
public struct ChannelMixerSettings
{
public Vector3 red;
public Vector3 green;
public Vector3 blue;
[HideInInspector]
public int currentEditingChannel; // Used only in the editor
public static ChannelMixerSettings defaultSettings
{
get
{
return new ChannelMixerSettings
{
red = new Vector3(1f, 0f, 0f),
green = new Vector3(0f, 1f, 0f),
blue = new Vector3(0f, 0f, 1f),
currentEditingChannel = 0
};
}
}
}
[Serializable]
public struct LogWheelsSettings
{
[Trackball("GetSlopeValue")]
public Color slope;
[Trackball("GetPowerValue")]
public Color power;
[Trackball("GetOffsetValue")]
public Color offset;
public static LogWheelsSettings defaultSettings
{
get
{
return new LogWheelsSettings
{
slope = Color.clear,
power = Color.clear,
offset = Color.clear
};
}
}
}
[Serializable]
public struct LinearWheelsSettings
{
[Trackball("GetLiftValue")]
public Color lift;
[Trackball("GetGammaValue")]
public Color gamma;
[Trackball("GetGainValue")]
public Color gain;
public static LinearWheelsSettings defaultSettings
{
get
{
return new LinearWheelsSettings
{
lift = Color.clear,
gamma = Color.clear,
gain = Color.clear
};
}
}
}
public enum ColorWheelMode
{
Linear,
Log
}
[Serializable]
public struct ColorWheelsSettings
{
public ColorWheelMode mode;
[TrackballGroup]
public LogWheelsSettings log;
[TrackballGroup]
public LinearWheelsSettings linear;
public static ColorWheelsSettings defaultSettings
{
get
{
return new ColorWheelsSettings
{
mode = ColorWheelMode.Log,
log = LogWheelsSettings.defaultSettings,
linear = LinearWheelsSettings.defaultSettings
};
}
}
}
[Serializable]
public struct CurvesSettings
{
public ColorGradingCurve master;
public ColorGradingCurve red;
public ColorGradingCurve green;
public ColorGradingCurve blue;
public ColorGradingCurve hueVShue;
public ColorGradingCurve hueVSsat;
public ColorGradingCurve satVSsat;
public ColorGradingCurve lumVSsat;
// Used only in the editor
[HideInInspector] public int e_CurrentEditingCurve;
[HideInInspector] public bool e_CurveY;
[HideInInspector] public bool e_CurveR;
[HideInInspector] public bool e_CurveG;
[HideInInspector] public bool e_CurveB;
public static CurvesSettings defaultSettings
{
get
{
return new CurvesSettings
{
master = new ColorGradingCurve(new AnimationCurve(new Keyframe(0f, 0f, 1f, 1f), new Keyframe(1f, 1f, 1f, 1f)), 0f, false, new Vector2(0f, 1f)),
red = new ColorGradingCurve(new AnimationCurve(new Keyframe(0f, 0f, 1f, 1f), new Keyframe(1f, 1f, 1f, 1f)), 0f, false, new Vector2(0f, 1f)),
green = new ColorGradingCurve(new AnimationCurve(new Keyframe(0f, 0f, 1f, 1f), new Keyframe(1f, 1f, 1f, 1f)), 0f, false, new Vector2(0f, 1f)),
blue = new ColorGradingCurve(new AnimationCurve(new Keyframe(0f, 0f, 1f, 1f), new Keyframe(1f, 1f, 1f, 1f)), 0f, false, new Vector2(0f, 1f)),
hueVShue = new ColorGradingCurve(new AnimationCurve(), 0.5f, true, new Vector2(0f, 1f)),
hueVSsat = new ColorGradingCurve(new AnimationCurve(), 0.5f, true, new Vector2(0f, 1f)),
satVSsat = new ColorGradingCurve(new AnimationCurve(), 0.5f, false, new Vector2(0f, 1f)),
lumVSsat = new ColorGradingCurve(new AnimationCurve(), 0.5f, false, new Vector2(0f, 1f)),
e_CurrentEditingCurve = 0,
e_CurveY = true,
e_CurveR = false,
e_CurveG = false,
e_CurveB = false
};
}
}
}
[Serializable]
public struct Settings
{
public TonemappingSettings tonemapping;
public BasicSettings basic;
public ChannelMixerSettings channelMixer;
public ColorWheelsSettings colorWheels;
public CurvesSettings curves;
public static Settings defaultSettings
{
get
{
return new Settings
{
tonemapping = TonemappingSettings.defaultSettings,
basic = BasicSettings.defaultSettings,
channelMixer = ChannelMixerSettings.defaultSettings,
colorWheels = ColorWheelsSettings.defaultSettings,
curves = CurvesSettings.defaultSettings
};
}
}
}
[SerializeField]
Settings m_Settings = Settings.defaultSettings;
public Settings settings
{
get { return m_Settings; }
set
{
m_Settings = value;
OnValidate();
}
}
public bool isDirty { get; internal set; }
public RenderTexture bakedLut { get; internal set; }
public override void Reset()
{
m_Settings = Settings.defaultSettings;
OnValidate();
}
public override void OnValidate()
{
isDirty = true;
}
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: fe146bcdc1fb8ae4ab7dd803982d3489
timeCreated: 1467126855
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,63 @@
using System;
namespace UnityEngine.PostProcessing
{
[Serializable]
public class DepthOfFieldModel : PostProcessingModel
{
public enum KernelSize
{
Small,
Medium,
Large,
VeryLarge
}
[Serializable]
public struct Settings
{
[Min(0.1f), Tooltip("Distance to the point of focus.")]
public float focusDistance;
[Range(0.05f, 32f), Tooltip("Ratio of aperture (known as f-stop or f-number). The smaller the value is, the shallower the depth of field is.")]
public float aperture;
[Range(1f, 300f), Tooltip("Distance between the lens and the film. The larger the value is, the shallower the depth of field is.")]
public float focalLength;
[Tooltip("Calculate the focal length automatically from the field-of-view value set on the camera. Using this setting isn't recommended.")]
public bool useCameraFov;
[Tooltip("Convolution kernel size of the bokeh filter, which determines the maximum radius of bokeh. It also affects the performance (the larger the kernel is, the longer the GPU time is required).")]
public KernelSize kernelSize;
public static Settings defaultSettings
{
get
{
return new Settings
{
focusDistance = 10f,
aperture = 5.6f,
focalLength = 50f,
useCameraFov = false,
kernelSize = KernelSize.Medium
};
}
}
}
[SerializeField]
Settings m_Settings = Settings.defaultSettings;
public Settings settings
{
get { return m_Settings; }
set { m_Settings = value; }
}
public override void Reset()
{
m_Settings = Settings.defaultSettings;
}
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 2626b17c595c71e43811d654eb28d30d
timeCreated: 1467126855
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,30 @@
using System;
namespace UnityEngine.PostProcessing
{
[Serializable]
public class DitheringModel : PostProcessingModel
{
[Serializable]
public struct Settings
{
public static Settings defaultSettings
{
get { return new Settings(); }
}
}
[SerializeField]
Settings m_Settings = Settings.defaultSettings;
public Settings settings
{
get { return m_Settings; }
set { m_Settings = value; }
}
public override void Reset()
{
m_Settings = Settings.defaultSettings;
}
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 41209882cdbcf31429d2a457a2164801
timeCreated: 1485179235
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,88 @@
using System;
namespace UnityEngine.PostProcessing
{
[Serializable]
public class EyeAdaptationModel : PostProcessingModel
{
public enum EyeAdaptationType
{
Progressive,
Fixed
}
[Serializable]
public struct Settings
{
[Range(1f, 99f), Tooltip("Filters the dark part of the histogram when computing the average luminance to avoid very dark pixels from contributing to the auto exposure. Unit is in percent.")]
public float lowPercent;
[Range(1f, 99f), Tooltip("Filters the bright part of the histogram when computing the average luminance to avoid very dark pixels from contributing to the auto exposure. Unit is in percent.")]
public float highPercent;
[Tooltip("Minimum average luminance to consider for auto exposure (in EV).")]
public float minLuminance;
[Tooltip("Maximum average luminance to consider for auto exposure (in EV).")]
public float maxLuminance;
[Min(0f), Tooltip("Exposure bias. Use this to offset the global exposure of the scene.")]
public float keyValue;
[Tooltip("Set this to true to let Unity handle the key value automatically based on average luminance.")]
public bool dynamicKeyValue;
[Tooltip("Use \"Progressive\" if you want the auto exposure to be animated. Use \"Fixed\" otherwise.")]
public EyeAdaptationType adaptationType;
[Min(0f), Tooltip("Adaptation speed from a dark to a light environment.")]
public float speedUp;
[Min(0f), Tooltip("Adaptation speed from a light to a dark environment.")]
public float speedDown;
[Range(-16, -1), Tooltip("Lower bound for the brightness range of the generated histogram (in EV). The bigger the spread between min & max, the lower the precision will be.")]
public int logMin;
[Range(1, 16), Tooltip("Upper bound for the brightness range of the generated histogram (in EV). The bigger the spread between min & max, the lower the precision will be.")]
public int logMax;
public static Settings defaultSettings
{
get
{
return new Settings
{
lowPercent = 45f,
highPercent = 95f,
minLuminance = -5f,
maxLuminance = 1f,
keyValue = 0.25f,
dynamicKeyValue = true,
adaptationType = EyeAdaptationType.Progressive,
speedUp = 2f,
speedDown = 1f,
logMin = -8,
logMax = 4
};
}
}
}
[SerializeField]
Settings m_Settings = Settings.defaultSettings;
public Settings settings
{
get { return m_Settings; }
set { m_Settings = value; }
}
public override void Reset()
{
m_Settings = Settings.defaultSettings;
}
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: edf6d216ca4b60942a0c533c14f26d53
timeCreated: 1467126855
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,39 @@
using System;
namespace UnityEngine.PostProcessing
{
[Serializable]
public class FogModel : PostProcessingModel
{
[Serializable]
public struct Settings
{
[Tooltip("Should the fog affect the skybox?")]
public bool excludeSkybox;
public static Settings defaultSettings
{
get
{
return new Settings
{
excludeSkybox = true
};
}
}
}
[SerializeField]
Settings m_Settings = Settings.defaultSettings;
public Settings settings
{
get { return m_Settings; }
set { m_Settings = value; }
}
public override void Reset()
{
m_Settings = Settings.defaultSettings;
}
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 1e20e66aa2deb7943993c444137d9acd
timeCreated: 1487328709
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,51 @@
using System;
namespace UnityEngine.PostProcessing
{
[Serializable]
public class GrainModel : PostProcessingModel
{
[Serializable]
public struct Settings
{
[Tooltip("Enable the use of colored grain.")]
public bool colored;
[Range(0f, 1f), Tooltip("Grain strength. Higher means more visible grain.")]
public float intensity;
[Range(0.3f, 3f), Tooltip("Grain particle size.")]
public float size;
[Range(0f, 1f), Tooltip("Controls the noisiness response curve based on scene luminance. Lower values mean less noise in dark areas.")]
public float luminanceContribution;
public static Settings defaultSettings
{
get
{
return new Settings
{
colored = true,
intensity = 0.5f,
size = 1f,
luminanceContribution = 0.8f
};
}
}
}
[SerializeField]
Settings m_Settings = Settings.defaultSettings;
public Settings settings
{
get { return m_Settings; }
set { m_Settings = value; }
}
public override void Reset()
{
m_Settings = Settings.defaultSettings;
}
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: f4fbcdb7f7a3c76489f32ffea74e6bb3
timeCreated: 1467126855
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,47 @@
using System;
namespace UnityEngine.PostProcessing
{
[Serializable]
public class MotionBlurModel : PostProcessingModel
{
[Serializable]
public struct Settings
{
[Range(0f, 360f), Tooltip("The angle of rotary shutter. Larger values give longer exposure.")]
public float shutterAngle;
[Range(4, 32), Tooltip("The amount of sample points, which affects quality and performances.")]
public int sampleCount;
[Range(0f, 1f), Tooltip("The strength of multiple frame blending. The opacity of preceding frames are determined from this coefficient and time differences.")]
public float frameBlending;
public static Settings defaultSettings
{
get
{
return new Settings
{
shutterAngle = 270f,
sampleCount = 10,
frameBlending = 0f
};
}
}
}
[SerializeField]
Settings m_Settings = Settings.defaultSettings;
public Settings settings
{
get { return m_Settings; }
set { m_Settings = value; }
}
public override void Reset()
{
m_Settings = Settings.defaultSettings;
}
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: bb4df227c906dd342bd34767914d292c
timeCreated: 1468325392
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,140 @@
using System;
namespace UnityEngine.PostProcessing
{
[Serializable]
public class ScreenSpaceReflectionModel : PostProcessingModel
{
public enum SSRResolution
{
High = 0,
Low = 2
}
public enum SSRReflectionBlendType
{
PhysicallyBased,
Additive
}
[Serializable]
public struct IntensitySettings
{
[Tooltip("Nonphysical multiplier for the SSR reflections. 1.0 is physically based.")]
[Range(0.0f, 2.0f)]
public float reflectionMultiplier;
[Tooltip("How far away from the maxDistance to begin fading SSR.")]
[Range(0.0f, 1000.0f)]
public float fadeDistance;
[Tooltip("Amplify Fresnel fade out. Increase if floor reflections look good close to the surface and bad farther 'under' the floor.")]
[Range(0.0f, 1.0f)]
public float fresnelFade;
[Tooltip("Higher values correspond to a faster Fresnel fade as the reflection changes from the grazing angle.")]
[Range(0.1f, 10.0f)]
public float fresnelFadePower;
}
[Serializable]
public struct ReflectionSettings
{
// When enabled, we just add our reflections on top of the existing ones. This is physically incorrect, but several
// popular demos and games have taken this approach, and it does hide some artifacts.
[Tooltip("How the reflections are blended into the render.")]
public SSRReflectionBlendType blendType;
[Tooltip("Half resolution SSRR is much faster, but less accurate.")]
public SSRResolution reflectionQuality;
[Tooltip("Maximum reflection distance in world units.")]
[Range(0.1f, 300.0f)]
public float maxDistance;
/// REFLECTIONS
[Tooltip("Max raytracing length.")]
[Range(16, 1024)]
public int iterationCount;
[Tooltip("Log base 2 of ray tracing coarse step size. Higher traces farther, lower gives better quality silhouettes.")]
[Range(1, 16)]
public int stepSize;
[Tooltip("Typical thickness of columns, walls, furniture, and other objects that reflection rays might pass behind.")]
[Range(0.01f, 10.0f)]
public float widthModifier;
[Tooltip("Blurriness of reflections.")]
[Range(0.1f, 8.0f)]
public float reflectionBlur;
[Tooltip("Disable for a performance gain in scenes where most glossy objects are horizontal, like floors, water, and tables. Leave on for scenes with glossy vertical objects.")]
public bool reflectBackfaces;
}
[Serializable]
public struct ScreenEdgeMask
{
[Tooltip("Higher = fade out SSRR near the edge of the screen so that reflections don't pop under camera motion.")]
[Range(0.0f, 1.0f)]
public float intensity;
}
[Serializable]
public struct Settings
{
public ReflectionSettings reflection;
public IntensitySettings intensity;
public ScreenEdgeMask screenEdgeMask;
public static Settings defaultSettings
{
get
{
return new Settings
{
reflection = new ReflectionSettings
{
blendType = SSRReflectionBlendType.PhysicallyBased,
reflectionQuality = SSRResolution.Low,
maxDistance = 100f,
iterationCount = 256,
stepSize = 3,
widthModifier = 0.5f,
reflectionBlur = 1f,
reflectBackfaces = false
},
intensity = new IntensitySettings
{
reflectionMultiplier = 1f,
fadeDistance = 100f,
fresnelFade = 1f,
fresnelFadePower = 1f,
},
screenEdgeMask = new ScreenEdgeMask
{
intensity = 0.03f
}
};
}
}
}
[SerializeField]
Settings m_Settings = Settings.defaultSettings;
public Settings settings
{
get { return m_Settings; }
set { m_Settings = value; }
}
public override void Reset()
{
m_Settings = Settings.defaultSettings;
}
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: e841012229e57cd408a146561435e90d
timeCreated: 1467126855
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,43 @@
using System;
namespace UnityEngine.PostProcessing
{
[Serializable]
public class UserLutModel : PostProcessingModel
{
[Serializable]
public struct Settings
{
[Tooltip("Custom lookup texture (strip format, e.g. 256x16).")]
public Texture2D lut;
[Range(0f, 1f), Tooltip("Blending factor.")]
public float contribution;
public static Settings defaultSettings
{
get
{
return new Settings
{
lut = null,
contribution = 1f
};
}
}
}
[SerializeField]
Settings m_Settings = Settings.defaultSettings;
public Settings settings
{
get { return m_Settings; }
set { m_Settings = value; }
}
public override void Reset()
{
m_Settings = Settings.defaultSettings;
}
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 3a7afd753a89c4140b80c855e15f69d6
timeCreated: 1467126855
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,78 @@
using System;
namespace UnityEngine.PostProcessing
{
[Serializable]
public class VignetteModel : PostProcessingModel
{
public enum Mode
{
Classic,
Masked
}
[Serializable]
public struct Settings
{
[Tooltip("Use the \"Classic\" mode for parametric controls. Use the \"Masked\" mode to use your own texture mask.")]
public Mode mode;
[ColorUsage(false)]
[Tooltip("Vignette color. Use the alpha channel for transparency.")]
public Color color;
[Tooltip("Sets the vignette center point (screen center is [0.5,0.5]).")]
public Vector2 center;
[Range(0f, 1f), Tooltip("Amount of vignetting on screen.")]
public float intensity;
[Range(0.01f, 1f), Tooltip("Smoothness of the vignette borders.")]
public float smoothness;
[Range(0f, 1f), Tooltip("Lower values will make a square-ish vignette.")]
public float roundness;
[Tooltip("A black and white mask to use as a vignette.")]
public Texture mask;
[Range(0f, 1f), Tooltip("Mask opacity.")]
public float opacity;
[Tooltip("Should the vignette be perfectly round or be dependent on the current aspect ratio?")]
public bool rounded;
public static Settings defaultSettings
{
get
{
return new Settings
{
mode = Mode.Classic,
color = new Color(0f, 0f, 0f, 1f),
center = new Vector2(0.5f, 0.5f),
intensity = 0.45f,
smoothness = 0.2f,
roundness = 1f,
mask = null,
opacity = 1f,
rounded = false
};
}
}
}
[SerializeField]
Settings m_Settings = Settings.defaultSettings;
public Settings settings
{
get { return m_Settings; }
set { m_Settings = value; }
}
public override void Reset()
{
m_Settings = Settings.defaultSettings;
}
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: d7aa967ba692363448f1b25d0728b9bd
timeCreated: 1467126855
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: