initial commit

This commit is contained in:
Jo 2025-01-07 02:06:59 +01:00
parent 6715289efe
commit 788c3389af
37645 changed files with 2526849 additions and 80 deletions

View file

@ -0,0 +1,41 @@
using System;
namespace UnityEngine.Rendering.Universal
{
[Serializable, VolumeComponentMenuForRenderPipeline("Post-processing/Bloom", typeof(UniversalRenderPipeline))]
public sealed class Bloom : VolumeComponent, IPostProcessComponent
{
[Header("Bloom")]
[Tooltip("Filters out pixels under this level of brightness. Value is in gamma-space.")]
public MinFloatParameter threshold = new MinFloatParameter(0.9f, 0f);
[Tooltip("Strength of the bloom filter.")]
public MinFloatParameter intensity = new MinFloatParameter(0f, 0f);
[Tooltip("Set the radius of the bloom effect")]
public ClampedFloatParameter scatter = new ClampedFloatParameter(0.7f, 0f, 1f);
[Tooltip("Set the maximum intensity that Unity uses to calculate Bloom. If pixels in your Scene are more intense than this, URP renders them at their current intensity, but uses this intensity value for the purposes of Bloom calculations.")]
public MinFloatParameter clamp = new MinFloatParameter(65472f, 0f);
[Tooltip("Use the color picker to select a color for the Bloom effect to tint to.")]
public ColorParameter tint = new ColorParameter(Color.white, false, false, true);
[Tooltip("Use bicubic sampling instead of bilinear sampling for the upsampling passes. This is slightly more expensive but helps getting smoother visuals.")]
public BoolParameter highQualityFiltering = new BoolParameter(false);
[Tooltip("The number of final iterations to skip in the effect processing sequence.")]
public ClampedIntParameter skipIterations = new ClampedIntParameter(1, 0, 16);
[Header("Lens Dirt")]
[Tooltip("Dirtiness texture to add smudges or dust to the bloom effect.")]
public TextureParameter dirtTexture = new TextureParameter(null);
[Tooltip("Amount of dirtiness.")]
public MinFloatParameter dirtIntensity = new MinFloatParameter(0f, 0f);
public bool IsActive() => intensity.value > 0f;
public bool IsTileCompatible() => false;
}
}

View file

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 0b2db86121404754db890f4c8dfe81b2
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,50 @@
using System;
namespace UnityEngine.Rendering.Universal
{
[Serializable, VolumeComponentMenuForRenderPipeline("Post-processing/Channel Mixer", typeof(UniversalRenderPipeline))]
public sealed class ChannelMixer : VolumeComponent, IPostProcessComponent
{
[Tooltip("Modify influence of the red channel in the overall mix.")]
public ClampedFloatParameter redOutRedIn = new ClampedFloatParameter(100f, -200f, 200f);
[Tooltip("Modify influence of the green channel in the overall mix.")]
public ClampedFloatParameter redOutGreenIn = new ClampedFloatParameter(0f, -200f, 200f);
[Tooltip("Modify influence of the blue channel in the overall mix.")]
public ClampedFloatParameter redOutBlueIn = new ClampedFloatParameter(0f, -200f, 200f);
[Tooltip("Modify influence of the red channel in the overall mix.")]
public ClampedFloatParameter greenOutRedIn = new ClampedFloatParameter(0f, -200f, 200f);
[Tooltip("Modify influence of the green channel in the overall mix.")]
public ClampedFloatParameter greenOutGreenIn = new ClampedFloatParameter(100f, -200f, 200f);
[Tooltip("Modify influence of the blue channel in the overall mix.")]
public ClampedFloatParameter greenOutBlueIn = new ClampedFloatParameter(0f, -200f, 200f);
[Tooltip("Modify influence of the red channel in the overall mix.")]
public ClampedFloatParameter blueOutRedIn = new ClampedFloatParameter(0f, -200f, 200f);
[Tooltip("Modify influence of the green channel in the overall mix.")]
public ClampedFloatParameter blueOutGreenIn = new ClampedFloatParameter(0f, -200f, 200f);
[Tooltip("Modify influence of the blue channel in the overall mix.")]
public ClampedFloatParameter blueOutBlueIn = new ClampedFloatParameter(100f, -200f, 200f);
public bool IsActive()
{
return redOutRedIn.value != 100f
|| redOutGreenIn.value != 0f
|| redOutBlueIn.value != 0f
|| greenOutRedIn.value != 0f
|| greenOutGreenIn.value != 100f
|| greenOutBlueIn.value != 0f
|| blueOutRedIn.value != 0f
|| blueOutGreenIn.value != 0f
|| blueOutBlueIn.value != 100f;
}
public bool IsTileCompatible() => true;
}
}

View file

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: cdfbdbb87d3286943a057f7791b43141
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,15 @@
using System;
namespace UnityEngine.Rendering.Universal
{
[Serializable, VolumeComponentMenuForRenderPipeline("Post-processing/Chromatic Aberration", typeof(UniversalRenderPipeline))]
public sealed class ChromaticAberration : VolumeComponent, IPostProcessComponent
{
[Tooltip("Use the slider to set the strength of the Chromatic Aberration effect.")]
public ClampedFloatParameter intensity = new ClampedFloatParameter(0f, 0f, 1f);
public bool IsActive() => intensity.value > 0f;
public bool IsTileCompatible() => false;
}
}

View file

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 81180773991d8724ab7f2d216912b564
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,34 @@
using System;
namespace UnityEngine.Rendering.Universal
{
[Serializable, VolumeComponentMenuForRenderPipeline("Post-processing/Color Adjustments", typeof(UniversalRenderPipeline))]
public sealed class ColorAdjustments : VolumeComponent, IPostProcessComponent
{
[Tooltip("Adjusts the overall exposure of the scene in EV100. This is applied after HDR effect and right before tonemapping so it won't affect previous effects in the chain.")]
public FloatParameter postExposure = new FloatParameter(0f);
[Tooltip("Expands or shrinks the overall range of tonal values.")]
public ClampedFloatParameter contrast = new ClampedFloatParameter(0f, -100f, 100f);
[Tooltip("Tint the render by multiplying a color.")]
public ColorParameter colorFilter = new ColorParameter(Color.white, true, false, true);
[Tooltip("Shift the hue of all colors.")]
public ClampedFloatParameter hueShift = new ClampedFloatParameter(0f, -180f, 180f);
[Tooltip("Pushes the intensity of all colors.")]
public ClampedFloatParameter saturation = new ClampedFloatParameter(0f, -100f, 100f);
public bool IsActive()
{
return postExposure.value != 0f
|| contrast.value != 0f
|| colorFilter != Color.white
|| hueShift != 0f
|| saturation != 0f;
}
public bool IsTileCompatible() => true;
}
}

View file

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 66f335fb1ffd8684294ad653bf1c7564
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,22 @@
using System;
namespace UnityEngine.Rendering.Universal
{
[Serializable, VolumeComponentMenuForRenderPipeline("Post-processing/Color Curves", typeof(UniversalRenderPipeline))]
public sealed class ColorCurves : VolumeComponent, IPostProcessComponent
{
public TextureCurveParameter master = new TextureCurveParameter(new TextureCurve(new[] { new Keyframe(0f, 0f, 1f, 1f), new Keyframe(1f, 1f, 1f, 1f) }, 0f, false, new Vector2(0f, 1f)));
public TextureCurveParameter red = new TextureCurveParameter(new TextureCurve(new[] { new Keyframe(0f, 0f, 1f, 1f), new Keyframe(1f, 1f, 1f, 1f) }, 0f, false, new Vector2(0f, 1f)));
public TextureCurveParameter green = new TextureCurveParameter(new TextureCurve(new[] { new Keyframe(0f, 0f, 1f, 1f), new Keyframe(1f, 1f, 1f, 1f) }, 0f, false, new Vector2(0f, 1f)));
public TextureCurveParameter blue = new TextureCurveParameter(new TextureCurve(new[] { new Keyframe(0f, 0f, 1f, 1f), new Keyframe(1f, 1f, 1f, 1f) }, 0f, false, new Vector2(0f, 1f)));
public TextureCurveParameter hueVsHue = new TextureCurveParameter(new TextureCurve(new Keyframe[] { }, 0.5f, true, new Vector2(0f, 1f)));
public TextureCurveParameter hueVsSat = new TextureCurveParameter(new TextureCurve(new Keyframe[] { }, 0.5f, true, new Vector2(0f, 1f)));
public TextureCurveParameter satVsSat = new TextureCurveParameter(new TextureCurve(new Keyframe[] { }, 0.5f, false, new Vector2(0f, 1f)));
public TextureCurveParameter lumVsSat = new TextureCurveParameter(new TextureCurve(new Keyframe[] { }, 0.5f, false, new Vector2(0f, 1f)));
public bool IsActive() => true;
public bool IsTileCompatible() => true;
}
}

View file

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 3eb4b772797da9440885e8bd939e9560
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,47 @@
using System;
using UnityEngine.Experimental.Rendering;
namespace UnityEngine.Rendering.Universal
{
[Serializable, VolumeComponentMenuForRenderPipeline("Post-processing/Color Lookup", typeof(UniversalRenderPipeline))]
public sealed class ColorLookup : VolumeComponent, IPostProcessComponent
{
[Tooltip("A 2D Lookup Texture (LUT) to use for color grading.")]
public TextureParameter texture = new TextureParameter(null);
[Tooltip("How much of the lookup texture will contribute to the color grading effect.")]
public ClampedFloatParameter contribution = new ClampedFloatParameter(1f, 0f, 1f);
public bool IsActive() => contribution.value > 0f && ValidateLUT();
public bool IsTileCompatible() => true;
public bool ValidateLUT()
{
var asset = UniversalRenderPipeline.asset;
if (asset == null || texture.value == null)
return false;
int lutSize = asset.colorGradingLutSize;
if (texture.value.height != lutSize)
return false;
bool valid = false;
switch (texture.value)
{
case Texture2D t:
valid |= t.width == lutSize * lutSize
&& !GraphicsFormatUtility.IsSRGBFormat(t.graphicsFormat);
break;
case RenderTexture rt:
valid |= rt.dimension == TextureDimension.Tex2D
&& rt.width == lutSize * lutSize
&& !rt.sRGB;
break;
}
return valid;
}
}
}

View file

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: e021b4c809a781e468c2988c016ebbea
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,61 @@
using System;
namespace UnityEngine.Rendering.Universal
{
public enum DepthOfFieldMode
{
Off,
Gaussian, // Non physical, fast, small radius, far blur only
Bokeh
}
[Serializable, VolumeComponentMenuForRenderPipeline("Post-processing/Depth Of Field", typeof(UniversalRenderPipeline))]
public sealed class DepthOfField : VolumeComponent, IPostProcessComponent
{
[Tooltip("Use \"Gaussian\" for a faster but non physical depth of field; \"Bokeh\" for a more realistic but slower depth of field.")]
public DepthOfFieldModeParameter mode = new DepthOfFieldModeParameter(DepthOfFieldMode.Off);
[Tooltip("The distance at which the blurring will start.")]
public MinFloatParameter gaussianStart = new MinFloatParameter(10f, 0f);
[Tooltip("The distance at which the blurring will reach its maximum radius.")]
public MinFloatParameter gaussianEnd = new MinFloatParameter(30f, 0f);
[Tooltip("The maximum radius of the gaussian blur. Values above 1 may show under-sampling artifacts.")]
public ClampedFloatParameter gaussianMaxRadius = new ClampedFloatParameter(1f, 0.5f, 1.5f);
[Tooltip("Use higher quality sampling to reduce flickering and improve the overall blur smoothness.")]
public BoolParameter highQualitySampling = new BoolParameter(false);
[Tooltip("The distance to the point of focus.")]
public MinFloatParameter focusDistance = new MinFloatParameter(10f, 0.1f);
[Tooltip("The ratio of aperture (known as f-stop or f-number). The smaller the value is, the shallower the depth of field is.")]
public ClampedFloatParameter aperture = new ClampedFloatParameter(5.6f, 1f, 32f);
[Tooltip("The distance between the lens and the film. The larger the value is, the shallower the depth of field is.")]
public ClampedFloatParameter focalLength = new ClampedFloatParameter(50f, 1f, 300f);
[Tooltip("The number of aperture blades.")]
public ClampedIntParameter bladeCount = new ClampedIntParameter(5, 3, 9);
[Tooltip("The curvature of aperture blades. The smaller the value is, the more visible aperture blades are. A value of 1 will make the bokeh perfectly circular.")]
public ClampedFloatParameter bladeCurvature = new ClampedFloatParameter(1f, 0f, 1f);
[Tooltip("The rotation of aperture blades in degrees.")]
public ClampedFloatParameter bladeRotation = new ClampedFloatParameter(0f, -180f, 180f);
public bool IsActive()
{
if (mode.value == DepthOfFieldMode.Off || SystemInfo.graphicsShaderLevel < 35)
return false;
return mode.value != DepthOfFieldMode.Gaussian || SystemInfo.supportedRenderTargetCount > 1;
}
public bool IsTileCompatible() => false;
}
[Serializable]
public sealed class DepthOfFieldModeParameter : VolumeParameter<DepthOfFieldMode> { public DepthOfFieldModeParameter(DepthOfFieldMode value, bool overrideState = false) : base(value, overrideState) { } }
}

View file

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: c01700fd266d6914ababb731e09af2eb
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,42 @@
using System;
namespace UnityEngine.Rendering.Universal
{
public enum FilmGrainLookup
{
Thin1,
Thin2,
Medium1,
Medium2,
Medium3,
Medium4,
Medium5,
Medium6,
Large01,
Large02,
Custom
}
[Serializable, VolumeComponentMenuForRenderPipeline("Post-processing/Film Grain", typeof(UniversalRenderPipeline))]
public sealed class FilmGrain : VolumeComponent, IPostProcessComponent
{
[Tooltip("The type of grain to use. You can select a preset or provide your own texture by selecting Custom.")]
public FilmGrainLookupParameter type = new FilmGrainLookupParameter(FilmGrainLookup.Thin1);
[Tooltip("Use the slider to set the strength of the Film Grain effect.")]
public ClampedFloatParameter intensity = new ClampedFloatParameter(0f, 0f, 1f);
[Tooltip("Controls the noisiness response curve based on scene luminance. Higher values mean less noise in light areas.")]
public ClampedFloatParameter response = new ClampedFloatParameter(0.8f, 0f, 1f);
[Tooltip("A tileable texture to use for the grain. The neutral value is 0.5 where no grain is applied.")]
public NoInterpTextureParameter texture = new NoInterpTextureParameter(null);
public bool IsActive() => intensity.value > 0f && (type.value != FilmGrainLookup.Custom || texture.value != null);
public bool IsTileCompatible() => true;
}
[Serializable]
public sealed class FilmGrainLookupParameter : VolumeParameter<FilmGrainLookup> { public FilmGrainLookupParameter(FilmGrainLookup value, bool overrideState = false) : base(value, overrideState) { } }
}

View file

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 29fa0085f50d5e54f8144f766051a691
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,31 @@
using System;
namespace UnityEngine.Rendering.Universal
{
[Serializable, VolumeComponentMenuForRenderPipeline("Post-processing/Lens Distortion", typeof(UniversalRenderPipeline))]
public sealed class LensDistortion : VolumeComponent, IPostProcessComponent
{
[Tooltip("Total distortion amount.")]
public ClampedFloatParameter intensity = new ClampedFloatParameter(0f, -1f, 1f);
[Tooltip("Intensity multiplier on X axis. Set it to 0 to disable distortion on this axis.")]
public ClampedFloatParameter xMultiplier = new ClampedFloatParameter(1f, 0f, 1f);
[Tooltip("Intensity multiplier on Y axis. Set it to 0 to disable distortion on this axis.")]
public ClampedFloatParameter yMultiplier = new ClampedFloatParameter(1f, 0f, 1f);
[Tooltip("Distortion center point. 0.5,0.5 is center of the screen")]
public Vector2Parameter center = new Vector2Parameter(new Vector2(0.5f, 0.5f));
[Tooltip("Controls global screen scaling for the distortion effect. Use this to hide screen borders when using high \"Intensity.\"")]
public ClampedFloatParameter scale = new ClampedFloatParameter(1f, 0.01f, 5f);
public bool IsActive()
{
return Mathf.Abs(intensity.value) > 0
&& (xMultiplier.value > 0f || yMultiplier.value > 0f);
}
public bool IsTileCompatible() => false;
}
}

View file

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: c5e1dc532bcb41949b58bc4f2abfbb7e
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,27 @@
using System;
namespace UnityEngine.Rendering.Universal
{
[Serializable, VolumeComponentMenuForRenderPipeline("Post-processing/Lift, Gamma, Gain", typeof(UniversalRenderPipeline))]
public sealed class LiftGammaGain : VolumeComponent, IPostProcessComponent
{
[Tooltip("Use this to control and apply a hue to the dark tones. This has a more exaggerated effect on shadows.")]
public Vector4Parameter lift = new Vector4Parameter(new Vector4(1f, 1f, 1f, 0f));
[Tooltip("Use this to control and apply a hue to the mid-range tones with a power function.")]
public Vector4Parameter gamma = new Vector4Parameter(new Vector4(1f, 1f, 1f, 0f));
[Tooltip("Use this to increase and apply a hue to the signal and make highlights brighter.")]
public Vector4Parameter gain = new Vector4Parameter(new Vector4(1f, 1f, 1f, 0f));
public bool IsActive()
{
var defaultState = new Vector4(1f, 1f, 1f, 0f);
return lift != defaultState
|| gamma != defaultState
|| gain != defaultState;
}
public bool IsTileCompatible() => true;
}
}

View file

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 5485954d14dfb9a4c8ead8edb0ded5b1
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,43 @@
using System;
namespace UnityEngine.Rendering.Universal
{
public enum MotionBlurMode
{
CameraOnly,
CameraAndObjects
}
public enum MotionBlurQuality
{
Low,
Medium,
High
}
[Serializable, VolumeComponentMenuForRenderPipeline("Post-processing/Motion Blur", typeof(UniversalRenderPipeline))]
public sealed class MotionBlur : VolumeComponent, IPostProcessComponent
{
[Tooltip("The motion blur technique to use. If you don't need object motion blur, CameraOnly will result in better performance.")]
public MotionBlurModeParameter mode = new MotionBlurModeParameter(MotionBlurMode.CameraOnly);
[Tooltip("The quality of the effect. Lower presets will result in better performance at the expense of visual quality.")]
public MotionBlurQualityParameter quality = new MotionBlurQualityParameter(MotionBlurQuality.Low);
[Tooltip("The strength of the motion blur filter. Acts as a multiplier for velocities.")]
public ClampedFloatParameter intensity = new ClampedFloatParameter(0f, 0f, 1f);
[Tooltip("Sets the maximum length, as a fraction of the screen's full resolution, that the velocity resulting from Camera rotation can have. Lower values will improve performance.")]
public ClampedFloatParameter clamp = new ClampedFloatParameter(0.05f, 0f, 0.2f);
public bool IsActive() => intensity.value > 0f && mode.value == MotionBlurMode.CameraOnly;
public bool IsTileCompatible() => false;
}
[Serializable]
public sealed class MotionBlurModeParameter : VolumeParameter<MotionBlurMode> { public MotionBlurModeParameter(MotionBlurMode value, bool overrideState = false) : base(value, overrideState) { } }
[Serializable]
public sealed class MotionBlurQualityParameter : VolumeParameter<MotionBlurQuality> { public MotionBlurQualityParameter(MotionBlurQuality value, bool overrideState = false) : base(value, overrideState) { } }
}

View file

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: ccf1aba9553839d41ae37dd52e9ebcce
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,18 @@
using System;
namespace UnityEngine.Rendering.Universal
{
[Serializable, VolumeComponentMenuForRenderPipeline("Post-processing/Panini Projection", typeof(UniversalRenderPipeline))]
public sealed class PaniniProjection : VolumeComponent, IPostProcessComponent
{
[Tooltip("Panini projection distance.")]
public ClampedFloatParameter distance = new ClampedFloatParameter(0f, 0f, 1f);
[Tooltip("Panini projection crop to fit.")]
public ClampedFloatParameter cropToFit = new ClampedFloatParameter(1f, 0f, 1f);
public bool IsActive() => distance.value > 0f;
public bool IsTileCompatible() => false;
}
}

View file

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: fb60a22f311433c4c962b888d1393f88
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,41 @@
using System;
namespace UnityEngine.Rendering.Universal
{
[Serializable, VolumeComponentMenuForRenderPipeline("Post-processing/Shadows, Midtones, Highlights", typeof(UniversalRenderPipeline))]
public sealed class ShadowsMidtonesHighlights : VolumeComponent, IPostProcessComponent
{
[Tooltip("Use this to control and apply a hue to the shadows.")]
public Vector4Parameter shadows = new Vector4Parameter(new Vector4(1f, 1f, 1f, 0f));
[Tooltip("Use this to control and apply a hue to the midtones.")]
public Vector4Parameter midtones = new Vector4Parameter(new Vector4(1f, 1f, 1f, 0f));
[Tooltip("Use this to control and apply a hue to the highlights.")]
public Vector4Parameter highlights = new Vector4Parameter(new Vector4(1f, 1f, 1f, 0f));
[Header("Shadow Limits")]
[Tooltip("Start point of the transition between shadows and midtones.")]
public MinFloatParameter shadowsStart = new MinFloatParameter(0f, 0f);
[Tooltip("End point of the transition between shadows and midtones.")]
public MinFloatParameter shadowsEnd = new MinFloatParameter(0.3f, 0f);
[Header("Highlight Limits")]
[Tooltip("Start point of the transition between midtones and highlights.")]
public MinFloatParameter highlightsStart = new MinFloatParameter(0.55f, 0f);
[Tooltip("End point of the transition between midtones and highlights.")]
public MinFloatParameter highlightsEnd = new MinFloatParameter(1f, 0f);
public bool IsActive()
{
var defaultState = new Vector4(1f, 1f, 1f, 0f);
return shadows != defaultState
|| midtones != defaultState
|| highlights != defaultState;
}
public bool IsTileCompatible() => true;
}
}

View file

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 558a8e2b6826cf840aae193990ba9f2e
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,21 @@
using System;
namespace UnityEngine.Rendering.Universal
{
[Serializable, VolumeComponentMenuForRenderPipeline("Post-processing/Split Toning", typeof(UniversalRenderPipeline))]
public sealed class SplitToning : VolumeComponent, IPostProcessComponent
{
[Tooltip("The color to use for shadows.")]
public ColorParameter shadows = new ColorParameter(Color.grey, false, false, true);
[Tooltip("The color to use for highlights.")]
public ColorParameter highlights = new ColorParameter(Color.grey, false, false, true);
[Tooltip("Balance between the colors in the highlights and shadows.")]
public ClampedFloatParameter balance = new ClampedFloatParameter(0f, -100f, 100f);
public bool IsActive() => shadows != Color.grey || highlights != Color.grey;
public bool IsTileCompatible() => true;
}
}

View file

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 70afe9e12c7a7ed47911bb608a23a8ff
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,25 @@
using System;
namespace UnityEngine.Rendering.Universal
{
public enum TonemappingMode
{
None,
Neutral, // Neutral tonemapper
ACES, // ACES Filmic reference tonemapper (custom approximation)
}
[Serializable, VolumeComponentMenuForRenderPipeline("Post-processing/Tonemapping", typeof(UniversalRenderPipeline))]
public sealed class Tonemapping : VolumeComponent, IPostProcessComponent
{
[Tooltip("Select a tonemapping algorithm to use for the color grading process.")]
public TonemappingModeParameter mode = new TonemappingModeParameter(TonemappingMode.None);
public bool IsActive() => mode.value != TonemappingMode.None;
public bool IsTileCompatible() => true;
}
[Serializable]
public sealed class TonemappingModeParameter : VolumeParameter<TonemappingMode> { public TonemappingModeParameter(TonemappingMode value, bool overrideState = false) : base(value, overrideState) { } }
}

View file

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 97c23e3b12dc18c42a140437e53d3951
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,27 @@
using System;
namespace UnityEngine.Rendering.Universal
{
[Serializable, VolumeComponentMenuForRenderPipeline("Post-processing/Vignette", typeof(UniversalRenderPipeline))]
public sealed class Vignette : VolumeComponent, IPostProcessComponent
{
[Tooltip("Vignette color.")]
public ColorParameter color = new ColorParameter(Color.black, false, false, true);
[Tooltip("Sets the vignette center point (screen center is [0.5,0.5]).")]
public Vector2Parameter center = new Vector2Parameter(new Vector2(0.5f, 0.5f));
[Tooltip("Amount of vignetting on screen.")]
public ClampedFloatParameter intensity = new ClampedFloatParameter(0f, 0f, 1f);
[Tooltip("Smoothness of the vignette borders.")]
public ClampedFloatParameter smoothness = new ClampedFloatParameter(0.2f, 0.01f, 1f);
[Tooltip("Should the vignette be perfectly round or be dependent on the current aspect ratio?")]
public BoolParameter rounded = new BoolParameter(false);
public bool IsActive() => intensity.value > 0f;
public bool IsTileCompatible() => true;
}
}

View file

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 899c54efeace73346a0a16faa3afe726
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,132 @@
using System;
#if UNITY_EDITOR
using UnityEditor;
#endif
namespace UnityEngine.Rendering.Universal
{
[Serializable, VolumeComponentMenu("Atmospherics/Volumetrics")]
public sealed class Volumetrics : VolumeComponent
{
//static readonly int m_MipFogParam = Shader.PropertyToID("_MipFogParameters");
static readonly int m_GlobalExtinction = Shader.PropertyToID("_GlobalExtinction");
static readonly int m_FogBaseHeight = Shader.PropertyToID("_FogBaseHeight");
static readonly int m_FogMaxHeight = Shader.PropertyToID("_FogMaxHeight");
static readonly int m_StaticLightMultiplier = Shader.PropertyToID("_StaticLightMultiplier");
static readonly int m_VolumetricAlbedo = Shader.PropertyToID("_GlobalScattering");
// Volumetric rendering scripts need to be aware that this script has
// set the shader global variables so they don't overwrite them
public static bool hasSetGlobals { get; private set; }
//static readonly int m_SkyTexture = Shader.PropertyToID("_SkyTexture");
//static readonly int m_SkyMipCount = Shader.PropertyToID("_SkyMipCount");
[Header("Fog Mipmap controls")]
[Tooltip("How close the mipfog starts")]
public MinFloatParameter mipFogNear = new MinFloatParameter( 0.0f , 0 );
[Tooltip("Where the mipfog ends")]
public MinFloatParameter mipFogFar = new MinFloatParameter( 1, 1 );
[Tooltip("Max mip level.")]
public ClampedFloatParameter mipFogMaxMip = new ClampedFloatParameter(1.0f, 0.0f, 1);
public CubemapParameter SkyTexture = new CubemapParameter(null);
[Space, Header("Voulmetric Controls")]
[Tooltip("Controls the global fog Density.")]
public MinFloatParameter FogViewDistance = new MinFloatParameter(50, 1f);
[Tooltip("Height in world space where fog hits max density.")]
public FloatParameter FogBaseHeight = new FloatParameter(0);
[Tooltip("Height in world space where fog is minimum density.")]
public FloatParameter FogMaxHeight = new FloatParameter(50);
[Tooltip("Controls the global fog Density."),HideInInspector]
public ClampedFloatParameter MaxRenderDistance = new ClampedFloatParameter(50, 1f, 3000f); //Disabled until hooked up
[Tooltip("Baked static light multiplier.")]
public MinFloatParameter GlobalStaticLightMultiplier = new MinFloatParameter(1f, .1f);
public ColorParameter VolumetricAlbedo = new ColorParameter(Color.white,false);
[HideInInspector]
public BoolParameter isNullSky = new BoolParameter(true);
//public BoolParameter testBool = new BoolParameter(false);
// public bool IsActive() => intensity.value > 0f && (type.value != FilmGrainLookup.Custom || texture.value != null);
// public bool IsTileCompatible() => true;
internal void PushFogShaderParameters()
{
hasSetGlobals = true;
Shader.SetGlobalFloat(m_GlobalExtinction, VolumeRenderingUtils.ExtinctionFromMeanFreePath(FogViewDistance.value) ); //ExtinctionFromMeanFreePath
Shader.SetGlobalFloat(m_StaticLightMultiplier, GlobalStaticLightMultiplier.value);
Shader.SetGlobalFloat(m_FogBaseHeight, FogBaseHeight.value);
Shader.SetGlobalFloat(m_FogMaxHeight, FogMaxHeight.value);
Shader.SetGlobalVector(m_VolumetricAlbedo, VolumetricAlbedo.value);
SkyManager.SetSkyMips(new Vector4(mipFogNear.value, mipFogFar.value, mipFogMaxMip.value, 0.0f));
//if (SkyTexture.value != null && SkyTexture.overrideState) SkyManager.SetSkyTexture(SkyTexture.value);
//else SkyManager.CheckSky();
//if (isNullSky.value)
//{
// Debug.Log("Null Sky was Set");
//}
if (SkyTexture.overrideState && !isNullSky.value && SkyTexture.value)
{
SkyManager.SetSkyTexture(SkyTexture.value);
}
else
{
SkyManager.CheckSky();
}
// Only check if skytexture.value is null once and cache the result.
// For some reason, checking if a null texture is null causes a 0.15ms of Loading.IsObjectAvailable (when the actual rendering only takes 0.04ms!).
// This doesn't seem to happen if the texture is non-null
//if (!hasCheckedForNullOverride)
//if (SkyTexture.overrideState)
//{
// if (!checkedNullSky.value)
// {
// checkedNullSky.value = true;
// if (SkyTexture.value == null)
// {
// SkyTexture.overrideState = false;
// SkyManager.CheckSky();
// }
// }
// else
// {
// SkyManager.SetSkyTexture(SkyTexture.value); // SkyTexture.value != null &&
// }
//}
//else SkyManager.CheckSky();
}
#if false //UNITY_EDITOR
// Only check if SkyTexture.value is null in editor and serialize the result.
// For some reason, checking if the texture inside of a CubemapParameter is null causes a 0.15ms of Loading.IsObjectAvailable if it actually is null.
private void OnValidate()
{
if (isNullSky == null)
{
isNullSky = new BoolParameter(false);
}
//isNullSky.value = SkyTexture.value == null;
//isNullSky.overrideState = true;
SerializedObject so = new SerializedObject(this);
SerializedProperty sp_value = so.FindProperty("isNullSky.m_Value");
SerializedProperty sp_override = so.FindProperty("isNullSky.m_OverrideState");
sp_value.boolValue = SkyTexture.value == null;
sp_override.boolValue = true;
so.ApplyModifiedProperties();
so.Dispose();
}
#endif
}
}

View file

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: d8f8ec5cd9511fe429c027fa86c1e8b2
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,18 @@
using System;
namespace UnityEngine.Rendering.Universal
{
[Serializable, VolumeComponentMenuForRenderPipeline("Post-processing/White Balance", typeof(UniversalRenderPipeline))]
public sealed class WhiteBalance : VolumeComponent, IPostProcessComponent
{
[Tooltip("Sets the white balance to a custom color temperature.")]
public ClampedFloatParameter temperature = new ClampedFloatParameter(0f, -100, 100f);
[Tooltip("Sets the white balance to compensate for a green or magenta tint.")]
public ClampedFloatParameter tint = new ClampedFloatParameter(0f, -100, 100f);
public bool IsActive() => temperature.value != 0f || tint.value != 0f;
public bool IsTileCompatible() => true;
}
}

View file

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 221518ef91623a7438a71fef23660601
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: