Added modified Post-Processing Stack V2 package with fully integrated FSR 2.2 upscaling, presented as one of the anti-aliasing options.
hdrp
-
5com.unity.postprocessing/.signature
-
337com.unity.postprocessing/CHANGELOG.md
-
7com.unity.postprocessing/CHANGELOG.md.meta
-
68com.unity.postprocessing/Documentation~/Ambient-Occlusion.md
-
89com.unity.postprocessing/Documentation~/Anti-aliasing.md
-
51com.unity.postprocessing/Documentation~/Auto-Exposure.md
-
43com.unity.postprocessing/Documentation~/Bloom.md
-
42com.unity.postprocessing/Documentation~/Chromatic-Aberration.md
-
142com.unity.postprocessing/Documentation~/Color-Grading.md
-
101com.unity.postprocessing/Documentation~/Debugging-Post-processing-effects.md
-
25com.unity.postprocessing/Documentation~/Deferred-Fog.md
-
25com.unity.postprocessing/Documentation~/Depth-of-Field.md
-
29com.unity.postprocessing/Documentation~/Grain.md
-
21com.unity.postprocessing/Documentation~/Installation.md
-
28com.unity.postprocessing/Documentation~/Lens-Distortion.md
-
115com.unity.postprocessing/Documentation~/Manipulating-the-Stack.md
-
27com.unity.postprocessing/Documentation~/Motion-Blur.md
-
100com.unity.postprocessing/Documentation~/Quick-start.md
-
35com.unity.postprocessing/Documentation~/Screen-Space-Reflections.md
-
23com.unity.postprocessing/Documentation~/TableOfContents.md
-
49com.unity.postprocessing/Documentation~/Vignette.md
-
240com.unity.postprocessing/Documentation~/Writing-Custom-Effects.md
-
BINcom.unity.postprocessing/Documentation~/images/Grain_image_0.png
-
BINcom.unity.postprocessing/Documentation~/images/Grain_image_1.png
-
BINcom.unity.postprocessing/Documentation~/images/PostProcessing-Bloom-0.png
-
BINcom.unity.postprocessing/Documentation~/images/PostProcessing-ChromaticAberration-0.png
-
BINcom.unity.postprocessing/Documentation~/images/PostProcessing-ChromaticAberration-1.png
-
BINcom.unity.postprocessing/Documentation~/images/PostProcessing-Vignette-1.png
-
BINcom.unity.postprocessing/Documentation~/images/PostProcessing-Vignette-2.png
-
BINcom.unity.postprocessing/Documentation~/images/Ppv2 _ Debugging_Light meter_Graph.png
-
BINcom.unity.postprocessing/Documentation~/images/Ppv2 _ Debugging_Vectorscope_Graph.png
-
BINcom.unity.postprocessing/Documentation~/images/Ppv2-Debugging-Histogram-Graph.png
-
BINcom.unity.postprocessing/Documentation~/images/Ppv2-Debugging-Light-Meter-Graph.png
-
BINcom.unity.postprocessing/Documentation~/images/Ppv2-Debugging-Vectorscope-Graph.png
-
BINcom.unity.postprocessing/Documentation~/images/Ppv2-Debugging-Waveform-Graph.png
-
BINcom.unity.postprocessing/Documentation~/images/Ppv2_Debugging_Histogram.png
-
BINcom.unity.postprocessing/Documentation~/images/Ppv2_Debugging_Waveform_Graph.png
-
BINcom.unity.postprocessing/Documentation~/images/Ppv2_Light Meter.png
-
BINcom.unity.postprocessing/Documentation~/images/Ppv2_Post-processing-Debug.png
-
BINcom.unity.postprocessing/Documentation~/images/aa-1.png
-
BINcom.unity.postprocessing/Documentation~/images/aa-2.png
-
BINcom.unity.postprocessing/Documentation~/images/aa-3.png
-
BINcom.unity.postprocessing/Documentation~/images/ao-off.png
-
BINcom.unity.postprocessing/Documentation~/images/ao-on.png
-
BINcom.unity.postprocessing/Documentation~/images/auto-exposure-off.png
-
BINcom.unity.postprocessing/Documentation~/images/auto-exposure-on.png
-
BINcom.unity.postprocessing/Documentation~/images/autoexposure.png
-
BINcom.unity.postprocessing/Documentation~/images/bloom.png
-
BINcom.unity.postprocessing/Documentation~/images/chroma.png
-
BINcom.unity.postprocessing/Documentation~/images/custom-effect-sorting.png
-
BINcom.unity.postprocessing/Documentation~/images/deferredfog.png
-
BINcom.unity.postprocessing/Documentation~/images/dof.png
-
BINcom.unity.postprocessing/Documentation~/images/grading-1.png
-
BINcom.unity.postprocessing/Documentation~/images/grading-10.png
-
BINcom.unity.postprocessing/Documentation~/images/grading-11.png
-
BINcom.unity.postprocessing/Documentation~/images/grading-2.png
-
BINcom.unity.postprocessing/Documentation~/images/grading-3.png
-
BINcom.unity.postprocessing/Documentation~/images/grading-4.png
-
BINcom.unity.postprocessing/Documentation~/images/grading-5.png
-
BINcom.unity.postprocessing/Documentation~/images/grading-6.png
-
BINcom.unity.postprocessing/Documentation~/images/grading-7.png
-
BINcom.unity.postprocessing/Documentation~/images/grading-8.png
-
BINcom.unity.postprocessing/Documentation~/images/grading-9.png
-
BINcom.unity.postprocessing/Documentation~/images/grain.png
-
BINcom.unity.postprocessing/Documentation~/images/home-after.png
-
BINcom.unity.postprocessing/Documentation~/images/home-before.png
-
BINcom.unity.postprocessing/Documentation~/images/hue-vs-hue.png
-
BINcom.unity.postprocessing/Documentation~/images/hue-vs-sat.png
-
BINcom.unity.postprocessing/Documentation~/images/lens-distortion.png
-
BINcom.unity.postprocessing/Documentation~/images/lensdistortion.png
-
BINcom.unity.postprocessing/Documentation~/images/lum-vs-sat.png
-
BINcom.unity.postprocessing/Documentation~/images/motionblur.png
-
BINcom.unity.postprocessing/Documentation~/images/no-lens-distortion.png
-
BINcom.unity.postprocessing/Documentation~/images/quickstart-1.png
-
BINcom.unity.postprocessing/Documentation~/images/quickstart-2.png
-
BINcom.unity.postprocessing/Documentation~/images/quickstart-3.png
-
BINcom.unity.postprocessing/Documentation~/images/sat-vs-sat.png
-
BINcom.unity.postprocessing/Documentation~/images/ssao-1.png
-
BINcom.unity.postprocessing/Documentation~/images/ssao-2.png
-
BINcom.unity.postprocessing/Documentation~/images/ssr.png
-
BINcom.unity.postprocessing/Documentation~/images/tonemapping.png
-
BINcom.unity.postprocessing/Documentation~/images/trackballs.png
-
BINcom.unity.postprocessing/Documentation~/images/vignette-1.png
-
BINcom.unity.postprocessing/Documentation~/images/vignette-2.png
-
BINcom.unity.postprocessing/Documentation~/images/yrgb-curves.png
-
15com.unity.postprocessing/Documentation~/index.md
-
5com.unity.postprocessing/Documentation~/known-issues.md
-
23com.unity.postprocessing/Documentation~/requirements.md
-
5com.unity.postprocessing/LICENSE.md
-
7com.unity.postprocessing/LICENSE.md.meta
-
8com.unity.postprocessing/PostProcessing.meta
-
9com.unity.postprocessing/PostProcessing/Editor.meta
-
9com.unity.postprocessing/PostProcessing/Editor/Attributes.meta
-
27com.unity.postprocessing/PostProcessing/Editor/Attributes/DecoratorAttribute.cs
-
12com.unity.postprocessing/PostProcessing/Editor/Attributes/DecoratorAttribute.cs.meta
-
28com.unity.postprocessing/PostProcessing/Editor/Attributes/PostProcessEditorAttribute.cs
-
12com.unity.postprocessing/PostProcessing/Editor/Attributes/PostProcessEditorAttribute.cs.meta
-
59com.unity.postprocessing/PostProcessing/Editor/BaseEditor.cs
-
12com.unity.postprocessing/PostProcessing/Editor/BaseEditor.cs.meta
-
9com.unity.postprocessing/PostProcessing/Editor/Decorators.meta
@ -0,0 +1,5 @@ |
|||||
|
{ |
||||
|
"timestamp": 1649276899, |
||||
|
"signature": "Uz3yekLHtnWL7w25ej6xvIKNRTSenmg5xgFVCW/d13pvms7Gv/OvUgVrm6FkjXVGQ+jf42aX7CK3w9lk70098i7QvvIchXRRiVE3gsdPJ33GJFqwbBJHhtc9mG3Y0DAwjbEWOYPlf55IgtXUmKyvaa4+jD+hBs4T0NqNhleIinDVOvSVZBLIBhnmQAMMOqhMqV4f8MnfbYxE1V2bq6D1bTyJ0toVLdEzteCrlIMc/Wudo2MUV3/ewvRWsVmPJuNPSzriRgZ/bArBz/uMX1TZgIzYPPif5y++cAa2higr7kcCS6WZwrq5wS+h/zeQpstDB8gv/GtS+GI+WiG1qqeOubKe30Ug4zlG9pL0wniTpJ6ZYAOTSvcOYqstKpDBM/EoCOn7y+ZxkKOVbAt2b6faRTJGrtTs+fnRQwj14ybInBXRWthTuiTXAbu3MN5N0eR/JFWB3C1+1siBTkJoWAD13jHK33fBtKctzCxED3DGMmjFQiUUVEo8XetLspKJCpHD", |
||||
|
"publicKey": "LS0tLS1CRUdJTiBQVUJMSUMgS0VZLS0tLS0KTUlJQm9qQU5CZ2txaGtpRzl3MEJBUUVGQUFPQ0FZOEFNSUlCaWdLQ0FZRUFzdUhXYUhsZ0I1cVF4ZEJjTlJKSAordHR4SmoxcVY1NTdvMlZaRE1XaXhYRVBkRTBEMVFkT1JIRXNSS1RscmplUXlERU83ZlNQS0ZwZ1A3MU5TTnJCCkFHM2NFSU45aHNQVDhOVmllZmdWem5QTkVMenFkVmdEbFhpb2VpUnV6OERKWFgvblpmU1JWKytwbk9ySTRibG4KS0twelJlNW14OTc1SjhxZ1FvRktKT0NNRlpHdkJMR2MxSzZZaEIzOHJFODZCZzgzbUovWjBEYkVmQjBxZm13cgo2ZDVFUXFsd0E5Y3JZT1YyV1VpWXprSnBLNmJZNzRZNmM1TmpBcEFKeGNiaTFOaDlRVEhUcU44N0ZtMDF0R1ZwCjVNd1pXSWZuYVRUemEvTGZLelR5U0pka0tldEZMVGdkYXpMYlpzUEE2aHBSK0FJRTJhc0tLTi84UUk1N3UzU2cKL2xyMnZKS1IvU2l5eEN1Q20vQWJkYnJMbXk0WjlSdm1jMGdpclA4T0lLQWxBRWZ2TzV5Z2hSKy8vd1RpTFlzUQp1SllDM0V2UE16ZGdKUzdGR2FscnFLZzlPTCsxVzROY05yNWdveVdSUUJ0cktKaWlTZEJVWmVxb0RvSUY5NHpCCndGbzJJT1JFdXFqcU51M3diMWZIM3p1dGdtalFra3IxVjJhd3hmcExLWlROQWdNQkFBRT0KLS0tLS1FTkQgUFVCTElDIEtFWS0tLS0tCg" |
||||
|
} |
||||
@ -0,0 +1,337 @@ |
|||||
|
# Changelog |
||||
|
All notable changes to this package will be documented in this file. |
||||
|
|
||||
|
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) |
||||
|
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). |
||||
|
|
||||
|
## [3.3.1] - 2023-06-02 |
||||
|
|
||||
|
### Fixed |
||||
|
- Fixed obsolete FormatUsage bug |
||||
|
|
||||
|
## [3.3.0] - 2023-05-11 |
||||
|
|
||||
|
### Fixed |
||||
|
- Fixed some post effects not scaling correctly when dynamic resolution is enabled on a camera's target texture (case 1166603) |
||||
|
- Fixed obsolete API call GetScriptingDefineSymbolsForGroup |
||||
|
- Remove support for OpenGL ES 2.0 in Unity 2023.1 or newer |
||||
|
|
||||
|
## [3.2.2] - 2022-04-05 |
||||
|
|
||||
|
### Fixed |
||||
|
- Fixed FXAA artefact when trying to preserve alpha channel output. |
||||
|
- Fixed MSVO aliasing artifact by using a z-Bias parameter. (case 1375337) |
||||
|
|
||||
|
## [3.2.1] - 2022-01-12 |
||||
|
|
||||
|
### Fixed |
||||
|
- Fixed missing XR warnings for XR non-friendly effects when using XR plugins (case 1328062) |
||||
|
- Fixed rendering artifacts when depth buffer is used after screen space reflections pass on iOS and M1 (case 1341052) |
||||
|
- Fixed compilation error when built-in VR module is disabled (case 1389160) |
||||
|
- Fixed bug where alpha could not be used with HDR on mobile (case 1387848). HDR texture format is now set from Graphics Tier Settings when using Unity 2019.3 or newer. |
||||
|
- Fixed incorrect Screen-space Reflections rendering on OpenGL platforms (case 1368370) |
||||
|
|
||||
|
## [3.2.0] - 2021-11-15 |
||||
|
|
||||
|
### Fixed |
||||
|
- Catch thrown errors in `PostProcessEffectRenderer`, preventing resources allocation leaks and crash (case 1221972) |
||||
|
- Fixed error thrown when changing post process layer right after creation or before destruction. |
||||
|
- Fix FXAA when render-target has no alpha channel (case 1344618) (case 1351502) |
||||
|
|
||||
|
## [3.1.1] - 2021-03-08 |
||||
|
|
||||
|
### Fixed |
||||
|
- Fix for broken MSVO on desktop platforms. |
||||
|
- Fix for compilation issue with BuildTarget error on XboxOne platform. |
||||
|
|
||||
|
## [3.1.0] - 2021-03-02 |
||||
|
|
||||
|
### Added |
||||
|
- Support for the PlayStation 5 platform has been added. |
||||
|
- Support for the XboxSeries platform has been added. |
||||
|
|
||||
|
### Fixed |
||||
|
- Fix for issue thrown upon unloading a scene from an AssetBundle (case 1262826) |
||||
|
- Fix for MSVO when used with dynamic resolution reallocating temporary render targets whenever the dynamic resolution scale was changed which could cause a higher peak VRAM usage and fragmentation (Case 1285605). Temporary targets will now use dynamic scaling as well to solve this. Please note there is a bug in Unity that breaks this fix (case 1285577) To make use of dynamic resolution and MSVO please use Unity 2019.4.19f1, 2020.2.2f1, 2021.1.0a9 or later. |
||||
|
- Fix for compilation error in the FinalPass shader with GLES2/WebGL1 (case 1311160) |
||||
|
- Fix for MSVO errors on unsupported Android platforms (case 1316915) |
||||
|
|
||||
|
## [3.0.3] - 2021-02-19 |
||||
|
|
||||
|
- bump version to 3.0.3 to not conflict with unrelease 3.0.2 |
||||
|
|
||||
|
## [3.0.2] - 2020-12-08 |
||||
|
|
||||
|
### Fixed |
||||
|
- Fix FXAA when running on render-targets without alpha channel: force using green channel as luminance |
||||
|
|
||||
|
### Changed |
||||
|
- ResetProjection isn't being called anymore if Temporal Anti-aliasing isn't enabled, allowing the use of custom projection matrices. |
||||
|
|
||||
|
## [3.0.1] - 2020-10-15 |
||||
|
|
||||
|
### Fixed |
||||
|
- Fix for a compilation error in the Depth of Field shader on Linux. |
||||
|
|
||||
|
## [3.0.0] - 2020-10-13 |
||||
|
|
||||
|
### Fixed |
||||
|
- Fix for VR Single Pass Instancing (SPI) not working with the built-in renderers. Only effects that currently support SPI for use with SRP will work correctly (so AO for example will not work with SPI even with this fix) (case 1187257) |
||||
|
- Fix for shader compilation errors when importing the 3D+Extras template (case 1234411) |
||||
|
- Fix Duplicated RenderTextures when using MultiScaleVO on Xbox (case 1235888) |
||||
|
- Fix for the rendering being broken when an SRP is in use and its asset comes from quality settings instead of graphics settings. |
||||
|
- Fix for burger buttons on volume components being misaligned on 2019.3+ (case 1238461) |
||||
|
- Fix for depth buffer being discarded when using deferred fog with Vulkan (case 1271512) |
||||
|
- Fix for compilation errors when the built-in VR package is disabled (case 1266931) |
||||
|
- Fix for Temporal Anti-Aliasing produces artifacts on the edges of objects when using VR (case 1167219) |
||||
|
- Fix for blurry image when using the Post Process Layer in single-pass VR (case 1173697) |
||||
|
- Fix for ambient occlusion is misaligned when using single pass rendering VR mode (case 1217583) |
||||
|
|
||||
|
### Changed |
||||
|
- Motion Blur and Lens Distortion are disabled only when rendering with stereo cameras instead of having VR enabled in the project. |
||||
|
- Minimum Unity version for this version has been bumped to 2018.4. |
||||
|
|
||||
|
## [2.3.0] - 2020-01-10 |
||||
|
|
||||
|
### Fixed |
||||
|
- Fix for XR multipass and legacy built-in renderer (case 1197855, 1152584) |
||||
|
- Optimized type lookup on domain reload in the editor (case 1203325) |
||||
|
- Fixed a serialization issue causing an assertion on resources (case 1202441) |
||||
|
|
||||
|
## [2.2.2] - 2019-11-18 |
||||
|
|
||||
|
### Fixed |
||||
|
- Fixed deprecated XR API usage. |
||||
|
|
||||
|
## [2.2.1] - 2019-11-07 |
||||
|
|
||||
|
### Fixed |
||||
|
- Fixed a compilation warning with Unity 2019.3 and 2020.1. |
||||
|
|
||||
|
### Changed |
||||
|
- Following a change in the compilation pipeline, this version is only compatible with Unity 2017.2 and up. |
||||
|
|
||||
|
## [2.1.9] - 2019-10-24 |
||||
|
|
||||
|
### Fixed |
||||
|
- Shader compilation error on PS4 with Unity 2019.3. |
||||
|
|
||||
|
## [2.1.8] - 2019-10-11 |
||||
|
|
||||
|
### Added |
||||
|
- Support for dynamic resolution. |
||||
|
|
||||
|
### Fixed |
||||
|
- Potential fp16 overflow in Depth of Field that could cause NaN on some platforms. |
||||
|
- Error with Screen-space Reflections when HDR is disabled. |
||||
|
- Internal "copy" materials were recreated on every frame after the asset bundle-related fix from 2.1.7. |
||||
|
|
||||
|
## [2.1.7] - 2019-06-12 |
||||
|
|
||||
|
### Added |
||||
|
- Initial Stadia platform support. |
||||
|
|
||||
|
### Fixed |
||||
|
- Viewport handling wasn't working correctly when FXAA or SMAA were used with builtin pipelines. |
||||
|
- Depth of Field could end up fully blurry depending on the project setup. |
||||
|
- Reloading an asset bundle that has references to post-processing was broken. |
||||
|
|
||||
|
### Changed |
||||
|
- Warning for mobiles about using post-processing with non-fullscreen cameras. |
||||
|
- Directly to Camera Target on the PostProcessLayer component is now disabled by default. |
||||
|
- The framework now uses its own random number generator instead of the default Unity one. |
||||
|
|
||||
|
## [2.1.6] - 2019-04-11 |
||||
|
|
||||
|
### Fixed |
||||
|
- Post-processing would crash if "Managed Stripping Level" was set to Medium or High. |
||||
|
- Serialization warnings on build. |
||||
|
- Removed unwanted garbage collection. |
||||
|
|
||||
|
## [2.1.5] - 2019-03-25 |
||||
|
|
||||
|
### Fixed |
||||
|
- LDR Color grading in gamma mode no longer produces banding artifacts on Mali GPUs on OpenGL ES2. |
||||
|
- Gamma mode no longer darken the screen with LWRP. |
||||
|
|
||||
|
## [2.1.4] - 2019-02-27 |
||||
|
|
||||
|
### Fixed |
||||
|
- Shader compilation errors with OpenGL ES2 and other platforms. |
||||
|
- Proper viewport support on Builtin render pipelines. |
||||
|
|
||||
|
## [2.1.3] - 2019-01-30 |
||||
|
|
||||
|
### Fixed |
||||
|
- Color grading would output negative values in some cases and break rendering on some platforms. |
||||
|
- Custom effects with `allowInSceneView` set to `false` could make the scene view flicker to black. |
||||
|
- R8_SRGB error in 2019.1 when Depth of Field and Temporal Anti-aliasing are enabled at the same time. |
||||
|
- Auto-exposure compute shader on Metal/iOS. |
||||
|
|
||||
|
## [2.1.2] - 2018-12-05 |
||||
|
|
||||
|
### Fixed |
||||
|
- Made the package manager happy. |
||||
|
|
||||
|
## [2.1.1] - 2018-11-30 |
||||
|
|
||||
|
### Fixed |
||||
|
- Optimized volume texture blending. |
||||
|
- Compilation issues with 2019.1+ on some platforms. |
||||
|
|
||||
|
### Changed |
||||
|
- Chromatic aberration is now forced to "fast mode" when running on GLES2.0 platforms due to compatibility issues. |
||||
|
|
||||
|
## [2.1.0] - 2018-11-26 |
||||
|
|
||||
|
### Changed |
||||
|
- Minor version bump following the release of 2018.3 and verified compatibility with 2019.1. |
||||
|
|
||||
|
## [2.0.20] - 2018-11-22 |
||||
|
|
||||
|
### Fixed |
||||
|
- Camera viewport wasn't working properly when outputting directly to the backbuffer. |
||||
|
- More improvements to VR support. |
||||
|
- Compatibility fixes for 2017.1 to 2017.4. |
||||
|
- Post-processing wouldn't work when loaded from an asset bundle. |
||||
|
- Compilation issue when Cinemachine is used with Post-processing. |
||||
|
|
||||
|
### Changed |
||||
|
- Scriptable Render Pipelines should now call `PostProcessLayer.UpdateVolumeSystem(Camera, CommandBuffer)` at the beginning of the frame. |
||||
|
|
||||
|
## [2.0.17-preview] - 2018-11-06 |
||||
|
|
||||
|
### Fixed |
||||
|
- First pass at improving VR support. |
||||
|
- Assert on Invalid LDR Lookup Texture size; added a check in the inspector for the user. |
||||
|
- Improved performance on Unity 2019.1+ by avoiding unnecessary blits if no other image effect is active. |
||||
|
- Use new ASTC enums on unity 2019.1+. |
||||
|
|
||||
|
## [2.0.16-preview] - 2018-10-23 |
||||
|
|
||||
|
### Fixed |
||||
|
- Grain shader compilation errors on some mobile GPUs. |
||||
|
- Compilation issue with Unity 2019.1+ due to an internal API change. |
||||
|
|
||||
|
## [2.0.15-preview] - 2018-10-12 |
||||
|
|
||||
|
### Fixed |
||||
|
- Warning on `[ShaderIncludePath]` in 2018.3+. |
||||
|
|
||||
|
## [2.0.14-preview] - 2018-10-05 |
||||
|
|
||||
|
### Fixed |
||||
|
- Bloom flicker in single-pass double-wide stereo rendering. |
||||
|
- Right eye bloom offset in single-pass double-wide stereo rendering. |
||||
|
- If any parent of PostProcessingVolume has non-identity scale the Gizmo is rendered incorrectly. |
||||
|
- Cleanup error when going back'n'forth between Builtins & Scriptable pipelines. |
||||
|
|
||||
|
### Changed |
||||
|
- Use `ExecuteAlways` in 2018.3+ for better compatibility with "Prefab Mode". |
||||
|
|
||||
|
## [2.0.13-preview] - 2018-09-14 |
||||
|
|
||||
|
### Fixed |
||||
|
- Compilation issue with Unity 2019.1. |
||||
|
- Screen-space reflection memory leak. |
||||
|
|
||||
|
## [2.0.12-preview] - 2018-09-07 |
||||
|
|
||||
|
### Fixed |
||||
|
- Ambient Occlusion could distort the screen on Android/Vulkan. |
||||
|
- Warning about SettingsProvider in 2018.3. |
||||
|
- Fixed issue with physical camera mode not working with post-processing. |
||||
|
- Fixed thread group warning message on Metal and Intel Iris. |
||||
|
- Fixed compatibility with versions pre-2018.2. |
||||
|
|
||||
|
## [2.0.10-preview] - 2018-07-24 |
||||
|
|
||||
|
### Fixed |
||||
|
- Better handling of volumes in nested-prefabs. |
||||
|
- The Multi-scale volumetric obscurance effect wasn't properly releasing some of its temporary targets. |
||||
|
- N3DS deprecation warnings in 2018.3. |
||||
|
|
||||
|
## [2.0.9-preview] - 2018-07-16 |
||||
|
|
||||
|
### Changed |
||||
|
- Update assembly definitions to output assemblies that match Unity naming convention (Unity.*). |
||||
|
|
||||
|
## [2.0.8-preview] - 2018-07-06 |
||||
|
|
||||
|
### Fixed |
||||
|
- Post-processing is now working with VR SRP in PC. |
||||
|
- Crash on Vulkan when blending 3D textures. |
||||
|
- `RuntimeUtilities.DestroyVolume()` works as expected now. |
||||
|
- Excessive CPU usage on PS4 due to a badly initialized render texture. |
||||
|
|
||||
|
### Changed |
||||
|
- Improved volume texture blending. |
||||
|
|
||||
|
### Added |
||||
|
- `Depth` debug mode can now display linear depth instead of the raw platform depth. |
||||
|
|
||||
|
## [2.0.7-preview] - 2018-05-31 |
||||
|
|
||||
|
### Fixed |
||||
|
- Post-processing wasn't working on Unity 2018.3. |
||||
|
|
||||
|
### Added |
||||
|
- Bloom now comes with a `Clamp` parameter to limit the amount of bloom that comes with ultra-bright pixels. |
||||
|
|
||||
|
## [2.0.6-preview] - 2018-05-24 |
||||
|
|
||||
|
### Fixed |
||||
|
- On large scenes, the first object you'd add to a profile could throw a `NullReferenceException`. ([#530](https://github.com/Unity-Technologies/PostProcessing/pull/530)) |
||||
|
- Dithering now works correctly in dark areas when working in Gamma mode. |
||||
|
- Colored grain wasn't colored when `POSTFX_DEBUG_STATIC_GRAIN` was set. |
||||
|
- No more warning in the console when `POSTFX_DEBUG_STATIC_GRAIN` is set. |
||||
|
|
||||
|
### Changed |
||||
|
- Minor scripting API improvements. ([#530](https://github.com/Unity-Technologies/PostProcessing/pull/530)) |
||||
|
- More implicit casts for `VectorXParameter` and `ColorParameter` to `Vector2`, `Vector3` and `Vector4`. |
||||
|
- Script-instantiated profiles in volumes are now properly supported in the inspector. ([#530](https://github.com/Unity-Technologies/PostProcessing/pull/530)) |
||||
|
- Improved volume UI & styling. |
||||
|
|
||||
|
## [2.0.5-preview] - 2018-04-20 |
||||
|
|
||||
|
### Fixed |
||||
|
- More XR/platform-specific related fixes. |
||||
|
|
||||
|
## [2.0.4-preview] - 2018-04-19 |
||||
|
|
||||
|
### Fixed |
||||
|
- Temporal Anti-aliasing creating NaN values in some cases. ([#337](https://github.com/Unity-Technologies/PostProcessing/issues/337)) |
||||
|
- Auto-exposure has been fixed to work the same way it did before the full-compute port. |
||||
|
- XR compilation errors specific-platforms (2018.2). |
||||
|
- `ArgumentNullException` when attempting to get a property sheet for a null shader. ([#515](https://github.com/Unity-Technologies/PostProcessing/pull/515)) |
||||
|
- Stop NaN Propagation not working for opaque-only effects. |
||||
|
- HDR color grading had a slight color temperature offset. |
||||
|
- PSVita compatibility. |
||||
|
- Tizen warning on 2018.2. |
||||
|
- Errors in the console when toggling lighting on/off in the scene view when working in Deferred. |
||||
|
- Debug monitors now work properly with HDRP. |
||||
|
|
||||
|
### Added |
||||
|
- Contribution slider for the LDR Lut. |
||||
|
- Support for proper render target load/store actions on mobile (2018.2). |
||||
|
|
||||
|
### Changed |
||||
|
- Slightly improved speed & quality of Temporal Anti-aliasing. |
||||
|
- Improved volume texture blending. |
||||
|
- Improved support for LDR Luts of sizes other than 1024x32. ([#507](https://github.com/Unity-Technologies/PostProcessing/issues/507)) |
||||
|
- Bloom's `Fast Mode` has been made faster. |
||||
|
- Depth of Field focus is now independent from the screen resolution. |
||||
|
- The number of variants for some shaders has been reduced to improve first-build speed. The biggest one, Uber, is down to 576 variants. |
||||
|
|
||||
|
## [2.0.3-preview] - 2018-03-13 |
||||
|
|
||||
|
### Fixed |
||||
|
- Disabled debug compute shaders on OpenGL ES3 to avoid crashes on a lot of Android devices. |
||||
|
- `NullReferenceException` while mixing volumes and global volumes. ([#498](https://github.com/Unity-Technologies/PostProcessing/issues/498)) |
||||
|
|
||||
|
### Changed |
||||
|
- Improved performances when blending between identical textures. |
||||
|
|
||||
|
## [2.0.2-preview] - 2018-03-07 |
||||
|
|
||||
|
This is the first release of *PostProcessing*. |
||||
@ -0,0 +1,7 @@ |
|||||
|
fileFormatVersion: 2 |
||||
|
guid: 76eb0b51417a8442180aa67edda7d01a |
||||
|
TextScriptImporter: |
||||
|
externalObjects: {} |
||||
|
userData: |
||||
|
assetBundleName: |
||||
|
assetBundleVariant: |
||||
@ -0,0 +1,68 @@ |
|||||
|
# Ambient Occlusion |
||||
|
|
||||
|
The **Ambient Occlusion** effect calculates points in your scene that are exposed to ambient lighting. It then darkens areas that are hidden from the ambient light, such as creases, holes, and spaces between objects which are close together. |
||||
|
|
||||
|
You can achieve the **Ambient Occlusion** effect in two ways: in real-time as a full-screen post-processing effect, or as a baked lighting effect (see [Baked Ambient Occlusion](https://docs.unity3d.com/Manual/LightingBakedAmbientOcclusion.html)). The real-time **Ambient Occlusion** effect can be resource-intensive, which makes it better for desktop or console platforms. Its impact on processing time depends on screen resolution and effects properties. |
||||
|
|
||||
|
The **Ambient Occlusion** effect in this package has two modes: |
||||
|
|
||||
|
- Scalable Ambient Obscurance |
||||
|
- Multi-scale Volumetric Occlusion |
||||
|
|
||||
|
 |
||||
|
Scene without **Ambient Occlusion**. |
||||
|
|
||||
|
 |
||||
|
Scene with **Ambient Occlusion**. |
||||
|
|
||||
|
## Scalable Ambient Obscurance |
||||
|
|
||||
|
This is a standard implementation of ambient obscurance that works on older platforms. If you need to target a compute-enabled platform, use the [**Multi-scale Volumetric Occlusion**](multi-scale-volumetric-occlusion) mode instead. |
||||
|
|
||||
|
### Performance |
||||
|
|
||||
|
The **Scalable Ambient Obscurance** mode can be resource-intensive, especially when viewed very close to the Camera. To improve performance, use a low `Radius` setting, to sample pixels that are close and in clip space to the source pixel. This makes caching more efficient. Using a higher `Radius` setting generates samples further away from the source pixel and won’t benefit from caching, which slows down the effect. |
||||
|
|
||||
|
Because of the Camera’s perspective, objects near the front plane use larger radiuses than those far away, so computing the ambient occlusion pass for an object close to the camera will be slower than for an object further away that only occupies a few pixels on screen. |
||||
|
|
||||
|
Dropping the `Quality` setting down will improve performance too. |
||||
|
|
||||
|
**Scalable Ambient Obsurance** should not be used on mobile platforms or consoles as the **Multi-scale Volumetric Occlusion** mode is faster and provides better graphics for these platforms. |
||||
|
|
||||
|
### Requirements |
||||
|
|
||||
|
- Depth & Normals textures |
||||
|
- Shader model 3 |
||||
|
|
||||
|
### Properties |
||||
|
|
||||
|
| Property | Function | |
||||
|
| :----------- | :------------------------------------------------------------ | |
||||
|
| Mode | Select the type of **Ambient Occlusion** to use. | |
||||
|
| Intensity | Adjust the degree of darkness **Ambient Occlusion** produces. | |
||||
|
| Radius | Set the radius of sample points, which controls the extent of darkened areas. | |
||||
|
| Quality | Define the number of sample points, which affects quality and performance. | |
||||
|
| Color | Set the tint color of the ambient occlusion. | |
||||
|
| Ambient Only | Enable this checkbox to make the **Ambient Occlusion** effect only affect ambient lighting. This option is only available with the Deferred rendering path and HDR rendering. | |
||||
|
|
||||
|
<a name="multi-scale-volumetric-occlusion"></a> |
||||
|
|
||||
|
## Multi-scale Volumetric Occlusion |
||||
|
|
||||
|
This mode is optimized for consoles and desktop platforms. It has better graphics and runs faster than **Scalable Ambient Obscurance** on these platforms but requires [compute shader support](https://docs.unity3d.com/Manual/class-ComputeShader.html). |
||||
|
|
||||
|
### Requirements |
||||
|
|
||||
|
- Compute shader support |
||||
|
- Shader model 4.5 |
||||
|
|
||||
|
### Properties |
||||
|
|
||||
|
| Property | Function | |
||||
|
| :----------------- | :------------------------------------------------------------ | |
||||
|
| Mode | Select the type of **Ambient Occlusion** to use. | |
||||
|
| Intensity | Adjust the degree of darkness **Ambient Occlusion** produces. | |
||||
|
| Thickness Modifier | Modify the thickness of occluders. This increases dark areas but can introduce dark halos around objects. | |
||||
|
| Z Bias | Modifies the z-bias to the depth buffer. This eliminates the banding aliasing artifact for MSVO. | |
||||
|
| Color | Set the tint color of the ambient occlusion. | |
||||
|
| Ambient Only | Enable this checkbox to make the **Ambient Occlusion** effect only affect ambient lighting. This option is only available with the Deferred rendering path and HDR rendering. | |
||||
@ -0,0 +1,89 @@ |
|||||
|
# Anti-aliasing |
||||
|
|
||||
|
The **Anti-aliasing** effect softens the appearance of edges in your scene. To do this, it surrounds the edge with similar points of color. This reduces the jagged effect caused by [aliasing](https://en.wikipedia.org/wiki/Aliasing). |
||||
|
|
||||
|
 |
||||
|
|
||||
|
The Post-processing anti-aliasing algorithms are image-based, which is useful when support for traditional multisampling is not available, such as the [deferred rendering](https://docs.unity3d.com/Manual/RenderTech-DeferredShading.html) path. You can configure the rendering settings in the [Quality settings](https://docs.unity3d.com/Manual/class-QualitySettings.html) window. |
||||
|
|
||||
|
The Post-processing stack offers the following anti-aliasing modes: |
||||
|
|
||||
|
- [**Fast Approximate Anti-aliasing (FXAA)**](#fast-approximate-anti-aliasing); a fast algorithm for mobile and platforms that don’t support motion vectors. |
||||
|
- [**Subpixel Morphological Anti-aliasing (SMAA)**](#subpixel-morphological-anti-aliasing); a high-quality but slower algorithm for mobile and platforms that don’t support motion vectors. |
||||
|
- [**Temporal Anti-aliasing (TAA)**](#temporal-anti-aliasing); an advanced technique which requires motion vectors. Ideal for desktop and console platforms. |
||||
|
|
||||
|
Each mode is set per-camera in the **Post-process Layer** component. |
||||
|
|
||||
|
<a name="fast-approximate-anti-aliasing"></a> |
||||
|
|
||||
|
## Fast Approximate Anti-aliasing (FXAA) |
||||
|
|
||||
|
**FXAA** is the most efficient anti-aliasing technique. It's ideal for mobile and other platforms that don’t support motion vectors, which are required for **Temporal Anti-aliasing**. |
||||
|
|
||||
|
### Properties |
||||
|
|
||||
|
| Property | Function | |
||||
|
| :--------- | :----------------------------------------------------------- | |
||||
|
| Mode | Select the type of **Anti-Aliasing** to use. | |
||||
|
| Fast Mode | Enable **Fast Mode** for a lower quality but faster variant of FXAA. This option is ideal for mobile platforms. | |
||||
|
| Keep Alpha | Enable **Keep Alpha** to keep the alpha channel untouched by post-processing. If Keep Alpha is disabled, Unity uses the alpha channel to store internal data used to speed up and improve visual quality. | |
||||
|
|
||||
|
### Performance |
||||
|
|
||||
|
Enable `Fast Mode` if you are developing for mobile devices to get a performance boost. It will also provide a small boost for consoles. `Fast Mode` does not provide any extra benefits for desktop GPUs. In this case regular mode should be used for added visual quality. |
||||
|
|
||||
|
### Requirements |
||||
|
|
||||
|
- Shader Model 3 |
||||
|
|
||||
|
<a name="subpixel-morphological-anti-aliasing"></a> |
||||
|
|
||||
|
## Subpixel Morphological Anti-aliasing (SMAA) |
||||
|
|
||||
|
**SMAA** is a higher quality anti-aliasing effect than **FXAA** but it's also slower. Depending on the art-style of your game it can work as well as **Temporal Anti-aliasing** while avoiding some of the shortcomings of this technique. |
||||
|
|
||||
|
### Properties |
||||
|
|
||||
|
| Property | Function | |
||||
|
| :------- | :----------------------------------------------- | |
||||
|
| Mode | Select the type of **Anti-Aliasing** to use. | |
||||
|
| Quality | Set the overall quality of the anti-aliasing filter. | |
||||
|
|
||||
|
### Performance |
||||
|
|
||||
|
Lowering the `Quality` setting makes the effect run faster. Do not use **SMAA** on mobile platforms. |
||||
|
|
||||
|
### Known issues and limitations |
||||
|
|
||||
|
- SMAA doesn't support AR/VR. |
||||
|
|
||||
|
### Requirements |
||||
|
|
||||
|
- Shader Model 3 |
||||
|
|
||||
|
<a name="temporal-anti-aliasing"></a> |
||||
|
|
||||
|
## Temporal Anti-aliasing (TAA) |
||||
|
|
||||
|
**TAA** is an advanced anti-aliasing technique where frames are accumulated over time in a history buffer to be used to smooth edges more effectively. It is substantially better at smoothing edges in motion but requires motion vectors and is more expensive than **FXAA**. It is ideal for desktop and console platforms. |
||||
|
|
||||
|
### Properties |
||||
|
|
||||
|
| Property | Function | |
||||
|
| :------------------ | :----------------------------------------------------------- | |
||||
|
| Mode | Select the type of **Anti-Aliasing** to use. | |
||||
|
| Jitter Spread | Set the diameter (in texels) over which Unity spreads jitter samples. Smaller values result in crisper but a more aliased output. Larger values result in more stable but blurrier output. | |
||||
|
| Stationary Blending | Set the blend coefficient for stationary fragments. This setting controls the percentage of history sample blended into final color for fragments with minimal active motion. | |
||||
|
| Motion Blending | Set the blending coefficient for moving fragments. This setting controls the percentage of history sample blended into the final color for fragments with significant active motion. | |
||||
|
| Sharpness | Set the sharpness to alleviate the slight loss of details in high frequency regions which can be caused by TAA. | |
||||
|
|
||||
|
### Known issues and limitations |
||||
|
|
||||
|
- Not supported on GLES2 platforms. |
||||
|
- [Universal Render Pipeline (URP)](https://docs.unity3d.com/Packages/com.unity.render-pipelines.universal@7.5/manual/index.html) does not support Temporal Anti-aliasing. |
||||
|
|
||||
|
### Requirements |
||||
|
|
||||
|
- Motion vectors |
||||
|
- Depth texture |
||||
|
- Shader Model 3 |
||||
@ -0,0 +1,51 @@ |
|||||
|
# Auto Exposure |
||||
|
|
||||
|
The **Auto Exposure** effect simulates how the human eye adjusts to changes in brightness in real-time. To do this, it dynamically adjusts the exposure of an image to match its mid-tone. |
||||
|
|
||||
|
In Unity, this effect generates a histogram on every frame and filters it to find the average luminance value. This histogram and the **Auto Exposure** effect requires [Compute shader](https://docs.unity3d.com/Manual/class-ComputeShader.html) support. |
||||
|
|
||||
|
 |
||||
|
Scene without **Auto Exposure**. |
||||
|
|
||||
|
 |
||||
|
Scene with **Auto Exposure**. |
||||
|
|
||||
|
### Properties |
||||
|
|
||||
|
**Exposure** settings: |
||||
|
|
||||
|
| Property | Function | |
||||
|
| :--------------------- | :------------------------------------------------------------ | |
||||
|
| Filtering | Set the lower and upper percentages of the histogram that find a stable average luminance. Values outside of this range will be discarded and won't contribute to the average luminance. | |
||||
|
| Minimum | Set the minimum average luminance to consider for auto exposure in EV. | |
||||
|
| Maximum | Set the maximum average luminance to consider for auto exposure in EV. | |
||||
|
| Exposure Compensation | Set the middle-grey value to compensate the global exposure of the scene. | |
||||
|
|
||||
|
**Adaptation** settings: |
||||
|
|
||||
|
| Property | Function | |
||||
|
| :---------- | :------------------------------------------------------------ | |
||||
|
| Type | Select the Adaptation type. **Progressive** animates the Auto Exposure. **Fixed** does not animate the Auto Exposure. | |
||||
|
| Speed Up | Set the Adaptation speed from a dark to a light environment. | |
||||
|
| Speed Down | Set the Adaptation speed from a light to a dark environment. | |
||||
|
|
||||
|
### Details |
||||
|
|
||||
|
Use the `Filtering` range to exclude the darkest and brightest part of the image so that very dark and very bright pixels do not contribute to the average luminance. Values are in percent. |
||||
|
|
||||
|
`Minimum`/`Maximum` values clamp the computed average luminance into a given range. |
||||
|
|
||||
|
You can set the `Type` to `Fixed` and it will behave like an auto-exposure setting. |
||||
|
|
||||
|
You can debug the exposure in your scene with the **Post-process Debug** component. To do this, add the **Post-process Debug** component to your Camera and enable the **Light Meter** monitor. |
||||
|
|
||||
|
The Light Meter monitor creates a logarithmic histogram that appears in the **Game** window. This displays information about the exposure in your scene in real time. For more information, see [Debugging](#Debugging). |
||||
|
|
||||
|
 |
||||
|
|
||||
|
The Light Meter monitor. |
||||
|
|
||||
|
### Requirements |
||||
|
|
||||
|
- Compute shader |
||||
|
- Shader model 5 |
||||
@ -0,0 +1,43 @@ |
|||||
|
# Bloom |
||||
|
|
||||
|
The **Bloom** effect makes bright areas in your image glow. To do this, it creates fringes of light that extend from bright areas in your image. This simulates the effect a real-world camera gives when light overwhelms the lens. |
||||
|
|
||||
|
The Bloom effect also has a **Dirtiness** feature, which you can use to apply a full-screen layer of smudges or dust to diffract the Bloom effect. |
||||
|
|
||||
|
 |
||||
|
|
||||
|
### Properties |
||||
|
|
||||
|
**Bloom** settings: |
||||
|
|
||||
|
| Property | Function | |
||||
|
| :---------------- | :------------------------------------------------------------ | |
||||
|
| Intensity | Set the strength of the **Bloom** filter. | |
||||
|
| Threshold | Set the level of brightness to filter out pixels under this level. This value is expressed in gamma-space. | |
||||
|
| Soft Knee | Set the gradual threshold for transitions between under/over-threshold (0 = hard threshold, 1 = soft threshold). | |
||||
|
| Clamp | Set the value for clamping pixels to control the **Bloom** amount. This value is expressed in gamma-space. | |
||||
|
| Diffusion | Set the extent of veiling effects in a screen resolution-independent fashion. | |
||||
|
| Anamorphic Ratio | Set the ratio to scale the **Bloom** vertically (in range [-1,0]) or horizontally (in range [0,1]). This emulates the effect of an anamorphic lens. | |
||||
|
| Color | Select the color of the tint of the **Bloom** filter. | |
||||
|
| Fast Mode | Enable this checkbox to boost performance by lowering the **Bloom** effect quality. | |
||||
|
|
||||
|
**Dirtiness** settings: |
||||
|
|
||||
|
| Property | Function | |
||||
|
| --------- | ----------------------------------------------------- | |
||||
|
| Texture | Select a Dirtiness texture to add smudges or dust to the lens. | |
||||
|
| Intensity | Set the amount of lens dirtiness. | |
||||
|
|
||||
|
### Details |
||||
|
|
||||
|
With properly exposed HDR scenes, the `Threshold` should be set to ~1 so that only pixels with values above 1 leak into surrounding objects. Lower this value when working in LDR or the Bloom effect won’t be visible. |
||||
|
|
||||
|
### Performance |
||||
|
|
||||
|
Lowering the `Diffusion` parameter will make the effect faster. The further away `Anamorphic Ratio` is from 0, the slower it will be. Enable `Fast Mode` if you are developing for mobile or low-end platforms to get a significant boost in performance. |
||||
|
|
||||
|
Lower resolution lens dirt textures result in faster lookup and blending across volumes. |
||||
|
|
||||
|
### Requirements |
||||
|
|
||||
|
- Shader model 3 |
||||
@ -0,0 +1,42 @@ |
|||||
|
# Chromatic Aberration |
||||
|
|
||||
|
The **Chromatic Aberration** effect splits color along boundaries in an image into their red, green, and blue channels. This reproduces the effect a real-world camera produces when light refracts and causes the wavelengths to disperse in the lens. |
||||
|
|
||||
|
Unity provides support for red/blue and green/purple fringing. You can define fringing colors by using an input texture. |
||||
|
|
||||
|
 |
||||
|
Scene without **Chromatic Aberration**. |
||||
|
|
||||
|
 |
||||
|
Scene with **Chromatic Aberration**. |
||||
|
|
||||
|
### Properties |
||||
|
|
||||
|
| Property | Function | |
||||
|
| :------------ | :------------------------------------------------------------ | |
||||
|
| Spectral Lut | Select the texture used for a custom fringing color. When left empty, Unity will use the default texture. | |
||||
|
| Intensity | Set the strength of the **Chromatic Aberration** effect. | |
||||
|
| Fast Mode | Use a faster variant of **Chromatic Aberration** effect for improved performance. | |
||||
|
|
||||
|
### Details |
||||
|
|
||||
|
**Chromatic Aberration** uses a `Spectral Lut` input for custom fringing. Four example spectral textures are provided in the repository: |
||||
|
|
||||
|
- Red/Blue (Default) |
||||
|
- Blue/Red |
||||
|
- Green/Purple |
||||
|
- Purple/Green |
||||
|
|
||||
|
You can create custom spectral textures in any image editing software. While the resolution size of spectral textures are not limited, small sizes like the 3x1 textures provided work best. |
||||
|
|
||||
|
You can achieve a rougher effect by manually setting the **Filter Mode** of the input texture to **Point (no filter)** in the [Texture Import Settings](https://docs.unity3d.com/Manual/class-TextureImporter.html) window. |
||||
|
|
||||
|
### Performance |
||||
|
|
||||
|
The performance of the **Chromatic Aberration** effect depends on its `Intensity` value. If the `Intensity` value is high, the render uses more samples to render smooth chromatic aberrations. This makes the process take more time. |
||||
|
|
||||
|
**Fast Mode** is the quickest mode and recommended where possible. However, it's not as smooth as the regular mode. |
||||
|
|
||||
|
### Requirements |
||||
|
|
||||
|
- Shader Model 3 |
||||
@ -0,0 +1,142 @@ |
|||||
|
# Color Grading |
||||
|
|
||||
|
The **Color Grading** effect alters or corrects the color and luminance of the final image that Unity produces. You can use this to alter the look and feel of your application. |
||||
|
|
||||
|
 |
||||
|
|
||||
|
The **Color Grading** effect comes with three modes: |
||||
|
|
||||
|
- **Low Definition Range (LDR):** ideal for lower-end platforms. Grading is applied to the final rendered frame clamped in a [0,1] range and stored in a standard LUT. |
||||
|
- **High Definition Range (HDR):** ideal for platforms that support HDR rendering. All color operations are applied in HDR and stored into a 3D log-encoded LUT to ensure a sufficient range coverage and precision (Alexa LogC El1000). |
||||
|
- **External:** for use with custom 3D LUTs authored in external software. |
||||
|
|
||||
|
## Global Settings |
||||
|
|
||||
|
Use these settings to control how the **Color Grading** effect operates. |
||||
|
|
||||
|
The Lookup Texture and Contribution settings are only available for **Low Definition Range** and **External** modes. |
||||
|
|
||||
|
### Properties |
||||
|
|
||||
|
| Property | Function | |
||||
|
| :-------------- | :------------------------------------------------------------ | |
||||
|
| Mode | Select the **Color Grading** effect mode. | |
||||
|
| Lookup Texture | **LDR:** Select a custom lookup texture (strip format, e.g. 256x16) to apply before the rest of the color grading operators. If none is provided, a neutral one will be generated internally.<br /><br />**External**: A custom 3D log-encoded texture.| |
||||
|
| Contribution | **LDR:** Set how much of the lookup texture will contribute to the color grading. | |
||||
|
|
||||
|
> **Note:** Volume blending between multiple LDR lookup textures is supported but only works correctly if they're the same size. For this reason it is recommended to stick to a single LUT size for the whole project (256x16 or 1024x32). |
||||
|
|
||||
|
## Tonemapping |
||||
|
|
||||
|
The **Tonemapping** effect remaps high dynamic range (HDR) colors into a range suitable for mediums with low dynamic range (LDR), such as CRT or LCD screens. Its most common purpose is to make an image with a low dynamic range appear to have a higher range of colors. |
||||
|
|
||||
|
This result increases the range of colors and contrast in an image to give a more dynamic and realistic effect. See Wikipedia: [Tone mapping](https://en.wikipedia.org/wiki/Tone_mapping). |
||||
|
|
||||
|
Always apply **Tonemapping** when using an HDR camera, otherwise color intensity values above 1 will be clamped at 1, altering the Scene's luminance balance. |
||||
|
|
||||
|
### Properties |
||||
|
|
||||
|
 |
||||
|
|
||||
|
| Property | Function | |
||||
|
| :----------------- | :------------------------------------------------------------ | |
||||
|
| Mode | Only available in the **High Definition Range** mode. Select the Tonemapping mode from the dropdown menu.</br> **None**: No **Tonemapping** applied.</br> **Neutral**: Applies a range-remapping with minimal impact on color hue and saturation. </br> **ACES**: Applies a close approximation of the reference [ACES](http://www.oscars.org/science-technology/sci-tech-projects/aces) tonemapper for a cinematic look. This effect has more contrast than **Neutral** affects color hue and saturation. When this tonemapper is enabled, all grading operations are performed in the ACES color spaces for optimal precision and results.</br> **Custom**: A fully parametric tonemapper. This is the only tonemapper with its own settings. | |
||||
|
| Toe Strength | Set a value for the transition between the toe and the mid section of the curve. A value of 0 means no toe, a value of 1 means a very hard transition. | |
||||
|
| Toe Length | Set the value for how much of the dynamic range is in the toe. With a small value, the toe will be very short and quickly transition into the linear section, and with a longer value having a longer toe. | |
||||
|
| Shoulder Strength | Set the value for the transition between the mid section and the shoulder of the curve. A value of 0 means no shoulder, value of 1 means a very hard transition. | |
||||
|
| Shoulder Length | Set the value for how many F-stops (EV) to add to the dynamic range of the curve. | |
||||
|
| Shoulder Angle | Set the value for how much overshot to add to the shoulder. | |
||||
|
| Gamma | Set the value for applying a gamma function to the curve. | |
||||
|
|
||||
|
## White Balance |
||||
|
|
||||
|
**White Balance** allows you to adjust the overall tint and temperature of your image to create a colder or warmer feel in the final render. |
||||
|
|
||||
|
### Properties |
||||
|
|
||||
|
| Property | Function | |
||||
|
| :----------- | :------------------------------------------------------------ | |
||||
|
| Temperature | Set the white balance to a custom color temperature. | |
||||
|
| Tint | Set the white balance to compensate for a green or magenta tint. | |
||||
|
|
||||
|
## Tone |
||||
|
|
||||
|
### Properties |
||||
|
|
||||
|
| Property | Function | |
||||
|
| :------------- | :------------------------------------------------------------ | |
||||
|
| Post-exposure | Only available in the **High Definition Range (HDR)** mode. </br>Set the value for 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. | |
||||
|
| Color Filter | Select a color for the Tint of the render. | |
||||
|
| Hue Shift | Adjust the hue of all colors. | |
||||
|
| Saturation | Adjust the intensity of all colors. | |
||||
|
| Brightness | Only available in the **Low Definition Range (LDR)** mode. </br>Adjust the brightness of the image.<br /> | |
||||
|
| Contrast | Adjust the overall range of tonal values. | |
||||
|
|
||||
|
## Channel Mixer |
||||
|
|
||||
|
You can use the **Channel Mixer** to adjust the color balance of your image. |
||||
|
|
||||
|
The **Channel Mixer** effect modifies the influence each input color channel has on the overall mix of the output channel. For example, if you increase the influence of the green channel on the overall mix of the red channel, all areas of the final image that include a green tone tint to a more reddish hue. |
||||
|
|
||||
|
### Properties |
||||
|
|
||||
|
| Property | Function | |
||||
|
| :-------- | :------------------------------------------------------------ | |
||||
|
| Channel | Select the output channel to modify. | |
||||
|
| Red | Adjust the influence of the red channel within the overall mix. | |
||||
|
| Green | Adjust the influence of the green channel within the overall mix. | |
||||
|
| Blue | Adjust the influence of the blue channel within the overall mix. | |
||||
|
|
||||
|
## Trackballs |
||||
|
|
||||
|
Use **Trackballs** to perform three-way color grading. Adjust the position of the point on the trackball to shift the hue of the image towards that color in each tonal range. Each trackball affects different ranges within the image. Adjust the slider under the trackball to offset the color lightness of that range. |
||||
|
|
||||
|
> **Note:** you can right-click a trackball to reset it to its default value. To change the trackball's sensitivity go to `Edit -> Preferences -> PostProcessing`. |
||||
|
|
||||
|
 |
||||
|
|
||||
|
### Properties |
||||
|
|
||||
|
| Property | Function | |
||||
|
| :-------- | :------------------------------------ | |
||||
|
| Lift | Adjust the dark tones (or shadows). | |
||||
|
| Gamma | Adjust the mid-tones. | |
||||
|
| Gain | Adjust the highlights. | |
||||
|
|
||||
|
## Grading Curves |
||||
|
|
||||
|
**Grading Curves** allows you to adjust specific ranges in hue, saturation, or luminosity. You can adjust the curves on the eight available graphs to achieve effects such as specific hue replacement or desaturating certain luminosities. |
||||
|
|
||||
|
### YRGB Curves |
||||
|
|
||||
|
**YRGB Curves** are only available in the **Low Definition Range (LDR)** mode. These curves, also called `Master`, `Red`, `Green` and `Blue` affect the selected input channel's intensity across the whole image. The X axis of the graph represents input intensity and the Y axis represents output intensity for the selected channel. Use these curves to adjust the appearance of attributes such as contrast and brightness. |
||||
|
|
||||
|
 |
||||
|
|
||||
|
### Hue vs Hue |
||||
|
|
||||
|
Use **Hue vs Hue** to shift hues within specific ranges. This curve shifts the input hue (X axis) according to the output hue (Y axis). Use this setting to fine tune hues of specific ranges or perform color replacement. |
||||
|
|
||||
|
 |
||||
|
|
||||
|
### Hue vs Sat |
||||
|
|
||||
|
Use **Hue vs Sat** to adjust the saturation of hues within specific ranges. This curve adjusts saturation (Y axis) according to the input hue (X axis). Use this setting to tone down particularly bright areas or create artistic effects. |
||||
|
|
||||
|
 |
||||
|
|
||||
|
### Sat vs Sat |
||||
|
|
||||
|
Use **Sat vs Sat** to adjust the saturation of areas of certain saturation. This curve adjusts saturation (Y axis) according to the input saturation (X axis). Use this setting to fine tune saturation adjustments made with settings from the [**Tone**](#tone) section. |
||||
|
|
||||
|
 |
||||
|
|
||||
|
### Lum vs Sat |
||||
|
|
||||
|
Use **Lum vs Sat** to adjust the saturation of areas of certain luminance. This curve adjusts saturation (Y axis) according to the input luminance (X axis). use this setting to desaturate areas of darkness to provide an interesting visual contrast. |
||||
|
|
||||
|
 |
||||
|
|
||||
|
### Requirements |
||||
|
|
||||
|
- Shader Model 3 |
||||
@ -0,0 +1,101 @@ |
|||||
|
# Debugging Post-processing effects |
||||
|
|
||||
|
The **Post-process Debug** component displays real-time data about post-processing effects. You can use this data to debug your post-processing effects, and to see the results of adjusting your effects in real time. |
||||
|
|
||||
|
When you attach the Post-Process Debug component to a GameObject with a Camera component, the Post-Process Debug component displays its data on top of that Camera's output. You can use the Post-process Debug component in the Unity Editor, or when your application is running on a device. |
||||
|
|
||||
|
 |
||||
|
|
||||
|
## Using the Post-Process Debug component |
||||
|
|
||||
|
To use the Post-Process Debug component, create a **Post-process Debug** component on a GameObject. To do this, go to the Inspector window and select **Add component** > **Post-process Debug.** |
||||
|
|
||||
|
Use **Post Process Layer** to choose the post-processing layer that you want to view debug information for. If you create the Post-process Debug component on the Main Camera, Unity automatically assigns Main Camera to this field. |
||||
|
To view an overlay that shows the state of an intermediate pass, select an intermediate pass from the **Debug Overlay** drop-down menu. Unity displays the overlay in the Game window. |
||||
|
|
||||
|
To use the [Light Meter](#light-meter) monitor, enable **Light Meter**. Unity displays a logarithmic histogram in the Game view that represents exposure. If you have the [**Auto Exposure**](https://docs.unity3d.com/Packages/com.unity.postprocessing@latest?subfolder=/manual/Auto-Exposure.html) post processing effect enabled, the histogram contains a thin line that indicates the current exposure. There is also a translucent area between the maximum and minimum exposure values. You can configure these exposure values in the **Auto Exposure** effect. The result of your changes appear in the Light Meter monitor in real-time. |
||||
|
|
||||
|
To view Tonemapping curves in the Light Meter histogram, enable **Show Curves**. |
||||
|
|
||||
|
To use the [Histogram](#histogram) monitor, enable **Histogram**. Unity displays a linear Gamma histogram in the Game view that represents exposure data in real-time in the rendered image. **Histogram** displays exposure data in more detail than **Light Meter**. Use the **Channel** drop-down menu to select the color data the Histogram displays. |
||||
|
|
||||
|
To use [Waveform](#waveform) monitor, enable **Waveform**. Unity displays a waveform in the Game view which represents the full spectrum of Luma (brightness) data in real-time in the rendered image. |
||||
|
|
||||
|
## Properties |
||||
|
|
||||
|
This section describes the settings that the Unity Editor displays in the Inspector for the **Post-Process Debug** component. |
||||
|
|
||||
|
| **Property** | **Description** | |
||||
|
|--------------------|-----------------| |
||||
|
| Post Process Layer | Select the post-processing layer that the Post-process Debug component uses.| |
||||
|
|
||||
|
### Overlay |
||||
|
|
||||
|
**Overlay** determines the intermediate pass that Unity displays in the Game window. |
||||
|
|
||||
|
| **Property** | **Description** | |
||||
|
| ------------- | ------------------------------------------------------------ | |
||||
|
| Debug overlay | Set the overlay view. Choose between different key intermediate passes to observe the state at this point in the frame. | |
||||
|
|
||||
|
## Monitors |
||||
|
|
||||
|
**Monitors** allow you to view data that Unity collects from the Game window in real-time. |
||||
|
|
||||
|
<a name="light-meter"></a> |
||||
|
### Light meter |
||||
|
The **Light Meter monitor** displays a logarithmic histogram in the Game window that represents exposure in the Camera’s output. You can control the exposure using the [**Auto Exposure**](https://docs.unity3d.com/Packages/com.unity.postprocessing@latest?subfolder=/manual/Auto-Exposure.html) component. When you configure the exposure values, Unity creates two new bars on the histogram: |
||||
|
|
||||
|
- A thin pink bar that indicates the current exposure value. |
||||
|
- A translucent blue bar that indicates the area between the maximum and minimum exposure values. |
||||
|
|
||||
|
 |
||||
|
The **Light Meter Histogram** that Unity shows in the Game window. |
||||
|
|
||||
|
| **Property** | **Description** | |
||||
|
|--------------|---------------------------------------------------------------------------------------------| |
||||
|
| Light meter | Enable this checkbox to display the **Light meter** monitor in the Game window. | |
||||
|
| Show Curves | Enable this checkbox to display Tonemapping curves monitor in the **Light meter** histogram | |
||||
|
|
||||
|
<a name="histogram"></a> |
||||
|
### Histogram |
||||
|
The **Histogram** monitor displays a gamma histogram in the Game. A histogram graphs the number of pixels at each color intensity level, to illustrate how pixels in an image are distributed. It can help you determine whether an image is properly exposed or not. |
||||
|
|
||||
|
 |
||||
|
|
||||
|
The **Histogram** that Unity shows in the Game window. |
||||
|
|
||||
|
| **Property** | **Description** | |
||||
|
|--------------|-----------------| |
||||
|
| Histogram |Enable this checkbox to display the **Histogram** monitor in the Game window.| |
||||
|
| Channel | Select the color value.| |
||||
|
|
||||
|
<a name="waveform"></a> |
||||
|
### Waveform |
||||
|
|
||||
|
The **Waveform** monitor displays the full range of Luma (brightness) information in the Camera’s output. Unity displays the Waveform in the Game window. The horizontal axis of the graph corresponds to the render (from left to right) and the vertical axis is the brightness value. |
||||
|
|
||||
|
 |
||||
|
|
||||
|
The **Waveform** that Unity shows in the Game window. |
||||
|
|
||||
|
| **Property** | **Description** | |
||||
|
| ------------ | ------------------------------------------------------------ | |
||||
|
| Waveform | Enable this checkbox to display the **Waveform** monitor in the Game window. | |
||||
|
| Exposure | Set the exposure value this graph samples from. | |
||||
|
<a name="vectorscope"></a> |
||||
|
### **Vectorscope** |
||||
|
|
||||
|
The **Vectorscope** monitor measures the overall range of hue and saturation within the Camera’s image in real-time. To display the data, it uses a scatter graph relative to the center of the Vectorscope. |
||||
|
|
||||
|
The Vectorscope measures hue values between yellow, red, magenta, blue, cyan and green. The center of the Vectorscope represents absolute zero saturation and the edges represent the highest level of saturation. To determine the hues in your scene and their saturation, look at the distribution of the Vectorscope’s scatter graph. |
||||
|
|
||||
|
To identify whether there is a color imbalance in the image, look at how close the middle of the Vectorscope graph is to the absolute center. If the Vectorscope graph is off-center, this indicates that there is a color cast (tint) in the image. |
||||
|
|
||||
|
 |
||||
|
|
||||
|
The **Vectorscope** that Unity displays in the Game window. |
||||
|
|
||||
|
| **Property** | **Description** | |
||||
|
|--------------|-----------------| |
||||
|
| Vectorscope | Enable this checkbox to display the **Vectorscope** monitor in the Game window.| |
||||
|
| Exposure |Set the exposure value this graph samples from.| |
||||
@ -0,0 +1,25 @@ |
|||||
|
# Deferred Fog |
||||
|
|
||||
|
The **Deferred Fog** effect simulates the look of fog or mist in outdoor environments. To do this, it overlays a color onto objects depending on how far away they are from the Camera. |
||||
|
|
||||
|
 |
||||
|
|
||||
|
You can also use the Deferred fog effect to hide object clipping. This is useful if you want to bring the Camera’s far clip plane forward to improve performance. |
||||
|
|
||||
|
The **Deferred Fog** effect creates a screen-space fog based on the camera’s [depth texture](https://docs.unity3d.com/Manual/SL-DepthTextures.html). It supports Linear, Exponential and Exponential Squared fog types. **Deferred Fog** settings are on the **Scene** tab of the [**Lighting window**](https://docs.unity3d.com/Manual/lighting-window.html) in **Window > Rendering > Lighting Settings**. |
||||
|
|
||||
|
### Properties |
||||
|
|
||||
|
| Property | Function | |
||||
|
| :-------------- | :--------------------------------- | |
||||
|
| Enabled | Enable this checkbox to turn the **Deferred Fog** effect on.| |
||||
|
| Exclude Skybox | Enable this checkbox to exclude fog from the [skybox](https://docs.unity3d.com/Manual/class-Skybox.html). | |
||||
|
|
||||
|
### Details |
||||
|
|
||||
|
The **Deferred Fog** effect only appears in your [**Post-process Layer**](https://docs.unity3d.com/Packages/com.unity.postprocessing@latest?subfolder=/manual/Quick-start.html#post-process-layer) if the camera is set to render with the [**Deferred rendering path**](https://docs.unity3d.com/Manual/RenderTech-DeferredShading.html). It is enabled by default and adds the support of **Deferred Fog** from the [**Lighting window**](https://docs.unity3d.com/Manual/lighting-window.html), which would otherwise only work with the [**Forward rendering path**](https://docs.unity3d.com/Manual/RenderTech-ForwardRendering.html). |
||||
|
|
||||
|
### Requirements |
||||
|
|
||||
|
- Depth texture |
||||
|
- Shader Model 3 |
||||
@ -0,0 +1,25 @@ |
|||||
|
# Depth of Field |
||||
|
|
||||
|
The **Depth of Field** effect blurs the background of your image while the objects in the foreground stay in focus. This simulates the focal properties of a real-world camera lens. |
||||
|
|
||||
|
 |
||||
|
|
||||
|
A real-world **camera** can focus sharply on an object at a specific distance. Objects nearer or farther from the **camera’s** focal point appear slightly out of focus or blurred. This blurring gives a visual cue about an object’s distance, and introduces “bokeh” which refers to visual artifacts that appear around bright areas of the image as they fall out of focus. |
||||
|
|
||||
|
### Properties |
||||
|
|
||||
|
| Property | Function | |
||||
|
| :-------------- | :------------------------------------------------------------ | |
||||
|
| Focus Distance | Set the distance to the point of focus. | |
||||
|
| Aperture | Set the ratio of the aperture (known as f-stop or f-number). The smaller the value is, the shallower the depth of field is. | |
||||
|
| Focal Length | Set the distance between the lens and the film. The larger the value is, the shallower the depth of field is. | |
||||
|
| Max Blur Size | Select the convolution kernel size of the bokeh filter from the dropdown. This setting determines the maximum radius of bokeh. It also affects the performance. The larger the kernel is, the longer the GPU time is required. | |
||||
|
|
||||
|
### Performance |
||||
|
|
||||
|
The speed of the **Depth of Field** effect is tied to **Max Blur Size**. Only use a value higher than `Medium` if you are developing for desktop computers and, depending on the post-processing budget of your game, consoles. Use the lowest value when developing for mobile platforms. |
||||
|
|
||||
|
### Requirements |
||||
|
|
||||
|
- Depth texture |
||||
|
- Shader Model 3.5 |
||||
@ -0,0 +1,29 @@ |
|||||
|
# Grain |
||||
|
|
||||
|
The **Grain** effect overlays film noise onto your image. Film noise is the effect that real-world cameras produce when small particles in the camera’s film give the image a coarse, unprocessed effect. |
||||
|
Unity’s **Grain** effect is based on a coherent gradient noise. This gives your game a gritty effect that simulates the imperfections of film. |
||||
|
|
||||
|
The **Grain** effect available in Unity is based on a coherent gradient noise. |
||||
|
|
||||
|
 |
||||
|
Scene without the **Grain** effect. |
||||
|
|
||||
|
 |
||||
|
Scene with the **Grain** effect. |
||||
|
|
||||
|
### Properties |
||||
|
|
||||
|
| Property | Function | |
||||
|
| :---------------------- | :------------------------------------------------------------ | |
||||
|
| Colored | Enable the checkbox to use colored grain. | |
||||
|
| Intensity | Set the value of the **Grain** strength. Higher values show more visible grain. | |
||||
|
| Size | Set the value of the **Grain** particle size. | |
||||
|
| Luminance Contribution | Set the value to control the noisiness response curve. This value is based on scene luminance. Lower values mean less noise in dark areas. | |
||||
|
|
||||
|
### Performance |
||||
|
|
||||
|
Disabling **Colored** makes the Grain effect run faster. |
||||
|
|
||||
|
### Requirements |
||||
|
|
||||
|
- Shader Model 3 |
||||
@ -0,0 +1,21 @@ |
|||||
|
# Installation |
||||
|
|
||||
|
Use the [**Package Manager**](https://docs.unity3d.com/Manual/upm-ui.html) to install the **Post Processing** package or to update an installed package to the latest version. |
||||
|
|
||||
|
To install the **Post Processing** package: |
||||
|
|
||||
|
1. Open the Package Manager in **Window > Package Manager**. |
||||
|
2. In the [Filter for scope](https://docs.unity3d.com/Manual/upm-ui-filter.html) menu, select **All packages**. |
||||
|
3. In the list of packages, select **Post Processing**. |
||||
|
4. In the bottom-right corner of the Package Manager window, select **Install**. |
||||
|
|
||||
|
For more information on the Package Manager and installing packages, see the following pages: |
||||
|
* [Unity’s Package Manager](https://docs.unity3d.com/Manual/Packages.html). |
||||
|
* [Adding and removing packages](https://docs.unity3d.com/Manual/upm-ui-actions.html). |
||||
|
|
||||
|
## Source code |
||||
|
|
||||
|
> **Note**: The best way to install a package is directly from the Unity registry using the Package Manager. The latest source code might contain unsupported or breaking changes. |
||||
|
|
||||
|
The source code for the **Post Processing** package is in the following repository: |
||||
|
* [https://github.com/Unity-Technologies/PostProcessing](https://github.com/Unity-Technologies/PostProcessing) |
||||
@ -0,0 +1,28 @@ |
|||||
|
# Lens Distortion |
||||
|
|
||||
|
The **Lens Distortion** effect simulates distortion caused by the shape of a real-world camera lens. You can adjust the intensity of this effect between barrel distortion and pincushion distortion. |
||||
|
|
||||
|
 |
||||
|
Scene without **Lens Distortion**. |
||||
|
|
||||
|
 |
||||
|
Scene with **Lens Distortion**. |
||||
|
|
||||
|
### Properties |
||||
|
|
||||
|
| Property | Function | |
||||
|
| :------------ | :------------------------------------------------------------ | |
||||
|
| Intensity | Set the value for the total distortion amount. | |
||||
|
| X Multiplier | Set the Intensity multiplier on X axis. Set it to 0 to disable distortion on this axis. | |
||||
|
| Y Multiplier | Set the Intensity multiplier on Y axis. Set it to 0 to disable distortion on this axis. | |
||||
|
| Center X | Set the Distortion center point (X axis). | |
||||
|
| Center Y | Set the Distortion center point (Y axis). | |
||||
|
| Scale | Set the value for global screen scaling. | |
||||
|
|
||||
|
### Known issues and limitations |
||||
|
|
||||
|
- Lens distortion doesn't support AR/VR. |
||||
|
|
||||
|
### Requirements |
||||
|
|
||||
|
- Shader Model 3 |
||||
@ -0,0 +1,115 @@ |
|||||
|
# Controlling effects using scripts |
||||
|
|
||||
|
This guide explains how to modify a post-processing script to create time-based events or temporary post-processing effects. |
||||
|
|
||||
|
## Quick Volumes |
||||
|
|
||||
|
Use the `QuickVolume` method to quickly spawn new volumes in the scene, to create time-based events or temporary states: |
||||
|
|
||||
|
```csharp |
||||
|
[ |
||||
|
public PostProcessVolume QuickVolume(int layer, float priority, params PostProcessEffectSettings[] settings) |
||||
|
] |
||||
|
``` |
||||
|
The following example demonstrates how to use a script to create a pulsating vignette effect: |
||||
|
|
||||
|
```csharp |
||||
|
[ |
||||
|
using UnityEngine; |
||||
|
using UnityEngine.Rendering.PostProcessing; |
||||
|
public class VignettePulse : MonoBehaviour |
||||
|
{ |
||||
|
PostProcessVolume m_Volume; |
||||
|
Vignette m_Vignette |
||||
|
void Start() |
||||
|
{ |
||||
|
// Create an instance of a vignette |
||||
|
m_Vignette = ScriptableObject.CreateInstance<Vignette>(); |
||||
|
m_Vignette.enabled.Override(true); |
||||
|
m_Vignette.intensity.Override(1f); |
||||
|
// Use the QuickVolume method to create a volume with a priority of 100, and assign the vignette to this volume |
||||
|
m_Volume = PostProcessManager.instance.QuickVolume(gameObject.layer, 100f, m_Vignette); |
||||
|
void Update() |
||||
|
{ |
||||
|
// Change vignette intensity using a sinus curve |
||||
|
m_Vignette.intensity.value = Mathf.Sin(Time.realtimeSinceStartup); |
||||
|
} |
||||
|
void OnDestroy() |
||||
|
{ |
||||
|
RuntimeUtilities.DestroyVolume(m_Volume, true, true); |
||||
|
} |
||||
|
} |
||||
|
``` |
||||
|
|
||||
|
This code creates a new vignette and assigns it to a newly spawned volume. Then, on every frame, it changes the vignette intensity.To avoid memory leaks, destroy the volume and the attached profile when you don’t need them anymore. |
||||
|
|
||||
|
## Using tweening libraries with effects |
||||
|
|
||||
|
To change the parameters of effect over time or based on a gameplay event, you can manipulate Volume or effect parameters. You can do this in an Update method (as demonstrated in the vignette example above), or you can use a tweening library. |
||||
|
|
||||
|
A tweening library is a code library that provides utility functions for simple, code-based animations called "tweens". A few third-party tweening libraries are available for Unity for free, such as[ DOTween](http://dotween.demigiant.com/),[ iTween](http://www.pixelplacement.com/itween/index.php) or[ LeanTween](https://github.com/dentedpixel/LeanTween). The following example uses DOTween. For more information, see the [DOTween documentation](http://dotween.demigiant.com/documentation.php). |
||||
|
|
||||
|
This example spawns a volume with a vignette. Its weight is initially set to 0. The code uses the [sequencing feature](http://dotween.demigiant.com/documentation.php#creatingSequence) of DOTween to chain a set of tweening events that set the value of the weight parameter: fade in, pause for a second, fade out. After this sequence has completed, the code destroys the Volume and the `Vignette Pulse` component. |
||||
|
|
||||
|
```csharp |
||||
|
using UnityEngine; |
||||
|
using UnityEngine.Rendering.PostProcessing; |
||||
|
using DG.Tweening; |
||||
|
public class VignettePulse : MonoBehaviour |
||||
|
{ |
||||
|
void Start() |
||||
|
{ |
||||
|
var vignette = ScriptableObject.CreateInstance<Vignette>(); |
||||
|
vignette.enabled.Override(true); |
||||
|
vignette.intensity.Override(1f); |
||||
|
var volume = PostProcessManager.instance.QuickVolume(gameObject.layer, 100f, vignette); |
||||
|
volume.weight = 0f; |
||||
|
DOTween.Sequence() |
||||
|
.Append(DOTween.To(() => volume.weight, x => volume.weight = x, 1f, 1f)) |
||||
|
.AppendInterval(1f) |
||||
|
.Append(DOTween.To(() => volume.weight, x => volume.weight = x, 0f, 1f)) |
||||
|
.OnComplete(() => |
||||
|
{ |
||||
|
RuntimeUtilities.DestroyVolume(volume, true, true); |
||||
|
Destroy(this); |
||||
|
}); |
||||
|
} |
||||
|
} |
||||
|
``` |
||||
|
|
||||
|
## Profile Editing |
||||
|
|
||||
|
The above examples demonstrate how to create new effects and Volumes at runtime, but you can also manually edit an existing Profile that is used by one or more Volumes. To do this, you can use one of two fields on the `PostProcessVolume` . Each field has a slightly different effects: |
||||
|
|
||||
|
- Modify the shared profile directly: |
||||
|
- Class field name: [`sharedProfile`](...api/UnityEngine.Rendering.PostProcessing.PostProcessVolume.html#UnityEngine_Rendering_PostProcessing_PostProcessVolume_sharedProfile.html) |
||||
|
- Applies changes to all volumes using the same profile |
||||
|
- Modifies the asset and doesn’t reset when you exit play mode |
||||
|
- Request a clone of the shared Profile that will only be used for this Volume: |
||||
|
- Class field name: [`profile`](...api/UnityEngine.Rendering.PostProcessing.PostProcessVolume.html#UnityEngine_Rendering_PostProcessing_PostProcessVolume_profile.html) |
||||
|
- Applies changes to the specified volume |
||||
|
- Resets when you exit play mode |
||||
|
- You must manually destroy the profile when you don't need it anymore |
||||
|
|
||||
|
The `PostProcessProfile` class contains the following utility methods to help you manage assigned effects: |
||||
|
| Utility method | **Description** | |
||||
|
| ------------------------------------------------------------ | ------------------------------------------------------------ | |
||||
|
| [`T AddSettings()`](...api/UnityEngine.Rendering.PostProcessing.PostProcessProfile.html#UnityEngine_Rendering_PostProcessing_PostProcessProfile_AddSettings__1) | Creates, adds and returns a new effect of type `T` to the profile. It throws an exception if it already exist | |
||||
|
| [`PostProcessEffectSettings AddSettings(PostProcessEffectSettings effect)`](api/UnityEngine.Rendering.PostProcessing.PostProcessProfile.html#UnityEngine_Rendering_PostProcessing_PostProcessProfile_AddSettings_UnityEngine_Rendering_PostProcessing_PostProcessEffectSettings_) | Adds and returns an effect that you created to the profile. | |
||||
|
| [`void RemoveSettings()`](api/UnityEngine.Rendering.PostProcessing.PostProcessProfile.html#UnityEngine_Rendering_PostProcessing_PostProcessProfile_RemoveSettings__1) | Removes an effect from the profile. It throws an exception if it doesn't exist. | |
||||
|
| [`bool TryGetSettings(out T outSetting)`](...api/UnityEngine.Rendering.PostProcessing.PostProcessProfile.html#UnityEngine_Rendering_PostProcessing_PostProcessProfile_TryGetSettings__1___0__) | Gets an effect from the profile, returns `true` if it found a profile, or `false` if it did not find a profile. | |
||||
|
|
||||
|
You can find more methods in the `/PostProcessing/Runtime/PostProcessProfile.cs` source file. |
||||
|
|
||||
|
**Important:** You must destroy any manually created profiles or effects. |
||||
|
|
||||
|
## Additional notes |
||||
|
|
||||
|
If you need to instantiate `PostProcessLayer` at runtime, you must bind your resources to it. To do this, add your component and call `Init()` on your `PostProcessLayer` with a reference to the `PostProcessResources` file as a parameter. |
||||
|
|
||||
|
Here is an example: |
||||
|
|
||||
|
```csharp |
||||
|
var postProcessLayer = gameObject.AddComponent<PostProcessLayer>(); |
||||
|
postProcessLayer.Init(resources); |
||||
|
``` |
||||
@ -0,0 +1,27 @@ |
|||||
|
# Motion Blur |
||||
|
|
||||
|
The **Motion Blur** effect blurs the image in the direction of the **Camera’s** movement. This simulates the blur effect a real-world camera creates when it moves with the lens aperture open, or when it captures an object moving faster than the camera’s exposure time. |
||||
|
|
||||
|
 |
||||
|
|
||||
|
### Properties |
||||
|
|
||||
|
| Property | Function | |
||||
|
| :------------- | :------------------------------------------------------------ | |
||||
|
| Shutter Angle | Set the angle of the rotary shutter. Larger values give longer exposure and a stronger blur effect. | |
||||
|
| Sample Count | Set the value for the amount of sample points. This affects quality and performance. | |
||||
|
|
||||
|
### Performance |
||||
|
|
||||
|
Using a lower `Sample Count` will improve performance. |
||||
|
|
||||
|
### Known issues and limitations |
||||
|
|
||||
|
- Motion blur doesn't support AR/VR. |
||||
|
- Versions 7.0 to 7.5 of [Universal Render Pipeline (URP)](https://docs.unity3d.com/Packages/com.unity.render-pipelines.universal@7.5/manual/index.html) do not support this version of the Motion Blur effect. Instead, use [Motion Blur for URP](https://docs.unity3d.com/Packages/com.unity.render-pipelines.universal@latest?/manual/Post-Processing-Motion-Blur.html). |
||||
|
|
||||
|
### Requirements |
||||
|
|
||||
|
- Motion vectors |
||||
|
- Depth texture |
||||
|
- Shader Model 3 |
||||
@ -0,0 +1,100 @@ |
|||||
|
# Getting started with post-processing |
||||
|
|
||||
|
This page explains how to set up the components required to create post-processing effects in your scene. |
||||
|
|
||||
|
<a name="post-process-layer"></a> |
||||
|
|
||||
|
## Post-process Layer |
||||
|
|
||||
|
To enable post-processing in your scene, add the **Rendering** > **Post Process Layer** component to the Main Camera GameObject. This component allows you to configure anti-aliasing for this post-process layer, choose which layer it will apply the post-processing to, and select the GameObject that triggers this post-process layer. |
||||
|
|
||||
|
|
||||
|
 |
||||
|
|
||||
|
|
||||
|
### Volume blending |
||||
|
|
||||
|
You can use a Volume framework to manage and blend between post-processing effects in Unity. Each Volume can either be global or have local boundaries. They each contain scene setting property values that Unity blends between, depending on the position of the Camera, in order to calculate a final value. |
||||
|
|
||||
|
Volumes can contain different combinations of Volume overrides that you can blend between. For example, one Volume can hold a Physically Based Sky Volume override, while another Volume holds an Exponential Fog Volume override. |
||||
|
|
||||
|
You can use local Volumes to change environment settings, such as fog color and density, to alter the mood of different areas of your Scene. |
||||
|
|
||||
|
**Volume blending** assigns a trigger for a **Post-processing Layer** and controls which layer affects the Camera. |
||||
|
|
||||
|
| Property | Description | |
||||
|
| -------- | ------------------------------------------------------------ | |
||||
|
| Trigger | This transform controls the volume blending feature. Unity assigns the Camera to the **Trigger** by default. <br><br>You can use other GameObjects to control the blending feature. For example, in a top-down game you might want to assign the player character GameObject to drive the blending instead of the Camera Transform.<br> <br>When this field is set to None, it disables local volumes for this layer (global ones work normally). | |
||||
|
| Layer | A mask of layers that Unity considers for volume blending. It allows you to control which layers affect the camera (volume filtering). <br> <br>**Layer** also optimizes volume traversal, the update process of the volume system that blends parameters.<br> <br>**Layer** is set to Nothing by default. It must have a layer assigned, otherwise volumes won’t take effect in your scene.<br><br>For best performance, keep your volumes in dedicated layers instead of the default one. For more information, see[ Layers](https://docs.unity3d.com/Manual/Layers.html). | |
||||
|
|
||||
|
### Anti-aliasing |
||||
|
|
||||
|
[**Anti-aliasing**](Anti-aliasing.html) reduces the appearance of jagged edges in your scene.. |
||||
|
|
||||
|
The Post-process Layer component allows you to set up the anti-aliasing effect per-camera. You can use this to optimize the anti-aliasing in your scene. For example, you can enable [**Temporal Anti-aliasing (TAA)**](Anti-aliasing#temporal-anti-aliasing.html) on your Main Camera, and a less resource-intensive form of anti-aliasing like [**Fast approximate anti-aliasing** **(FXAA)**](Anti-aliasing#fast-approximate-anti-aliasing.html) on another camera. |
||||
|
|
||||
|
You can use this setting to optimize your cameras to only use anti-aliasing when needed. |
||||
|
|
||||
|
| Property | Description | |
||||
|
| ------------------------- | ------------------------------------------------------------ | |
||||
|
| Mode | Select the type of anti-aliasing this component uses. | |
||||
|
| Stop NaN propagation | Destroys any pixels with positive or negative infinite values and pixels without any numeric data, known as Not a Number (NaN) pixels. It then replaces each pixel with a black color before Unity applies any post-processing effects. This avoids the presence of post-processing artifacts caused by broken data in the scene. <br> <br>**Stop NaN propagation** can have a performance impact on some platforms. You should only enable it if you see post-processing artifacts as this setting does impact performance. | |
||||
|
| Directly to Camera Target | Builds the anti-aliasing result directly to the Camera’s target. This can help with performance. You might find this useful if you are targeting low-end hardware and post-processing is causing performance issues at runtime.<br> <br> **Directly to Camera Target** is not compatible with older post-processing effects that use the `OnRenderImage` API. | |
||||
|
|
||||
|
### Toolkit |
||||
|
The Toolkit section comes with a few utilities. |
||||
|
| Property | Description | |
||||
|
| ------------------------------- | ------------------------------------------------------------ | |
||||
|
| Export the current frame to EXR | Supports the following modes:<br>- **Full Frame (as displayed):** Exports the current frame of the Camera’s view. For example, if it is set to the Camera shown in the Game View, the export looks exactly like what is shown in the Game View.<br>- **Disable post-processing:** Exports the current frame of the Camera’s view, without any post-processing applied.<br>- **Break before Color Grading (linear):** Exports the current frame of the Camera’s view, but stops rendering just before **Color Grading** is applied. This is useful if you want to author grading LUTs in an external software.<br>- **Break before Color Grading (log):** Exports the current frame of the Camera’s view and log-encodes the output. This is useful if you want to author full-precision HDR grading LUTs in an external software. | |
||||
|
| Select all layer volumes | Selects all **Post-process Volume** components that can affect this **Post-process Layer**. | |
||||
|
| Select all active volumes | Selects all **Post-process Volume** components currently affecting this **Post-process Layer**. | |
||||
|
### Custom Effect Sorting |
||||
|
|
||||
|
**Custom Effect Sorting** allows you to change the rendering order of custom effects. Custom effects in your scene appear here in a reorderable list from first to last. You can drag and drop each setting to change their order. |
||||
|
|
||||
|
For more information on custom effects, see [Writing Custom Effects](https://docs.unity3d.com/Packages/com.unity.postprocessing@latest?subfolder=/manual/Writing-Custom-Effects.html). |
||||
|
|
||||
|
<a name="post-process-volume"></a> |
||||
|
|
||||
|
## Post Process Volume |
||||
|
|
||||
|
The **Post-process Volume** component allows you to control the priority and blending of each local and global volume. You can also create a set of effect overrides to automatically blend post-processing settings in your scene. |
||||
|
|
||||
|
For example, if you have a global light vignette effect, you could control the **Intensity** setting of the vignette when the player enters a cave to make it darker, while the other post-processing settings are unchanged. |
||||
|
|
||||
|
You can add the Post Process Volume component to any GameObject, including the Main Camera GameObject. However, the optimal way to use this component is to create a dedicated GameObject for each volume. To do this: |
||||
|
|
||||
|
- Create an empty GameObject. |
||||
|
- Add the Post-process Volume component to your new GameObject in the Inspector. To do this, select **Add** **Component > Post-process Volume.** |
||||
|
- View your Main Camera’s Inspector, and in the Post-process Layer component, set **Layer** to the new GameObject you have just created. |
||||
|
|
||||
|
|
||||
|
 |
||||
|
|
||||
|
The **Post Process Volume** component is empty by default. Each post-process volume has two modes: |
||||
|
|
||||
|
- **Global:** A global volume has no boundaries and Unity applies it to the whole scene. You can have several of these in your scene. |
||||
|
- **Local:** A local volume needs a collider or trigger component attached to it to define its boundaries. Any type of 3D collider is suitable, but complex meshes can be more resource-intensive. Local volumes have a **Blend Distance** property, which represents the outer distance from the volume surface where blending starts. |
||||
|
|
||||
|
| **Property** | **Description** | |
||||
|
| -------------- | ------------------------------------------------------------ | |
||||
|
| Is Global | Defines this volume as a Global volume. | |
||||
|
| Blend Distance | The outer distance from the volume surface where blending starts.<br>This property only appears when **Is Global** is disabled. | |
||||
|
| Weight | Reduces the global contribution of the volume and all its overrides.0 indicates no contribution and 1 indicates full contribution. | |
||||
|
| Priority | Defines this volume’s order in the stack. The higher this number is, the higher this volume is placed in the stack. This means that Unity runs this volume before volumes in the stack that have a lower **Priority** number. | |
||||
|
| Profile | Defines the profile for this volume. You can create a new profile using **New** or clone an existing profile.<br/>When you assign a profile to this field, the **Clone** button appears. You can use this to duplicate the assigned profile and assign it to this volume. | |
||||
|
|
||||
|
## Adding post-processing effects to the stack |
||||
|
Once you have assigned a post-processing profile to the [Post Process Volume](#post-process-volume) component, you can add post-processing effects to the stack. To do this, click the **Add effect** button at the bottom of the component, and choose the post-processing effect you want to use from the drop-down list. The Post Process Volume component displays all applied post-processing effects, and their properties, in a list at the bottom of the component’s Inspector. |
||||
|
|
||||
|
The Post Process Volume component displays the following settings for each post-processing effect in the list: |
||||
|
|
||||
|
 |
||||
|
|
||||
|
A. Effect overrides toggle (checkbox): This checkbox toggles all overrides for this effect in this particular volume, but preserves your override selections when you disable and re-enable it. |
||||
|
|
||||
|
B. Effect name: Right-click an effect name to show a quick-action menu to copy, paste, remove, or reset settings. |
||||
|
|
||||
|
C. Effect toggle: Select the **On** or **Off** buttons to toggle an effect within this volume. This is useful if you want to manually disable an effect in this volume that is enabled globally or in a higher priority volume. |
||||
|
|
||||
|
D. Property override toggle (checkbox): Enable this override checkbox to edit an individual setting. You can also quickly toggle all property overrides on or off with the small **All** and **None** shortcuts below the effect title. |
||||
@ -0,0 +1,35 @@ |
|||||
|
# Screen Space Reflections |
||||
|
|
||||
|
The **Screen Space Reflection** effect creates subtle reflections that simulate wet floor surfaces or puddles. It reflects both static and dynamic GameObjects to create realistic reflections. |
||||
|
|
||||
|
Screen Space Reflection replaces specular highlights on a surface, which makes it an ideal effect to limit the amount of [specular light](https://docs.unity3d.com/Manual/shader-NormalSpecular.html) leaking. |
||||
|
|
||||
|
 |
||||
|
|
||||
|
### Properties |
||||
|
|
||||
|
| Property | Function | |
||||
|
| :----------------------- | :------------------------------------------------------------ | |
||||
|
| Preset | Select the quality preset from the dropdown. Use **Custom** to fine tune the quality. | |
||||
|
| Maximum Iteration Count (`Custom` preset only) | Set the maximum number of steps in the raymarching pass. A higher value creates more reflections. | |
||||
|
| Thickness (`Custom` preset only)| Set the value of the ray thickness. A lower value detects smaller details but it is resource-intensive. | |
||||
|
| Resolution (`Custom` preset only)| Select the size of the internal buffer. Select **Downsample** to maximize performance. **Supersample** is slower but produces higher quality results. | |
||||
|
| Maximum March Distance | Set the maximum distance to draw reflections in the scene. | |
||||
|
| Distance Fade | Set the value for the distance to fade reflections close to the near plane. This is useful to hide common artifacts. | |
||||
|
| Vignette | Set the value to fade the reflections close to the screen edges. | |
||||
|
|
||||
|
### Performance |
||||
|
|
||||
|
The `Custom` preset is very resource-intensive and best for beauty shots. If you are developing for consoles, use **Medium** as the maximum, unless you have plenty of GPU time to spare. On lower resolutions you can boost the quality preset and get similar timings with a higher visual quality. |
||||
|
|
||||
|
### Known issues and limitations |
||||
|
|
||||
|
- Screen-space reflections doesn't support AR/VR. |
||||
|
- [Universal Render Pipeline (URP)](https://docs.unity3d.com/Packages/com.unity.render-pipelines.universal@7.5/manual/index.html) do not support Screen Space Reflections. |
||||
|
|
||||
|
### Requirements |
||||
|
|
||||
|
- Compute shader |
||||
|
- Motion vectors |
||||
|
- Deferred rendering path |
||||
|
- Shader Model 5.0 |
||||
@ -0,0 +1,23 @@ |
|||||
|
* [Post-Processing Stack v2](index) |
||||
|
* [Requirements](requirements) |
||||
|
* [Installation](Installation) |
||||
|
* [Getting started](Quick-Start) |
||||
|
* Effects |
||||
|
* [Ambient Occlusion](Ambient-Occlusion) |
||||
|
* [Anti-aliasing](Anti-aliasing) |
||||
|
* [Auto Exposure](Auto-Exposure) |
||||
|
* [Bloom](Bloom) |
||||
|
* [Chromatic Aberration](Chromatic-Aberration) |
||||
|
* [Color Grading](Color-Grading) |
||||
|
* [Deferred Fog](Deferred-Fog) |
||||
|
* [Depth of Field](Depth-of-Field) |
||||
|
* [Grain](Grain) |
||||
|
* [Lens Distortion](Lens-Distortion) |
||||
|
* [Motion Blur](Motion-Blur) |
||||
|
* [Screen Space Reflections](Screen-Space-Reflections) |
||||
|
* [Vignette](Vignette) |
||||
|
* Scripting |
||||
|
* [Controlling effects using scripts](Manipulating-the-Stack) |
||||
|
* [Writing custom effects](Writing-Custom-Effects) |
||||
|
* [Known issues](known-issues) |
||||
|
* [Debugging Post-processing effects](Debugging-Post-processing-effects) |
||||
@ -0,0 +1,49 @@ |
|||||
|
# Vignette |
||||
|
|
||||
|
The **Vignette** effect darkens the edges of an image. This simulates the effect in a real-world camera lens caused by thick or stacked filters, secondary lenses, or an improper lens hood. You can use the **Vignette** effect to draw attention to the center of an image. |
||||
|
|
||||
|
 |
||||
|
Scene without **Vignette** effect. |
||||
|
|
||||
|
 |
||||
|
Scene with **Vignette** effect. |
||||
|
|
||||
|
The Vignette effect in the post-processing stack has two modes: |
||||
|
|
||||
|
- [Classic](#classic) |
||||
|
- [Masked](#masked) |
||||
|
|
||||
|
<a name="classic"></a> |
||||
|
## Classic |
||||
|
|
||||
|
**Classic** mode has parametric controls for the position, shape and intensity of the Vignette. This is the most common way to use the effect. |
||||
|
|
||||
|
### Properties |
||||
|
|
||||
|
| Property | Function | |
||||
|
| :-------------- | :------------------------------------------------------------ | |
||||
|
| Mode | Select the type of **Vignette** to use. | |
||||
|
| Color | Set the color of the Vignette. | |
||||
|
| Center | Set the Vignette center point (screen center is [0.5,0.5]). | |
||||
|
| Intensity | Set the amount of vignetting on screen. | |
||||
|
| Smoothness | Set the smoothness of the Vignette borders. | |
||||
|
| Roundness | Set the value to round the Vignette. Lower values will make a more squared vignette. | |
||||
|
| Rounded | Enable this checkbox to make the vignette perfectly round. When disable, the Vignette effect is dependent on the current aspect ratio. | |
||||
|
|
||||
|
<a name="masked"></a> |
||||
|
## Masked |
||||
|
|
||||
|
**Masked** mode uses a custom texture mask and multiplies it over the scene to create a Vignette effect. This mode can be used to create less common or irregular vignetting effects. |
||||
|
|
||||
|
### Properties |
||||
|
|
||||
|
| Property | Function | |
||||
|
| :------------- | :------------------------------------------------------- | |
||||
|
| Mode | Select the type of **Vignette** to use. | |
||||
|
| Color | Set the color of the Vignette. Use the alpha channel for transparency. | |
||||
|
| Mask | Select a black and white mask to use as a vignette. | |
||||
|
| Opacity | Set the mask opacity value. | |
||||
|
|
||||
|
### Requirements |
||||
|
|
||||
|
- Shader Model 3 |
||||
@ -0,0 +1,240 @@ |
|||||
|
# Writing custom effects |
||||
|
|
||||
|
This quick-start guide demonstrates how to write a custom [post-processing effect](https://docs.unity3d.com/Manual/PostProcessingOverview.html) and include it in the post-processing stack. This process does not require you to modify the codebase. |
||||
|
|
||||
|
Custom post-processing effects require a minimum of two files: |
||||
|
|
||||
|
- A C# source file |
||||
|
- An [HLSL](https://en.wikipedia.org/wiki/High-Level_Shading_Language) source file |
||||
|
|
||||
|
Unity cross-compiles HLSL to [GLSL](https://docs.unity3d.com/Manual/SL-GLSLShaderPrograms.html), [Metal](https://docs.unity3d.com/Manual/Metal.html), and other APIs. This means it is not restricted to DirectX. |
||||
|
|
||||
|
This quick-start guide requires a basic knowledge of programming C# in Unity and HLSL shader programming. |
||||
|
|
||||
|
## C# source code |
||||
|
|
||||
|
The following example demonstrates how to use a C# script to create a custom grayscale post-processing effect. The script in this example calls APIs from the Post Processing framework and works with volume blending. This example is compatible with versions of Unity from 2018 onwards. It is not compatible with [HDRP](https://docs.unity3d.com/Packages/com.unity.render-pipelines.high-definition@latest?subfolder=/manual/): |
||||
|
|
||||
|
```csharp |
||||
|
using System; |
||||
|
using UnityEngine; |
||||
|
using UnityEngine.Rendering.PostProcessing; |
||||
|
|
||||
|
[Serializable] |
||||
|
[PostProcess(typeof(GrayscaleRenderer), PostProcessEvent.AfterStack, "Custom/Grayscale")] |
||||
|
public sealed class Grayscale : PostProcessEffectSettings |
||||
|
{ |
||||
|
[Range(0f, 1f), Tooltip("Grayscale effect intensity.")] |
||||
|
public FloatParameter blend = new FloatParameter { value = 0.5f }; |
||||
|
} |
||||
|
public sealed class GrayscaleRenderer : PostProcessEffectRenderer<Grayscale> |
||||
|
{ |
||||
|
public override void Render(PostProcessRenderContext context) |
||||
|
{ |
||||
|
var sheet = context.propertySheets.Get(Shader.Find("Hidden/Custom/Grayscale")); |
||||
|
sheet.properties.SetFloat("_Blend", settings.blend); |
||||
|
context.command.BlitFullscreenTriangle(context.source, context.destination, sheet, 0); |
||||
|
} |
||||
|
} |
||||
|
``` |
||||
|
|
||||
|
> **Important**: This file name of this script must match the name of its class for it to serialize correctly. In this case, the script must be stored in a file named `Grayscale.cs`. |
||||
|
|
||||
|
### Classes |
||||
|
|
||||
|
A custom post-processing effect script requires two classes: |
||||
|
|
||||
|
- a data class to store settings |
||||
|
- a logic class to render the effect |
||||
|
|
||||
|
### Data class |
||||
|
|
||||
|
The data class holds all the settings fields the user sees in the Inspector window for that volume profile. Here is how the data class works in the example script described in C# source code: |
||||
|
|
||||
|
```csharp |
||||
|
//The Serializable attribute allows Unity to serialize this class and extend PostProcessEffectSettings. |
||||
|
[Serializable] |
||||
|
// The [PostProcess()] attribute tells Unity that this class holds post-processing data. The first parameter links the settings to a renderer. The second parameter creates the injection point for the effect. The third parameter is the menu entry for the effect. You can use a forward slash (/) to create sub-menu categories. |
||||
|
[PostProcess(typeof(GrayscaleRenderer), PostProcessEvent.AfterStack, "Custom/Grayscale")] |
||||
|
public sealed class Grayscale : PostProcessEffectSettings |
||||
|
{ |
||||
|
// You can create boxed fields to override or blend parameters. This example uses a FloatParameter with a fixed range from 0 to 1. |
||||
|
[Range(0f, 1f), Tooltip("Grayscale effect intensity.")] |
||||
|
public FloatParameter blend = new FloatParameter { value = 0.5f }; |
||||
|
} |
||||
|
``` |
||||
|
|
||||
|
#### Notes: |
||||
|
|
||||
|
The second parameter of the `[PostProcess()]` attribute is the injection point for the effect. There are three injection points available: |
||||
|
|
||||
|
- `BeforeTransparent`: Unity only applies the effect to opaque objects before Unity runs the transparent pass. |
||||
|
- `BeforeStack`: Unity injects the effect before applying the built-in stack. This applies to all post processing effects except [Temporal anti-aliasing (TAA),](https://docs.unity3d.com/Packages/com.unity.postprocessing@latest?subfolder=/manual/Anti-aliasing.html) which Unity applies before any injection points. |
||||
|
- `AfterStack`: Unity applies the effect after the built-in stack and before [FXAA](https://docs.unity3d.com/Packages/com.unity.postprocessing@latest?subfolder=/manual/Anti-aliasing#fast-approximate-anti-aliasing.html) (if it's enabled) and final-pass dithering. |
||||
|
|
||||
|
The `[PostProcess()]` attribute has an optional fourth parameter called `allowInSceneView`. You can use this parameter to enable or disable the effect in the scene. It's set to true by default, but you can disable it for temporal effects or effects that get in the way of editing the scene easily. |
||||
|
|
||||
|
For a full list of built-in parameter classes, see the `ParameterOverride.cs` source file in **/PostProcessing/Runtime/**. |
||||
|
|
||||
|
If you want to set your own requirements for the effect or disable it until a condition is met, you can override the `IsEnabledAndSupported()` method of `PostProcessEffectSettings`. For example, the following script automatically disables an effect if the blend parameter is `0`: |
||||
|
|
||||
|
```csharp |
||||
|
public override bool IsEnabledAndSupported(PostProcessRenderContext context) |
||||
|
{ |
||||
|
return enabled.value |
||||
|
&& blend.value > 0f; |
||||
|
} |
||||
|
``` |
||||
|
|
||||
|
### Logic class |
||||
|
|
||||
|
The logic class tells Unity how to render this post-processing effect. Here is how the logic class works in the example script described in C# source code: |
||||
|
|
||||
|
```csharp |
||||
|
// This renderer extends PostProcessEffectRenderer<T>, where T is the settings type Unity attaches to this renderer. |
||||
|
public sealed class GrayscaleRenderer : PostProcessEffectRenderer<Grayscale> |
||||
|
{ |
||||
|
// Everything that happens in the Render() method takes a PostProcessRenderContext as parameter. |
||||
|
public override void Render(PostProcessRenderContext context) |
||||
|
{ |
||||
|
// Request a PropertySheet for our shader and set the uniform within it. |
||||
|
var sheet = context.propertySheets.Get(Shader.Find("Hidden/Custom/Grayscale")); |
||||
|
// Send the blend parameter value to the shader. |
||||
|
sheet.properties.SetFloat("_Blend", settings.blend); |
||||
|
// This context provides a command buffer which you can use to blit a fullscreen pass using a source image as an input with a destination for the shader, sheet and pass number. |
||||
|
context.command.BlitFullscreenTriangle(context.source, context.destination, sheet, 0); |
||||
|
} |
||||
|
} |
||||
|
``` |
||||
|
|
||||
|
#### Notes: |
||||
|
|
||||
|
The `PostProcessRenderContext` context holds data that Unity passes around effects when it renders them. You can find out what data is available in **/PostProcessing/Runtime/PostProcessRenderContext.cs**. |
||||
|
|
||||
|
The example grayscale effect script only uses [command buffers](https://docs.unity3d.com/ScriptReference/Rendering.CommandBuffer.html) which means the system relies on `MaterialPropertyBlock` to store shader data. Unity’s framework automatically pools the shader data to save time and optimize performance. This script requests a `PropertySheet` for the shader and sets the uniform inside it, so that you do not need to create `MaterialPropertyBlock` manually. |
||||
|
|
||||
|
`PostProcessEffectRenderer<T>` has the following methods you can override: |
||||
|
|
||||
|
| Method | Description | |
||||
|
| ----------------------------------------- | ------------------------------------------------------------ | |
||||
|
| `void Init()` | This method is called when the renderer is created | |
||||
|
| `DepthTextureMode GetLegacyCameraFlags()` | This method sets Camera flags and requests depth maps, motion vectors, etc. | |
||||
|
| `void ResetHistory()` | This method is called when a "reset history" event is dispatched. Use this to clear history buffers for temporal effects. | |
||||
|
| `void Release()` | This method is called when the renderer is destroyed. You can perform a cleanup here | |
||||
|
|
||||
|
## HLSL source code |
||||
|
|
||||
|
Unity uses the HLSL programming language for shader programs. For more information, see [Shading language used in Unity](https://docs.unity3d.com/Manual/SL-ShadingLanguage.html). |
||||
|
|
||||
|
The following example demonstrates how to create an HLSL script for a custom grayscale post-processing effect: |
||||
|
|
||||
|
```hlsl |
||||
|
Shader "Hidden/Custom/Grayscale" |
||||
|
{ |
||||
|
HLSLINCLUDE |
||||
|
// StdLib.hlsl holds pre-configured vertex shaders (VertDefault), varying structs (VaryingsDefault), and most of the data you need to write common effects. |
||||
|
#include "Packages/com.unity.postprocessing/PostProcessing/Shaders/StdLib.hlsl" |
||||
|
TEXTURE2D_SAMPLER2D(_MainTex, sampler_MainTex); |
||||
|
// Lerp the pixel color with the luminance using the _Blend uniform. |
||||
|
float _Blend; |
||||
|
float4 Frag(VaryingsDefault i) : SV_Target |
||||
|
{ |
||||
|
float4 color = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, i.texcoord); |
||||
|
// Compute the luminance for the current pixel |
||||
|
float luminance = dot(color.rgb, float3(0.2126729, 0.7151522, 0.0721750)); |
||||
|
color.rgb = lerp(color.rgb, luminance.xxx, _Blend.xxx); |
||||
|
// Return the result |
||||
|
return color; |
||||
|
} |
||||
|
ENDHLSL |
||||
|
SubShader |
||||
|
{ |
||||
|
Cull Off ZWrite Off ZTest Always |
||||
|
Pass |
||||
|
{ |
||||
|
HLSLPROGRAM |
||||
|
#pragma vertex VertDefault |
||||
|
#pragma fragment Frag |
||||
|
ENDHLSL |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
``` |
||||
|
|
||||
|
#### Notes: |
||||
|
|
||||
|
This framework uses [shader preprocessor macros](https://docs.unity3d.com/Manual/SL-BuiltinMacros.html) to define platform differences. This helps to maintain compatibility across platforms and render pipelines. |
||||
|
|
||||
|
This script also uses macros to declare textures. For a list of available macros, see the API files in **/PostProcessing/Shaders/API/**. |
||||
|
|
||||
|
This script uses HLSL blocks instead of CG blocks to avoid compatibility issues between render pipelines. Inside the HLSL block is the varying structs parameter, `VaryingsDefault i`. This parameter can use the following variables: |
||||
|
```hlsl |
||||
|
struct VaryingsDefault |
||||
|
{ |
||||
|
float4 vertex : SV_POSITION; |
||||
|
float2 texcoord : TEXCOORD0; |
||||
|
float2 texcoordStereo : TEXCOORD1; |
||||
|
#if STEREO_INSTANCING_ENABLED |
||||
|
uint stereoTargetEyeIndex : SV_RenderTargetArrayIndex; |
||||
|
#endif |
||||
|
}; |
||||
|
``` |
||||
|
|
||||
|
- `vertex`: The vertex position. |
||||
|
- `texcoord`: The UV coordinate for the fragment. |
||||
|
- `texcoordStereo`: The UV coordinate for the fragment in stereo mode |
||||
|
- `stereoTargetEyeIndex`: The current eye index (only available with VR + stereo instancing). |
||||
|
|
||||
|
Unity cannot build a shader if it is not referenced in a scene. This means the effect does not work when the application is running outside of the Editor. To fix this, add your shader to a[ Resources folder](https://docs.unity3d.com/Manual/LoadingResourcesatRuntime.html) or include it in the [**Always Included Shaders**](https://docs.unity3d.com/Manual/class-GraphicsSettings.html#Always) list in **Edit > Project Settings > Graphics**. |
||||
|
|
||||
|
## Ordering post-processing effects |
||||
|
|
||||
|
Unity automatically sorts built-in effects, but it handles custom effects differently. When you create a new effect or import it into your project, Unity does the following: |
||||
|
|
||||
|
- Adds the custom effect to the Custom Effect Sorting list in the Post Process Layer component on a Camera. |
||||
|
- Sorts each custom effect by its injection point. You can change the order of the custom effects in the [Post Process Layer](#Quick-start) component using **Custom Effect Sorting**. |
||||
|
|
||||
|
Unity orders custom effects within each layer, which means you can order your custom effects differently for each Camera. |
||||
|
|
||||
|
## Creating a custom editor |
||||
|
|
||||
|
Unity automatically creates editors for settings classes. If you want to control how Unity displays certain fields, you can create a custom editor. |
||||
|
|
||||
|
The following example uses the default editor script to create a custom editor for a `Grayscale` effect: |
||||
|
|
||||
|
```csharp |
||||
|
using UnityEngine.Rendering.PostProcessing; |
||||
|
using UnityEditor.Rendering.PostProcessing; |
||||
|
|
||||
|
[PostProcessEditor(typeof(Grayscale))] |
||||
|
public sealed class GrayscaleEditor : PostProcessEffectEditor<Grayscale> |
||||
|
{ |
||||
|
SerializedParameterOverride m_Blend; |
||||
|
|
||||
|
public override void OnEnable() |
||||
|
{ |
||||
|
m_Blend = FindParameterOverride(x => x.blend); |
||||
|
} |
||||
|
|
||||
|
public override void OnInspectorGUI() |
||||
|
{ |
||||
|
PropertyField(m_Blend); |
||||
|
} |
||||
|
} |
||||
|
``` |
||||
|
|
||||
|
#### Notes: |
||||
|
|
||||
|
For Unity to recognise your custom editor, it has to be in an Editor folder. |
||||
|
|
||||
|
## FXAA compatibility with custom effects |
||||
|
|
||||
|
If you apply [**FXAA**](Anti-aliasing#fast-approximate-anti-aliasing.html) in a scene with custom effects, the order of your post-processing effects might stop it from working correctly. This is because FXAA looks for the LDR (Low dynamic range) luminance value of each pixel in the alpha channel of its source target to optimise performance. |
||||
|
|
||||
|
If you inject custom effects at the `AfterStack` injection point, as demonstrated in the example above, FXAA looks for LDR luminance in the last executed effect. If it can’t find it, FXAA won’t work correctly. |
||||
|
|
||||
|
You can fix this in your custom shader in one of two ways: |
||||
|
|
||||
|
- Make sure that the last executed effect contains LDR luminance in the alpha channel. |
||||
|
- Copy the alpha from the incoming source. |
||||
|
After Width: 563 | Height: 315 | Size: 374 KiB |
|
After Width: 562 | Height: 315 | Size: 195 KiB |
|
After Width: 680 | Height: 380 | Size: 91 KiB |
|
After Width: 563 | Height: 316 | Size: 149 KiB |
|
After Width: 563 | Height: 316 | Size: 110 KiB |
|
After Width: 564 | Height: 316 | Size: 185 KiB |
|
After Width: 562 | Height: 314 | Size: 189 KiB |
|
After Width: 512 | Height: 256 | Size: 3.1 KiB |
|
After Width: 254 | Height: 255 | Size: 22 KiB |
|
After Width: 513 | Height: 256 | Size: 3.9 KiB |
|
After Width: 512 | Height: 256 | Size: 3.1 KiB |
|
After Width: 254 | Height: 255 | Size: 22 KiB |
|
After Width: 445 | Height: 255 | Size: 153 KiB |
|
After Width: 2282 | Height: 1311 | Size: 3.5 MiB |
|
After Width: 445 | Height: 255 | Size: 153 KiB |
|
After Width: 733 | Height: 274 | Size: 23 KiB |
|
After Width: 733 | Height: 290 | Size: 21 KiB |
|
After Width: 650 | Height: 74 | Size: 6.0 KiB |
|
After Width: 650 | Height: 58 | Size: 5.7 KiB |
|
After Width: 650 | Height: 111 | Size: 10 KiB |
|
After Width: 663 | Height: 449 | Size: 478 KiB |
|
After Width: 663 | Height: 449 | Size: 467 KiB |
|
After Width: 615 | Height: 381 | Size: 412 KiB |
|
After Width: 615 | Height: 381 | Size: 433 KiB |
|
After Width: 650 | Height: 208 | Size: 15 KiB |
|
After Width: 650 | Height: 259 | Size: 16 KiB |
|
After Width: 650 | Height: 96 | Size: 7.9 KiB |
|
After Width: 440 | Height: 309 | Size: 22 KiB |
|
After Width: 650 | Height: 103 | Size: 6.8 KiB |
|
After Width: 650 | Height: 113 | Size: 9.7 KiB |
|
After Width: 650 | Height: 55 | Size: 6.0 KiB |
|
After Width: 650 | Height: 364 | Size: 19 KiB |
|
After Width: 650 | Height: 364 | Size: 11 KiB |
|
After Width: 650 | Height: 227 | Size: 14 KiB |
|
After Width: 650 | Height: 57 | Size: 4.0 KiB |
|
After Width: 650 | Height: 107 | Size: 8.1 KiB |
|
After Width: 650 | Height: 76 | Size: 6.5 KiB |
|
After Width: 650 | Height: 283 | Size: 25 KiB |
|
After Width: 650 | Height: 364 | Size: 24 KiB |
|
After Width: 650 | Height: 364 | Size: 24 KiB |
|
After Width: 650 | Height: 364 | Size: 18 KiB |
|
After Width: 651 | Height: 113 | Size: 8.6 KiB |
|
After Width: 650 | Height: 366 | Size: 383 KiB |
|
After Width: 650 | Height: 366 | Size: 425 KiB |
|
After Width: 431 | Height: 238 | Size: 27 KiB |
|
After Width: 431 | Height: 238 | Size: 27 KiB |
|
After Width: 555 | Height: 413 | Size: 404 KiB |
|
After Width: 650 | Height: 171 | Size: 12 KiB |
|
After Width: 431 | Height: 238 | Size: 24 KiB |
|
After Width: 650 | Height: 79 | Size: 6.8 KiB |
|
After Width: 555 | Height: 413 | Size: 403 KiB |
|
After Width: 478 | Height: 375 | Size: 40 KiB |
|
After Width: 495 | Height: 216 | Size: 30 KiB |
|
After Width: 416 | Height: 500 | Size: 45 KiB |
|
After Width: 431 | Height: 238 | Size: 24 KiB |
|
After Width: 650 | Height: 147 | Size: 12 KiB |
|
After Width: 650 | Height: 130 | Size: 11 KiB |
|
After Width: 650 | Height: 170 | Size: 15 KiB |
|
After Width: 440 | Height: 266 | Size: 24 KiB |
|
After Width: 437 | Height: 224 | Size: 42 KiB |
|
After Width: 650 | Height: 164 | Size: 12 KiB |
|
After Width: 650 | Height: 113 | Size: 8.8 KiB |
|
After Width: 431 | Height: 267 | Size: 13 KiB |
@ -0,0 +1,15 @@ |
|||||
|
## Post Processing Stack v2 overview |
||||
|
|
||||
|
Post-processing is a generic term for a full-screen image processing effect that occurs after the camera draws the scene but before the scene is rendered on the screen. Post-processing can drastically improve the visuals of your product with little setup time. |
||||
|
|
||||
|
You can use post-processing effects to simulate physical camera and film properties. |
||||
|
|
||||
|
For information about requirements and compatibility, see section [Requirements](requirements.html). |
||||
|
|
||||
|
The images below demonstrate a scene with and without post-processing: |
||||
|
|
||||
|
 |
||||
|
</br> |
||||
|
|
||||
|
 |
||||
|
</br> |
||||
@ -0,0 +1,5 @@ |
|||||
|
# Known issues |
||||
|
|
||||
|
- The **Post Processing** package doesn't work on MacOS X 10.11.6 when running Metal in the editor due to a driver bug on this specific version of the OS. |
||||
|
|
||||
|
For limitations and known issues for each effect, see the specific effect page. |
||||
@ -0,0 +1,23 @@ |
|||||
|
# Requirements and compatibility |
||||
|
|
||||
|
This page contains information on system requirements and compatibility of this Post-processing module. |
||||
|
|
||||
|
## Unity Editor compatibility |
||||
|
|
||||
|
The **Post processing** package is compatible with the following versions of the Unity Editor: |
||||
|
|
||||
|
* Unity 2018.1 and later. |
||||
|
|
||||
|
## Render pipeline compatibility |
||||
|
|
||||
|
This package is compatible with the following render pipeline versions: |
||||
|
|
||||
|
* Built-in render pipeline. |
||||
|
* Universal Render Pipeline (URP) 7.x, with Unity 2018 LTS, and 2019 LTS. Certain effects are not compatible with URP. |
||||
|
* Scriptable Render Pipeline (SRP). |
||||
|
|
||||
|
## Unity Player system requirements |
||||
|
|
||||
|
This package does not add any platform-specific requirements to Unity. For more information on Unity system requirements, see [System requirements for Unity](https://docs.unity3d.com/Manual/system-requirements.html). |
||||
|
|
||||
|
Some **Post Processing** effects have extra requirements in addition to the common Unity Player system requirements. For system requirements for each effect, see the specific effect page. |
||||
@ -0,0 +1,5 @@ |
|||||
|
com.unity.postprocessing copyright © 2020 Unity Technologies ApS |
||||
|
|
||||
|
Licensed under the Unity Companion License for Unity-dependent projects--see [Unity Companion License](http://www.unity3d.com/legal/licenses/Unity_Companion_License). |
||||
|
|
||||
|
Unless expressly provided otherwise, the Software under this license is made available strictly on an “AS IS” BASIS WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED. Please review the license for details on these and other terms and conditions. |
||||
@ -0,0 +1,7 @@ |
|||||
|
fileFormatVersion: 2 |
||||
|
guid: 19d205ceab90d42038ad1d376affc356 |
||||
|
TextScriptImporter: |
||||
|
externalObjects: {} |
||||
|
userData: |
||||
|
assetBundleName: |
||||
|
assetBundleVariant: |
||||
@ -0,0 +1,8 @@ |
|||||
|
fileFormatVersion: 2 |
||||
|
guid: 0d256a256b5667448bb3f33f75dbb4bf |
||||
|
folderAsset: yes |
||||
|
DefaultImporter: |
||||
|
externalObjects: {} |
||||
|
userData: |
||||
|
assetBundleName: |
||||
|
assetBundleVariant: |
||||
@ -0,0 +1,9 @@ |
|||||
|
fileFormatVersion: 2 |
||||
|
guid: 10af18f17ff5ecf47bc4dbd1551b36d2 |
||||
|
folderAsset: yes |
||||
|
timeCreated: 1488201031 |
||||
|
licenseType: Pro |
||||
|
DefaultImporter: |
||||
|
userData: |
||||
|
assetBundleName: |
||||
|
assetBundleVariant: |
||||
@ -0,0 +1,9 @@ |
|||||
|
fileFormatVersion: 2 |
||||
|
guid: f5422948b83b1d34c86e710f0d9fea30 |
||||
|
folderAsset: yes |
||||
|
timeCreated: 1492690959 |
||||
|
licenseType: Pro |
||||
|
DefaultImporter: |
||||
|
userData: |
||||
|
assetBundleName: |
||||
|
assetBundleVariant: |
||||
@ -0,0 +1,27 @@ |
|||||
|
using System; |
||||
|
|
||||
|
namespace UnityEditor.Rendering.PostProcessing |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// Tells a <see cref="AttributeDecorator"/> class which inspector attribute it's a decorator
|
||||
|
/// for.
|
||||
|
/// </summary>
|
||||
|
/// <seealso cref="AttributeDecorator"/>
|
||||
|
[AttributeUsage(AttributeTargets.Class, AllowMultiple = false)] |
||||
|
public sealed class DecoratorAttribute : Attribute |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// The attribute type that this decorator can inspect.
|
||||
|
/// </summary>
|
||||
|
public readonly Type attributeType; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// Creates a new attribute.
|
||||
|
/// </summary>
|
||||
|
/// <param name="attributeType">The type that this decorator can inspect</param>
|
||||
|
public DecoratorAttribute(Type attributeType) |
||||
|
{ |
||||
|
this.attributeType = attributeType; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,12 @@ |
|||||
|
fileFormatVersion: 2 |
||||
|
guid: 9753335d6f48da542be1c720aa07bbf5 |
||||
|
timeCreated: 1493109769 |
||||
|
licenseType: Pro |
||||
|
MonoImporter: |
||||
|
serializedVersion: 2 |
||||
|
defaultReferences: [] |
||||
|
executionOrder: 0 |
||||
|
icon: {instanceID: 0} |
||||
|
userData: |
||||
|
assetBundleName: |
||||
|
assetBundleVariant: |
||||
@ -0,0 +1,28 @@ |
|||||
|
using System; |
||||
|
|
||||
|
namespace UnityEditor.Rendering.PostProcessing |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// Tells a <see cref="PostProcessEffectEditor{T}"/> class which run-time type it's an editor
|
||||
|
/// for. When you make a custom editor for an effect, you need put this attribute on the editor
|
||||
|
/// class.
|
||||
|
/// </summary>
|
||||
|
/// <seealso cref="PostProcessEffectEditor{T}"/>
|
||||
|
[AttributeUsage(AttributeTargets.Class, AllowMultiple = false)] |
||||
|
public sealed class PostProcessEditorAttribute : Attribute |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// The type that this editor can edit.
|
||||
|
/// </summary>
|
||||
|
public readonly Type settingsType; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// Creates a new attribute.
|
||||
|
/// </summary>
|
||||
|
/// <param name="settingsType">The type that this editor can edit</param>
|
||||
|
public PostProcessEditorAttribute(Type settingsType) |
||||
|
{ |
||||
|
this.settingsType = settingsType; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,12 @@ |
|||||
|
fileFormatVersion: 2 |
||||
|
guid: 70ea2ab329ffbac43a0a02daa61dbe6b |
||||
|
timeCreated: 1492690987 |
||||
|
licenseType: Pro |
||||
|
MonoImporter: |
||||
|
serializedVersion: 2 |
||||
|
defaultReferences: [] |
||||
|
executionOrder: 0 |
||||
|
icon: {instanceID: 0} |
||||
|
userData: |
||||
|
assetBundleName: |
||||
|
assetBundleVariant: |
||||
@ -0,0 +1,59 @@ |
|||||
|
using System; |
||||
|
using System.Linq.Expressions; |
||||
|
using UnityEngine; |
||||
|
using UnityEngine.Rendering.PostProcessing; |
||||
|
|
||||
|
namespace UnityEditor.Rendering.PostProcessing |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// Small wrapper on top of <see cref="Editor"/> to ease the access of the underlying component
|
||||
|
/// and its serialized fields.
|
||||
|
/// </summary>
|
||||
|
/// <typeparam name="T">The type of the target component to make an editor for</typeparam>
|
||||
|
/// <example>
|
||||
|
/// <code>
|
||||
|
/// public class MyMonoBehaviour : MonoBehaviour
|
||||
|
/// {
|
||||
|
/// public float myProperty = 1.0f;
|
||||
|
/// }
|
||||
|
///
|
||||
|
/// [CustomEditor(typeof(MyMonoBehaviour))]
|
||||
|
/// public sealed class MyMonoBehaviourEditor : BaseEditor<MyMonoBehaviour>
|
||||
|
/// {
|
||||
|
/// SerializedProperty m_MyProperty;
|
||||
|
///
|
||||
|
/// void OnEnable()
|
||||
|
/// {
|
||||
|
/// m_MyProperty = FindProperty(x => x.myProperty);
|
||||
|
/// }
|
||||
|
///
|
||||
|
/// public override void OnInspectorGUI()
|
||||
|
/// {
|
||||
|
/// EditorGUILayout.PropertyField(m_MyProperty);
|
||||
|
/// }
|
||||
|
/// }
|
||||
|
/// </code>
|
||||
|
/// </example>
|
||||
|
public class BaseEditor<T> : Editor |
||||
|
where T : MonoBehaviour |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// The target component.
|
||||
|
/// </summary>
|
||||
|
protected T m_Target |
||||
|
{ |
||||
|
get { return (T)target; } |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
///
|
||||
|
/// </summary>
|
||||
|
/// <typeparam name="TValue"></typeparam>
|
||||
|
/// <param name="expr"></param>
|
||||
|
/// <returns></returns>
|
||||
|
protected SerializedProperty FindProperty<TValue>(Expression<Func<T, TValue>> expr) |
||||
|
{ |
||||
|
return serializedObject.FindProperty(RuntimeUtilities.GetFieldPath(expr)); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,12 @@ |
|||||
|
fileFormatVersion: 2 |
||||
|
guid: 69a4fc27499557744827c787d71fdf08 |
||||
|
timeCreated: 1488275908 |
||||
|
licenseType: Pro |
||||
|
MonoImporter: |
||||
|
serializedVersion: 2 |
||||
|
defaultReferences: [] |
||||
|
executionOrder: 0 |
||||
|
icon: {instanceID: 0} |
||||
|
userData: |
||||
|
assetBundleName: |
||||
|
assetBundleVariant: |
||||
@ -0,0 +1,9 @@ |
|||||
|
fileFormatVersion: 2 |
||||
|
guid: 21a375b704549664589881dfc892e7e7 |
||||
|
folderAsset: yes |
||||
|
timeCreated: 1493051174 |
||||
|
licenseType: Pro |
||||
|
DefaultImporter: |
||||
|
userData: |
||||
|
assetBundleName: |
||||
|
assetBundleVariant: |
||||