diff --git a/Packages/com.unity.postprocessing@3.2.2/CHANGELOG.md b/Packages/com.unity.postprocessing@3.2.2/CHANGELOG.md index 50f076e..5463a23 100644 --- a/Packages/com.unity.postprocessing@3.2.2/CHANGELOG.md +++ b/Packages/com.unity.postprocessing@3.2.2/CHANGELOG.md @@ -4,10 +4,18 @@ 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.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 diff --git a/Packages/com.unity.postprocessing@3.2.2/Documentation~/Ambient-Occlusion.md b/Packages/com.unity.postprocessing@3.2.2/Documentation~/Ambient-Occlusion.md index 6551fcf..d14b599 100644 --- a/Packages/com.unity.postprocessing@3.2.2/Documentation~/Ambient-Occlusion.md +++ b/Packages/com.unity.postprocessing@3.2.2/Documentation~/Ambient-Occlusion.md @@ -9,6 +9,12 @@ The **Ambient Occlusion** effect in this package has two modes: - Scalable Ambient Obscurance - Multi-scale Volumetric Occlusion +![Scene rendered without Ambient Occlusion effect](images/ao-off.png) +Scene without **Ambient Occlusion**. + +![Scene rendered with Ambient Occlusion effect](images/ao-on.png) +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. @@ -28,18 +34,15 @@ Dropping the `Quality` setting down will improve performance too. - Depth & Normals textures - Shader model 3 - -![](images/ssao-1.png) - - ### Properties | Property | Function | -| :------------ | :------------------------------------------------------------ | -| Intensity | Adjust the degree of darkness **Ambient Occlusion** produces. | +| :----------- | :------------------------------------------------------------ | +| 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. | +| 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. | @@ -53,14 +56,13 @@ This mode is optimized for consoles and desktop platforms. It has better graphic - Compute shader support - Shader model 4.5 -![](images/ssao-2.png) - - ### Properties | Property | Function | -| :------------------ | :------------------------------------------------------------ | -| Intensity | Adjust the degree of darkness **Ambient Occlusion** produces. | +| :----------------- | :------------------------------------------------------------ | +| 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. | -| Color | Set the tint color of the ambient occlusion. | +| 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. | diff --git a/Packages/com.unity.postprocessing@3.2.2/Documentation~/Anti-aliasing.md b/Packages/com.unity.postprocessing@3.2.2/Documentation~/Anti-aliasing.md index c02d136..ba71062 100644 --- a/Packages/com.unity.postprocessing@3.2.2/Documentation~/Anti-aliasing.md +++ b/Packages/com.unity.postprocessing@3.2.2/Documentation~/Anti-aliasing.md @@ -2,7 +2,7 @@ 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). -![](images/screenshot-antialiasing.png) +![Example of anti-aliasing smoothing the edges of shapes](images/screenshot-antialiasing.png) 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. @@ -20,14 +20,11 @@ Each mode is set per-camera in the **Post-process Layer** component. **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**. - -![](images/aa-1.png) - - ### 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. | @@ -45,14 +42,11 @@ Enable `Fast Mode` if you are developing for mobile devices to get a performance **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. - -![](images/aa-2.png) - - ### Properties | Property | Function | -| :-------- | :------------------------------------------------ | +| :------- | :----------------------------------------------- | +| Mode | Select the type of **Anti-Aliasing** to use. | | Quality | Set the overall quality of the anti-aliasing filter. | ### Performance @@ -73,14 +67,11 @@ Lowering the `Quality` setting makes the effect run faster. Do not use **SMAA** **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. - -![](images/aa-3.png) - - ### 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. | diff --git a/Packages/com.unity.postprocessing@3.2.2/Documentation~/Auto-Exposure.md b/Packages/com.unity.postprocessing@3.2.2/Documentation~/Auto-Exposure.md index ca7568a..00d2f67 100644 --- a/Packages/com.unity.postprocessing@3.2.2/Documentation~/Auto-Exposure.md +++ b/Packages/com.unity.postprocessing@3.2.2/Documentation~/Auto-Exposure.md @@ -4,9 +4,11 @@ The **Auto Exposure** effect simulates how the human eye adjusts to changes in b 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 rendered without the Auto Exposure effect](images/auto-exposure-off.png) +Scene without **Auto Exposure**. -![](images\autoexposure.png) - +![Scene rendered with the Auto Exposure effect](images/auto-exposure-on.png) +Scene with **Auto Exposure**. ### Properties @@ -39,7 +41,7 @@ You can debug the exposure in your scene with the **Post-process Debug** compone 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). -![](Images\Ppv2 _ Debugging_Light meter_Graph.png) +![Debugging Light Meter Graph](Images/Ppv2-Debugging-Light-Meter-Graph.png) The Light Meter monitor. diff --git a/Packages/com.unity.postprocessing@3.2.2/Documentation~/Bloom.md b/Packages/com.unity.postprocessing@3.2.2/Documentation~/Bloom.md index 8ea6cb5..e07aef0 100644 --- a/Packages/com.unity.postprocessing@3.2.2/Documentation~/Bloom.md +++ b/Packages/com.unity.postprocessing@3.2.2/Documentation~/Bloom.md @@ -4,13 +4,10 @@ The **Bloom** effect makes bright areas in your image glow. To do this, it creat 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. - -![PostProcessing-Bloom-0](images\PostProcessing-Bloom-0.png) +![Bloom applied to a glowing orb in a dark space](images/PostProcessing-Bloom-0.png) ### Properties -![](images/bloom.png) - **Bloom** settings: | Property | Function | diff --git a/Packages/com.unity.postprocessing@3.2.2/Documentation~/Chromatic-Aberration.md b/Packages/com.unity.postprocessing@3.2.2/Documentation~/Chromatic-Aberration.md index 7552f4d..2a740bf 100644 --- a/Packages/com.unity.postprocessing@3.2.2/Documentation~/Chromatic-Aberration.md +++ b/Packages/com.unity.postprocessing@3.2.2/Documentation~/Chromatic-Aberration.md @@ -4,18 +4,14 @@ The **Chromatic Aberration** effect splits color along boundaries in an image in Unity provides support for red/blue and green/purple fringing. You can define fringing colors by using an input texture. -![Scene without Chromatic Aberration](images\PostProcessing-ChromaticAberration-1.png) - - - -![Scene with Chromatic Aberration](images\PostProcessing-ChromaticAberration-0.png) +![Scene without Chromatic Aberration](images/PostProcessing-ChromaticAberration-1.png) +Scene without **Chromatic Aberration**. +![Scene with Chromatic Aberration](images/PostProcessing-ChromaticAberration-0.png) Scene with **Chromatic Aberration**. ### Properties -![](images/chroma.png) - | Property | Function | | :------------ | :------------------------------------------------------------ | | Spectral Lut | Select the texture used for a custom fringing color. When left empty, Unity will use the default texture. | diff --git a/Packages/com.unity.postprocessing@3.2.2/Documentation~/Color-Grading.md b/Packages/com.unity.postprocessing@3.2.2/Documentation~/Color-Grading.md index cda762c..542b8c0 100644 --- a/Packages/com.unity.postprocessing@3.2.2/Documentation~/Color-Grading.md +++ b/Packages/com.unity.postprocessing@3.2.2/Documentation~/Color-Grading.md @@ -2,7 +2,7 @@ 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. -![](images\screenshot-grading.png) +![Three examples of how you can use Color Grading](images/screenshot-grading.png) The **Color Grading** effect comes with three modes: @@ -16,8 +16,6 @@ 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. -![](images/grading-1.png) - ### Properties | Property | Function | @@ -28,7 +26,6 @@ The Lookup Texture and Contribution settings are only available for **Low Defini > **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. @@ -39,7 +36,7 @@ Always apply **Tonemapping** when using an HDR camera, otherwise color intensity ### Properties -![](images/grading-2.png) +![Tonemapping UI](images/tonemapping.png) | Property | Function | | :----------------- | :------------------------------------------------------------ | @@ -55,9 +52,6 @@ Always apply **Tonemapping** when using an HDR camera, otherwise color intensity **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. -![](images/grading-3.png) - - ### Properties | Property | Function | @@ -67,10 +61,6 @@ Always apply **Tonemapping** when using an HDR camera, otherwise color intensity ## Tone - -![](images/grading-4.png) - - ### Properties | Property | Function | @@ -82,17 +72,12 @@ Always apply **Tonemapping** when using an HDR camera, otherwise color intensity | Brightness | Only available in the **Low Definition Range (LDR)** mode.
Adjust the brightness of the image.
| | 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. - -![](images/grading-5.png) - - ### Properties | Property | Function | @@ -108,9 +93,7 @@ Use **Trackballs** to perform three-way color grading. Adjust the position of th > **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`. - -![](images/grading-6.png) - +![Trackballs UI](images/trackballs.png) ### Properties @@ -128,42 +111,31 @@ Use **Trackballs** to perform three-way color grading. Adjust the position of th **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. - -![](images/grading-11.png) - +![YRGB Curves UI](images/yrgb-curves.png) ### 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. - -![](images/grading-7.png) - +![Hue vs Hue UI](images/hue-vs-hue.png) ### 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. - -![](images/grading-8.png) - +![Hue vs Sat UI](images/hue-vs-sat.png) ### 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. - -![](images/grading-9.png) - +![Sat vs Sat UI](images/sat-vs-sat.png) ### 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. - -![](images/grading-10.png) - - +![Lum vs Sat UI](images/lum-vs-sat.png) ### Requirements diff --git a/Packages/com.unity.postprocessing@3.2.2/Documentation~/Debugging-Post-processing-effects.md b/Packages/com.unity.postprocessing@3.2.2/Documentation~/Debugging-Post-processing-effects.md index b3c10ae..52683e1 100644 --- a/Packages/com.unity.postprocessing@3.2.2/Documentation~/Debugging-Post-processing-effects.md +++ b/Packages/com.unity.postprocessing@3.2.2/Documentation~/Debugging-Post-processing-effects.md @@ -4,20 +4,18 @@ The **Post-process Debug** component displays real-time data about post-processi 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. -![The Histogram monitor as it appears in the Game window.](Images\Ppv2_Debugging_Histogram.png) +![The Histogram monitor as it appears in the Game window.](images/Ppv2_Debugging_Histogram.png) ## 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.** -![](images/Ppv2_Post-processing-Debug.png) - 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 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. @@ -50,20 +48,19 @@ The **Light Meter monitor** displays a logarithmic histogram in the Game window - 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. -**![img](https://lh3.googleusercontent.com/2qT6Jpcw6MRzTZ9rBEE6PRaDlG7guSoAYDFDGlIIbwWjSxiphicZoUT9BR_SHahJB0T3R3uP-7j5E84x1bG1SczKkNmpeWijRez-LwE-D8bnFG8aM4czTrCJC-dSo0WSW6RtTcMX)** - -The Light meter histogram that Unity shows in the Game window. +![The Light Meter Histogram](images/Ppv2-Debugging-Light-Meter-Graph.png) +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 | +| Show Curves | Enable this checkbox to display Tonemapping curves monitor in the **Light meter** histogram | ### 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. -**![img](https://lh4.googleusercontent.com/DwsclJsBsMoFhASqKTM8cbRt6v9QYOJdxvMuMVtTT7zJVnMU8S_DEIohCp4BeCVzRVmOcIO7twD-3MQ1J8qh92CKMuKNWpweNJGQhScuG41TOeAQkrhW2TxA3_d7aA6qKn5R55qc)** +![The Debugging Histogram](images/Ppv2-Debugging-Histogram-Graph.png) The **Histogram** that Unity shows in the Game window. @@ -75,9 +72,9 @@ The **Histogram** that Unity shows in the Game window. ### 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** 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. -**![img](https://lh3.googleusercontent.com/vCv47DrKOhpAL47E9FdiNarOsied6Jn3czGT7qgWIEUaDYDM87h_zcib68WIAJ9-TK1B1uQTNMSWsyePFRoUZReT0ygSfY6vG0aZyLBD4bDur5fL_3_8x4Ui6U4NXw_-gxyofdbL)** +![The Debugging Waveform Graph](images/Ppv2-Debugging-Waveform-Graph.png) The **Waveform** that Unity shows in the Game window. @@ -94,7 +91,7 @@ The Vectorscope measures hue values between yellow, red, magenta, blue, cyan and 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. -**![img](https://lh6.googleusercontent.com/RPh4fQGvSARBMtRTN0JrA-6vHPsxNDvSlasP2V3qKkRDAeWBUKr-frRngl246bbxL789pOaQxrNVUei4Y7ABodNnQ2eHgdZOZ9PC4ng6gVydRKSWvIZBmUrn6qu6QmkRlRvNbyOa)** +![The Debugging Vectorscope Graph](images/Ppv2-Debugging-Vectorscope-Graph.png) The **Vectorscope** that Unity displays in the Game window. diff --git a/Packages/com.unity.postprocessing@3.2.2/Documentation~/Deferred-Fog.md b/Packages/com.unity.postprocessing@3.2.2/Documentation~/Deferred-Fog.md index e5904e1..9c43d38 100644 --- a/Packages/com.unity.postprocessing@3.2.2/Documentation~/Deferred-Fog.md +++ b/Packages/com.unity.postprocessing@3.2.2/Documentation~/Deferred-Fog.md @@ -2,7 +2,7 @@ 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. - ![screenshot-fog](/images/screenshot-fog.png) + ![Scene rendered with Deferred Fog enabled](images/screenshot-fog.png) 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. @@ -10,8 +10,6 @@ The **Deferred Fog** effect creates a screen-space fog based on the camera’s [ ### Properties -![](images/deferredfog.png) - | Property | Function | | :-------------- | :--------------------------------- | | Enabled | Enable this checkbox to turn the **Deferred Fog** effect on.| diff --git a/Packages/com.unity.postprocessing@3.2.2/Documentation~/Depth-of-Field.md b/Packages/com.unity.postprocessing@3.2.2/Documentation~/Depth-of-Field.md index 5c5ee62..d458213 100644 --- a/Packages/com.unity.postprocessing@3.2.2/Documentation~/Depth-of-Field.md +++ b/Packages/com.unity.postprocessing@3.2.2/Documentation~/Depth-of-Field.md @@ -2,14 +2,12 @@ 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 scene with the Depth of Field effect applied](images/screenshot-dof.png) + ![A scene with the Depth of Field effect applied](images/screenshot-dof.png) 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 -![](images/dof.png) - | Property | Function | | :-------------- | :------------------------------------------------------------ | | Focus Distance | Set the distance to the point of focus. | diff --git a/Packages/com.unity.postprocessing@3.2.2/Documentation~/Grain.md b/Packages/com.unity.postprocessing@3.2.2/Documentation~/Grain.md index 76d477d..07aa8d6 100644 --- a/Packages/com.unity.postprocessing@3.2.2/Documentation~/Grain.md +++ b/Packages/com.unity.postprocessing@3.2.2/Documentation~/Grain.md @@ -5,16 +5,14 @@ Unity’s **Grain** effect is based on a coherent gradient noise. This gives you The **Grain** effect available in Unity is based on a coherent gradient noise. -![Scene without Grain](images\Grain_image_1.png) +![Scene without Grain](images/Grain_image_1.png) +Scene without the **Grain** effect. - - -![Scene with Grain](images\Grain_image_0.png) +![Scene with Grain](images/Grain_image_0.png) +Scene with the **Grain** effect. ### Properties -![](images/grain.png) - | Property | Function | | :---------------------- | :------------------------------------------------------------ | | Colored | Enable the checkbox to use colored grain. | diff --git a/Packages/com.unity.postprocessing@3.2.2/Documentation~/Lens-Distortion.md b/Packages/com.unity.postprocessing@3.2.2/Documentation~/Lens-Distortion.md index fac2599..bc191f0 100644 --- a/Packages/com.unity.postprocessing@3.2.2/Documentation~/Lens-Distortion.md +++ b/Packages/com.unity.postprocessing@3.2.2/Documentation~/Lens-Distortion.md @@ -2,8 +2,11 @@ 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. -![](images/lensdistortion.png) +![Scene without Lens Distortion effect](images/no-lens-distortion.png) +Scene without **Lens Distortion**. +![Scene with Lens Distortion effect](images/lens-distortion.png) +Scene with **Lens Distortion**. ### Properties diff --git a/Packages/com.unity.postprocessing@3.2.2/Documentation~/Motion-Blur.md b/Packages/com.unity.postprocessing@3.2.2/Documentation~/Motion-Blur.md index 976f8ff..291287d 100644 --- a/Packages/com.unity.postprocessing@3.2.2/Documentation~/Motion-Blur.md +++ b/Packages/com.unity.postprocessing@3.2.2/Documentation~/Motion-Blur.md @@ -2,13 +2,10 @@ 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. - -![screenshot-motionblur](images\screenshot-motionblur.png) +![Scene using the Motion Blur effect](images/screenshot-motionblur.png) ### Properties -![](images/motionblur.png) - | Property | Function | | :------------- | :------------------------------------------------------------ | | Shutter Angle | Set the angle of the rotary shutter. Larger values give longer exposure and a stronger blur effect. | diff --git a/Packages/com.unity.postprocessing@3.2.2/Documentation~/Screen-Space-Reflections.md b/Packages/com.unity.postprocessing@3.2.2/Documentation~/Screen-Space-Reflections.md index f1451be..90ca2e3 100644 --- a/Packages/com.unity.postprocessing@3.2.2/Documentation~/Screen-Space-Reflections.md +++ b/Packages/com.unity.postprocessing@3.2.2/Documentation~/Screen-Space-Reflections.md @@ -4,14 +4,10 @@ The **Screen Space Reflection** effect creates subtle reflections that simulate 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. -![Scene with Screen Space Reflections](images\screenshot-ssr.png) - - +![Scene with Screen Space Reflections](images/screenshot-ssr.png) ### Properties -![](images/ssr.png) - | Property | Function | | :----------------------- | :------------------------------------------------------------ | | Preset | Select the quality preset from the dropdown. Use **Custom** to fine tune the quality. | diff --git a/Packages/com.unity.postprocessing@3.2.2/Documentation~/Vignette.md b/Packages/com.unity.postprocessing@3.2.2/Documentation~/Vignette.md index afb0391..57eb02f 100644 --- a/Packages/com.unity.postprocessing@3.2.2/Documentation~/Vignette.md +++ b/Packages/com.unity.postprocessing@3.2.2/Documentation~/Vignette.md @@ -2,9 +2,11 @@ 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](images\PostProcessing-Vignette-1.png) +![Scene without Vignette](images/PostProcessing-Vignette-1.png) +Scene without **Vignette** effect. -![Scene with Vignette](images\PostProcessing-Vignette-2.png) +![Scene with Vignette](images/PostProcessing-Vignette-2.png) +Scene with **Vignette** effect. The Vignette effect in the post-processing stack has two modes: @@ -16,14 +18,11 @@ The Vignette effect in the post-processing stack has two modes: **Classic** mode has parametric controls for the position, shape and intensity of the Vignette. This is the most common way to use the effect. - -![](images\vignette-1.png) - - ### 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. | @@ -36,16 +35,14 @@ The Vignette effect in the post-processing stack has two modes: **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. -![](images/vignette-2.png) - - ### 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. | -| Intensity | Set the mask opacity value. | +| Opacity | Set the mask opacity value. | ### Requirements diff --git a/Packages/com.unity.postprocessing@3.2.2/Documentation~/images/Ppv2-Debugging-Histogram-Graph.png b/Packages/com.unity.postprocessing@3.2.2/Documentation~/images/Ppv2-Debugging-Histogram-Graph.png new file mode 100644 index 0000000..aa14e99 Binary files /dev/null and b/Packages/com.unity.postprocessing@3.2.2/Documentation~/images/Ppv2-Debugging-Histogram-Graph.png differ diff --git a/Packages/com.unity.postprocessing@3.2.2/Documentation~/images/Ppv2-Debugging-Light-Meter-Graph.png b/Packages/com.unity.postprocessing@3.2.2/Documentation~/images/Ppv2-Debugging-Light-Meter-Graph.png new file mode 100644 index 0000000..33dd90d Binary files /dev/null and b/Packages/com.unity.postprocessing@3.2.2/Documentation~/images/Ppv2-Debugging-Light-Meter-Graph.png differ diff --git a/Packages/com.unity.postprocessing@3.2.2/Documentation~/images/Ppv2-Debugging-Vectorscope-Graph.png b/Packages/com.unity.postprocessing@3.2.2/Documentation~/images/Ppv2-Debugging-Vectorscope-Graph.png new file mode 100644 index 0000000..4347594 Binary files /dev/null and b/Packages/com.unity.postprocessing@3.2.2/Documentation~/images/Ppv2-Debugging-Vectorscope-Graph.png differ diff --git a/Packages/com.unity.postprocessing@3.2.2/Documentation~/images/Ppv2-Debugging-Waveform-Graph.png b/Packages/com.unity.postprocessing@3.2.2/Documentation~/images/Ppv2-Debugging-Waveform-Graph.png new file mode 100644 index 0000000..7663a69 Binary files /dev/null and b/Packages/com.unity.postprocessing@3.2.2/Documentation~/images/Ppv2-Debugging-Waveform-Graph.png differ diff --git a/Packages/com.unity.postprocessing@3.2.2/Documentation~/images/ao-off.png b/Packages/com.unity.postprocessing@3.2.2/Documentation~/images/ao-off.png new file mode 100644 index 0000000..c0a352c Binary files /dev/null and b/Packages/com.unity.postprocessing@3.2.2/Documentation~/images/ao-off.png differ diff --git a/Packages/com.unity.postprocessing@3.2.2/Documentation~/images/ao-on.png b/Packages/com.unity.postprocessing@3.2.2/Documentation~/images/ao-on.png new file mode 100644 index 0000000..91ea2c2 Binary files /dev/null and b/Packages/com.unity.postprocessing@3.2.2/Documentation~/images/ao-on.png differ diff --git a/Packages/com.unity.postprocessing@3.2.2/Documentation~/images/auto-exposure-off.png b/Packages/com.unity.postprocessing@3.2.2/Documentation~/images/auto-exposure-off.png new file mode 100644 index 0000000..98b5792 Binary files /dev/null and b/Packages/com.unity.postprocessing@3.2.2/Documentation~/images/auto-exposure-off.png differ diff --git a/Packages/com.unity.postprocessing@3.2.2/Documentation~/images/auto-exposure-on.png b/Packages/com.unity.postprocessing@3.2.2/Documentation~/images/auto-exposure-on.png new file mode 100644 index 0000000..c68fe58 Binary files /dev/null and b/Packages/com.unity.postprocessing@3.2.2/Documentation~/images/auto-exposure-on.png differ diff --git a/Packages/com.unity.postprocessing@3.2.2/Documentation~/images/hue-vs-hue.png b/Packages/com.unity.postprocessing@3.2.2/Documentation~/images/hue-vs-hue.png new file mode 100644 index 0000000..b3ab5ab Binary files /dev/null and b/Packages/com.unity.postprocessing@3.2.2/Documentation~/images/hue-vs-hue.png differ diff --git a/Packages/com.unity.postprocessing@3.2.2/Documentation~/images/hue-vs-sat.png b/Packages/com.unity.postprocessing@3.2.2/Documentation~/images/hue-vs-sat.png new file mode 100644 index 0000000..0db61dc Binary files /dev/null and b/Packages/com.unity.postprocessing@3.2.2/Documentation~/images/hue-vs-sat.png differ diff --git a/Packages/com.unity.postprocessing@3.2.2/Documentation~/images/lens-distortion.png b/Packages/com.unity.postprocessing@3.2.2/Documentation~/images/lens-distortion.png new file mode 100644 index 0000000..9d0cb1f Binary files /dev/null and b/Packages/com.unity.postprocessing@3.2.2/Documentation~/images/lens-distortion.png differ diff --git a/Packages/com.unity.postprocessing@3.2.2/Documentation~/images/lum-vs-sat.png b/Packages/com.unity.postprocessing@3.2.2/Documentation~/images/lum-vs-sat.png new file mode 100644 index 0000000..f17b1dc Binary files /dev/null and b/Packages/com.unity.postprocessing@3.2.2/Documentation~/images/lum-vs-sat.png differ diff --git a/Packages/com.unity.postprocessing@3.2.2/Documentation~/images/no-lens-distortion.png b/Packages/com.unity.postprocessing@3.2.2/Documentation~/images/no-lens-distortion.png new file mode 100644 index 0000000..39e30d5 Binary files /dev/null and b/Packages/com.unity.postprocessing@3.2.2/Documentation~/images/no-lens-distortion.png differ diff --git a/Packages/com.unity.postprocessing@3.2.2/Documentation~/images/quickstart-1.png b/Packages/com.unity.postprocessing@3.2.2/Documentation~/images/quickstart-1.png index 19ee707..9983f16 100644 Binary files a/Packages/com.unity.postprocessing@3.2.2/Documentation~/images/quickstart-1.png and b/Packages/com.unity.postprocessing@3.2.2/Documentation~/images/quickstart-1.png differ diff --git a/Packages/com.unity.postprocessing@3.2.2/Documentation~/images/quickstart-2.png b/Packages/com.unity.postprocessing@3.2.2/Documentation~/images/quickstart-2.png index 2b4b520..30fe17f 100644 Binary files a/Packages/com.unity.postprocessing@3.2.2/Documentation~/images/quickstart-2.png and b/Packages/com.unity.postprocessing@3.2.2/Documentation~/images/quickstart-2.png differ diff --git a/Packages/com.unity.postprocessing@3.2.2/Documentation~/images/quickstart-3.png b/Packages/com.unity.postprocessing@3.2.2/Documentation~/images/quickstart-3.png index f38e51a..5bc2896 100644 Binary files a/Packages/com.unity.postprocessing@3.2.2/Documentation~/images/quickstart-3.png and b/Packages/com.unity.postprocessing@3.2.2/Documentation~/images/quickstart-3.png differ diff --git a/Packages/com.unity.postprocessing@3.2.2/Documentation~/images/sat-vs-sat.png b/Packages/com.unity.postprocessing@3.2.2/Documentation~/images/sat-vs-sat.png new file mode 100644 index 0000000..5971afb Binary files /dev/null and b/Packages/com.unity.postprocessing@3.2.2/Documentation~/images/sat-vs-sat.png differ diff --git a/Packages/com.unity.postprocessing@3.2.2/Documentation~/images/tonemapping.png b/Packages/com.unity.postprocessing@3.2.2/Documentation~/images/tonemapping.png new file mode 100644 index 0000000..6b70420 Binary files /dev/null and b/Packages/com.unity.postprocessing@3.2.2/Documentation~/images/tonemapping.png differ diff --git a/Packages/com.unity.postprocessing@3.2.2/Documentation~/images/trackballs.png b/Packages/com.unity.postprocessing@3.2.2/Documentation~/images/trackballs.png new file mode 100644 index 0000000..fe18b0b Binary files /dev/null and b/Packages/com.unity.postprocessing@3.2.2/Documentation~/images/trackballs.png differ diff --git a/Packages/com.unity.postprocessing@3.2.2/Documentation~/images/yrgb-curves.png b/Packages/com.unity.postprocessing@3.2.2/Documentation~/images/yrgb-curves.png new file mode 100644 index 0000000..e8b9b72 Binary files /dev/null and b/Packages/com.unity.postprocessing@3.2.2/Documentation~/images/yrgb-curves.png differ diff --git a/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Editor/Effects/AmbientOcclusionEditor.cs b/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Editor/Effects/AmbientOcclusionEditor.cs index c943252..c200d59 100644 --- a/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Editor/Effects/AmbientOcclusionEditor.cs +++ b/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Editor/Effects/AmbientOcclusionEditor.cs @@ -11,6 +11,7 @@ namespace UnityEditor.Rendering.PostProcessing SerializedParameterOverride m_Color; SerializedParameterOverride m_AmbientOnly; SerializedParameterOverride m_ThicknessModifier; + SerializedParameterOverride m_ZBias; SerializedParameterOverride m_DirectLightingStrength; SerializedParameterOverride m_Quality; SerializedParameterOverride m_Radius; @@ -22,6 +23,7 @@ namespace UnityEditor.Rendering.PostProcessing m_Color = FindParameterOverride(x => x.color); m_AmbientOnly = FindParameterOverride(x => x.ambientOnly); m_ThicknessModifier = FindParameterOverride(x => x.thicknessModifier); + m_ZBias = FindParameterOverride(x => x.zBias); m_DirectLightingStrength = FindParameterOverride(x => x.directLightingStrength); m_Quality = FindParameterOverride(x => x.quality); m_Radius = FindParameterOverride(x => x.radius); @@ -51,6 +53,7 @@ namespace UnityEditor.Rendering.PostProcessing EditorGUILayout.HelpBox("Multi-scale volumetric obscurance requires compute shader support.", MessageType.Warning); PropertyField(m_ThicknessModifier); + PropertyField(m_ZBias); if (RuntimeUtilities.scriptableRenderPipelineActive) PropertyField(m_DirectLightingStrength); diff --git a/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Editor/Effects/ColorGradingEditor.cs b/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Editor/Effects/ColorGradingEditor.cs index 9215c93..8658443 100644 --- a/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Editor/Effects/ColorGradingEditor.cs +++ b/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Editor/Effects/ColorGradingEditor.cs @@ -639,7 +639,7 @@ namespace UnityEditor.Rendering.PostProcessing for (int i = 1; i < hLines; i++) { - var offset = i * Vector2.right * gridOffset; + var offset = gridOffset * i * Vector2.right; offset.x += gridPadding; Handles.DrawLine(innerRect.position + offset, new Vector2(innerRect.x, innerRect.yMax - 1) + offset); } @@ -650,7 +650,7 @@ namespace UnityEditor.Rendering.PostProcessing for (int i = 1; i < vLines; i++) { - var offset = i * Vector2.up * gridOffset; + var offset = gridOffset * i * Vector2.up; offset.y += gridPadding; Handles.DrawLine(innerRect.position + offset, new Vector2(innerRect.xMax - 1, innerRect.y) + offset); } diff --git a/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Editor/Effects/DefaultPostProcessEffectEditor.cs b/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Editor/Effects/DefaultPostProcessEffectEditor.cs index e25bd13..490fd73 100644 --- a/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Editor/Effects/DefaultPostProcessEffectEditor.cs +++ b/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Editor/Effects/DefaultPostProcessEffectEditor.cs @@ -23,11 +23,9 @@ namespace UnityEditor.Rendering.PostProcessing var fields = target.GetType() .GetFields(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic) - .Where(t => t.FieldType.IsSubclassOf(typeof(ParameterOverride)) && t.Name != "enabled") - .Where(t => - (t.IsPublic && t.GetCustomAttributes(typeof(NonSerializedAttribute), false).Length == 0) - || (t.GetCustomAttributes(typeof(UnityEngine.SerializeField), false).Length > 0) - ) + .Where(t => t.FieldType.IsSubclassOf(typeof(ParameterOverride)) && t.Name != "enabled" && ((t.IsPublic && t.GetCustomAttributes(typeof(NonSerializedAttribute), false).Length == 0) + || (t.GetCustomAttributes(typeof(UnityEngine.SerializeField), false).Length > 0)) +) .ToList(); foreach (var field in fields) diff --git a/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Editor/PostProcessLayerEditor.cs b/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Editor/PostProcessLayerEditor.cs index db2158c..1c12846 100644 --- a/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Editor/PostProcessLayerEditor.cs +++ b/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Editor/PostProcessLayerEditor.cs @@ -166,7 +166,7 @@ namespace UnityEditor.Rendering.PostProcessing EditorGUILayout.HelpBox("TAA requires Unity 2017.3+ for Single-pass stereo rendering support.", MessageType.Warning); #endif #if UNITY_2017_3_OR_NEWER - if (m_TargetCameraComponent != null && m_TargetCameraComponent.allowDynamicResolution) + if (m_TargetCameraComponent != null && RuntimeUtilities.IsDynamicResolutionEnabled(m_TargetCameraComponent)) EditorGUILayout.HelpBox("TAA is not supported with Dynamic Resolution.", MessageType.Warning); #endif diff --git a/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Editor/Tools/DefineSetter.cs b/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Editor/Tools/DefineSetter.cs index b2f4608..b6c9611 100644 --- a/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Editor/Tools/DefineSetter.cs +++ b/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Editor/Tools/DefineSetter.cs @@ -1,5 +1,8 @@ using System; using System.Linq; +#if UNITY_2021_3_OR_NEWER +using UnityEditor.Build; +#endif namespace UnityEditor.Rendering.PostProcessing { @@ -17,7 +20,12 @@ namespace UnityEditor.Rendering.PostProcessing foreach (var target in targets) { +#if UNITY_2021_3_OR_NEWER + var namedTarget = NamedBuildTarget.FromBuildTargetGroup(target); + var defines = PlayerSettings.GetScriptingDefineSymbols(namedTarget).Trim(); +#else var defines = PlayerSettings.GetScriptingDefineSymbolsForGroup(target).Trim(); +#endif var list = defines.Split(';', ' ') .Where(x => !string.IsNullOrEmpty(x)) @@ -29,10 +37,15 @@ namespace UnityEditor.Rendering.PostProcessing list.Add(k_Define); defines = list.Aggregate((a, b) => a + ";" + b); +#if UNITY_2021_3_OR_NEWER + PlayerSettings.SetScriptingDefineSymbols(namedTarget, defines); +#else PlayerSettings.SetScriptingDefineSymbolsForGroup(target, defines); +#endif } } + static bool IsObsolete(BuildTargetGroup group) { var attrs = typeof(BuildTargetGroup) diff --git a/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Effects/AmbientOcclusion.cs b/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Effects/AmbientOcclusion.cs index a6c87aa..59ac92f 100644 --- a/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Effects/AmbientOcclusion.cs +++ b/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Effects/AmbientOcclusion.cs @@ -127,6 +127,12 @@ namespace UnityEngine.Rendering.PostProcessing [Range(1f, 10f), Tooltip("This modifies the thickness of occluders. It increases the size of dark areas and also introduces a dark halo around objects.")] public FloatParameter thicknessModifier = new FloatParameter { value = 1f }; + /// + /// Add a bias distance to sampled depth in AO to reduce self-shadowing aliasing artifacts. + /// + [Range(0f, 0.001f), Tooltip("Add a bias distance to sampled depth in AO to reduce self-shadowing aliasing artifacts. ")] + public FloatParameter zBias = new FloatParameter { value = 0.0001f }; + // HDRP-only parameters /// diff --git a/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Effects/ChromaticAberration.cs b/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Effects/ChromaticAberration.cs index 953b273..ee93909 100644 --- a/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Effects/ChromaticAberration.cs +++ b/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Effects/ChromaticAberration.cs @@ -77,7 +77,12 @@ namespace UnityEngine.Rendering.PostProcessing } var sheet = context.uberSheet; - bool fastMode = settings.fastMode || SystemInfo.graphicsDeviceType == GraphicsDeviceType.OpenGLES2; + bool fastMode = settings.fastMode +#if !UNITY_2023_1_OR_NEWER + || SystemInfo.graphicsDeviceType == GraphicsDeviceType.OpenGLES2; +#else + ; +#endif sheet.EnableKeyword(fastMode ? "CHROMATIC_ABERRATION_LOW" diff --git a/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Effects/MotionBlur.cs b/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Effects/MotionBlur.cs index 64b02e2..46cf8e8 100644 --- a/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Effects/MotionBlur.cs +++ b/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Effects/MotionBlur.cs @@ -69,7 +69,7 @@ namespace UnityEngine.Rendering.PostProcessing #if UNITY_2019_1_OR_NEWER cmd.GetTemporaryRT(nameID, rtDesc, FilterMode.Point); #elif UNITY_2017_3_OR_NEWER - cmd.GetTemporaryRT(nameID, rtDesc.width, rtDesc.height, rtDesc.depthBufferBits, FilterMode.Point, rtDesc.colorFormat, RenderTextureReadWrite.Linear, rtDesc.msaaSamples, rtDesc.enableRandomWrite, rtDesc.memoryless, context.camera.allowDynamicResolution); + cmd.GetTemporaryRT(nameID, rtDesc.width, rtDesc.height, rtDesc.depthBufferBits, FilterMode.Point, rtDesc.colorFormat, RenderTextureReadWrite.Linear, rtDesc.msaaSamples, rtDesc.enableRandomWrite, rtDesc.memoryless, RuntimeUtilities.IsDynamicResolutionEnabled(context.camera)); #else cmd.GetTemporaryRT(nameID, rtDesc.width, rtDesc.height, rtDesc.depthBufferBits, FilterMode.Point, rtDesc.colorFormat, RenderTextureReadWrite.Linear, rtDesc.msaaSamples, rtDesc.enableRandomWrite, rtDesc.memoryless); #endif @@ -130,7 +130,7 @@ namespace UnityEngine.Rendering.PostProcessing cmd.ReleaseTemporaryRT(tile4); // Pass 5 - Fourth TileMax filter (reduce to tileSize) - var tileMaxOffs = Vector2.one * (tileSize / 8f - 1f) * -0.5f; + var tileMaxOffs = (tileSize / 8f - 1f) * -0.5f * Vector2.one; sheet.properties.SetVector(ShaderIDs.TileMaxOffs, tileMaxOffs); sheet.properties.SetFloat(ShaderIDs.TileMaxLoop, (int)(tileSize / 8f)); diff --git a/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Effects/MultiScaleVO.cs b/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Effects/MultiScaleVO.cs index 986d3da..a1af379 100644 --- a/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Effects/MultiScaleVO.cs +++ b/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Effects/MultiScaleVO.cs @@ -211,51 +211,52 @@ namespace UnityEngine.Rendering.PostProcessing void PushAllocCommands(CommandBuffer cmd, bool isMSAA, Camera camera) { + bool dynamicResolutionEnabled = RuntimeUtilities.IsDynamicResolutionEnabled(camera); if (isMSAA) { - Alloc(cmd, ShaderIDs.LinearDepth, MipLevel.Original, RenderTextureFormat.RGHalf, true, camera.allowDynamicResolution); - - Alloc(cmd, ShaderIDs.LowDepth1, MipLevel.L1, RenderTextureFormat.RGFloat, true, camera.allowDynamicResolution); - Alloc(cmd, ShaderIDs.LowDepth2, MipLevel.L2, RenderTextureFormat.RGFloat, true, camera.allowDynamicResolution); - Alloc(cmd, ShaderIDs.LowDepth3, MipLevel.L3, RenderTextureFormat.RGFloat, true, camera.allowDynamicResolution); - Alloc(cmd, ShaderIDs.LowDepth4, MipLevel.L4, RenderTextureFormat.RGFloat, true, camera.allowDynamicResolution); - - AllocArray(cmd, ShaderIDs.TiledDepth1, MipLevel.L3, RenderTextureFormat.RGHalf, true, camera.allowDynamicResolution); - AllocArray(cmd, ShaderIDs.TiledDepth2, MipLevel.L4, RenderTextureFormat.RGHalf, true, camera.allowDynamicResolution); - AllocArray(cmd, ShaderIDs.TiledDepth3, MipLevel.L5, RenderTextureFormat.RGHalf, true, camera.allowDynamicResolution); - AllocArray(cmd, ShaderIDs.TiledDepth4, MipLevel.L6, RenderTextureFormat.RGHalf, true, camera.allowDynamicResolution); - - Alloc(cmd, ShaderIDs.Occlusion1, MipLevel.L1, RenderTextureFormat.RG16, true, camera.allowDynamicResolution); - Alloc(cmd, ShaderIDs.Occlusion2, MipLevel.L2, RenderTextureFormat.RG16, true, camera.allowDynamicResolution); - Alloc(cmd, ShaderIDs.Occlusion3, MipLevel.L3, RenderTextureFormat.RG16, true, camera.allowDynamicResolution); - Alloc(cmd, ShaderIDs.Occlusion4, MipLevel.L4, RenderTextureFormat.RG16, true, camera.allowDynamicResolution); - - Alloc(cmd, ShaderIDs.Combined1, MipLevel.L1, RenderTextureFormat.RG16, true, camera.allowDynamicResolution); - Alloc(cmd, ShaderIDs.Combined2, MipLevel.L2, RenderTextureFormat.RG16, true, camera.allowDynamicResolution); - Alloc(cmd, ShaderIDs.Combined3, MipLevel.L3, RenderTextureFormat.RG16, true, camera.allowDynamicResolution); + Alloc(cmd, ShaderIDs.LinearDepth, MipLevel.Original, RenderTextureFormat.RGHalf, true, dynamicResolutionEnabled); + + Alloc(cmd, ShaderIDs.LowDepth1, MipLevel.L1, RenderTextureFormat.RGFloat, true, dynamicResolutionEnabled); + Alloc(cmd, ShaderIDs.LowDepth2, MipLevel.L2, RenderTextureFormat.RGFloat, true, dynamicResolutionEnabled); + Alloc(cmd, ShaderIDs.LowDepth3, MipLevel.L3, RenderTextureFormat.RGFloat, true, dynamicResolutionEnabled); + Alloc(cmd, ShaderIDs.LowDepth4, MipLevel.L4, RenderTextureFormat.RGFloat, true, dynamicResolutionEnabled); + + AllocArray(cmd, ShaderIDs.TiledDepth1, MipLevel.L3, RenderTextureFormat.RGHalf, true, dynamicResolutionEnabled); + AllocArray(cmd, ShaderIDs.TiledDepth2, MipLevel.L4, RenderTextureFormat.RGHalf, true, dynamicResolutionEnabled); + AllocArray(cmd, ShaderIDs.TiledDepth3, MipLevel.L5, RenderTextureFormat.RGHalf, true, dynamicResolutionEnabled); + AllocArray(cmd, ShaderIDs.TiledDepth4, MipLevel.L6, RenderTextureFormat.RGHalf, true, dynamicResolutionEnabled); + + Alloc(cmd, ShaderIDs.Occlusion1, MipLevel.L1, RenderTextureFormat.RG16, true, dynamicResolutionEnabled); + Alloc(cmd, ShaderIDs.Occlusion2, MipLevel.L2, RenderTextureFormat.RG16, true, dynamicResolutionEnabled); + Alloc(cmd, ShaderIDs.Occlusion3, MipLevel.L3, RenderTextureFormat.RG16, true, dynamicResolutionEnabled); + Alloc(cmd, ShaderIDs.Occlusion4, MipLevel.L4, RenderTextureFormat.RG16, true, dynamicResolutionEnabled); + + Alloc(cmd, ShaderIDs.Combined1, MipLevel.L1, RenderTextureFormat.RG16, true, dynamicResolutionEnabled); + Alloc(cmd, ShaderIDs.Combined2, MipLevel.L2, RenderTextureFormat.RG16, true, dynamicResolutionEnabled); + Alloc(cmd, ShaderIDs.Combined3, MipLevel.L3, RenderTextureFormat.RG16, true, dynamicResolutionEnabled); } else { - Alloc(cmd, ShaderIDs.LinearDepth, MipLevel.Original, RenderTextureFormat.RHalf, true, camera.allowDynamicResolution); - - Alloc(cmd, ShaderIDs.LowDepth1, MipLevel.L1, RenderTextureFormat.RFloat, true, camera.allowDynamicResolution); - Alloc(cmd, ShaderIDs.LowDepth2, MipLevel.L2, RenderTextureFormat.RFloat, true, camera.allowDynamicResolution); - Alloc(cmd, ShaderIDs.LowDepth3, MipLevel.L3, RenderTextureFormat.RFloat, true, camera.allowDynamicResolution); - Alloc(cmd, ShaderIDs.LowDepth4, MipLevel.L4, RenderTextureFormat.RFloat, true, camera.allowDynamicResolution); - - AllocArray(cmd, ShaderIDs.TiledDepth1, MipLevel.L3, RenderTextureFormat.RHalf, true, camera.allowDynamicResolution); - AllocArray(cmd, ShaderIDs.TiledDepth2, MipLevel.L4, RenderTextureFormat.RHalf, true, camera.allowDynamicResolution); - AllocArray(cmd, ShaderIDs.TiledDepth3, MipLevel.L5, RenderTextureFormat.RHalf, true, camera.allowDynamicResolution); - AllocArray(cmd, ShaderIDs.TiledDepth4, MipLevel.L6, RenderTextureFormat.RHalf, true, camera.allowDynamicResolution); - - Alloc(cmd, ShaderIDs.Occlusion1, MipLevel.L1, RenderTextureFormat.R8, true, camera.allowDynamicResolution); - Alloc(cmd, ShaderIDs.Occlusion2, MipLevel.L2, RenderTextureFormat.R8, true, camera.allowDynamicResolution); - Alloc(cmd, ShaderIDs.Occlusion3, MipLevel.L3, RenderTextureFormat.R8, true, camera.allowDynamicResolution); - Alloc(cmd, ShaderIDs.Occlusion4, MipLevel.L4, RenderTextureFormat.R8, true, camera.allowDynamicResolution); - - Alloc(cmd, ShaderIDs.Combined1, MipLevel.L1, RenderTextureFormat.R8, true, camera.allowDynamicResolution); - Alloc(cmd, ShaderIDs.Combined2, MipLevel.L2, RenderTextureFormat.R8, true, camera.allowDynamicResolution); - Alloc(cmd, ShaderIDs.Combined3, MipLevel.L3, RenderTextureFormat.R8, true, camera.allowDynamicResolution); + Alloc(cmd, ShaderIDs.LinearDepth, MipLevel.Original, RenderTextureFormat.RHalf, true, dynamicResolutionEnabled); + + Alloc(cmd, ShaderIDs.LowDepth1, MipLevel.L1, RenderTextureFormat.RFloat, true, dynamicResolutionEnabled); + Alloc(cmd, ShaderIDs.LowDepth2, MipLevel.L2, RenderTextureFormat.RFloat, true, dynamicResolutionEnabled); + Alloc(cmd, ShaderIDs.LowDepth3, MipLevel.L3, RenderTextureFormat.RFloat, true, dynamicResolutionEnabled); + Alloc(cmd, ShaderIDs.LowDepth4, MipLevel.L4, RenderTextureFormat.RFloat, true, dynamicResolutionEnabled); + + AllocArray(cmd, ShaderIDs.TiledDepth1, MipLevel.L3, RenderTextureFormat.RHalf, true, dynamicResolutionEnabled); + AllocArray(cmd, ShaderIDs.TiledDepth2, MipLevel.L4, RenderTextureFormat.RHalf, true, dynamicResolutionEnabled); + AllocArray(cmd, ShaderIDs.TiledDepth3, MipLevel.L5, RenderTextureFormat.RHalf, true, dynamicResolutionEnabled); + AllocArray(cmd, ShaderIDs.TiledDepth4, MipLevel.L6, RenderTextureFormat.RHalf, true, dynamicResolutionEnabled); + + Alloc(cmd, ShaderIDs.Occlusion1, MipLevel.L1, RenderTextureFormat.R8, true, dynamicResolutionEnabled); + Alloc(cmd, ShaderIDs.Occlusion2, MipLevel.L2, RenderTextureFormat.R8, true, dynamicResolutionEnabled); + Alloc(cmd, ShaderIDs.Occlusion3, MipLevel.L3, RenderTextureFormat.R8, true, dynamicResolutionEnabled); + Alloc(cmd, ShaderIDs.Occlusion4, MipLevel.L4, RenderTextureFormat.R8, true, dynamicResolutionEnabled); + + Alloc(cmd, ShaderIDs.Combined1, MipLevel.L1, RenderTextureFormat.R8, true, dynamicResolutionEnabled); + Alloc(cmd, ShaderIDs.Combined2, MipLevel.L2, RenderTextureFormat.R8, true, dynamicResolutionEnabled); + Alloc(cmd, ShaderIDs.Combined3, MipLevel.L3, RenderTextureFormat.R8, true, dynamicResolutionEnabled); } } @@ -274,7 +275,7 @@ namespace UnityEngine.Rendering.PostProcessing // buffer (it's only available in some specific situations). if (!RuntimeUtilities.IsResolvedDepthAvailable(camera)) { - Alloc(cmd, ShaderIDs.DepthCopy, MipLevel.Original, RenderTextureFormat.RFloat, false, camera.allowDynamicResolution); + Alloc(cmd, ShaderIDs.DepthCopy, MipLevel.Original, RenderTextureFormat.RFloat, false, RuntimeUtilities.IsDynamicResolutionEnabled(camera)); depthMapId = new RenderTargetIdentifier(ShaderIDs.DepthCopy); cmd.BlitFullscreenTriangle(BuiltinRenderTextureType.None, depthMapId, m_PropertySheet, (int)Pass.DepthCopy); needDepthMapRelease = true; @@ -388,7 +389,7 @@ namespace UnityEngine.Rendering.PostProcessing cmd.SetComputeFloatParams(cs, "gInvThicknessTable", m_InvThicknessTable); cmd.SetComputeFloatParams(cs, "gSampleWeightTable", m_SampleWeightTable); cmd.SetComputeVectorParam(cs, "gInvSliceDimension", new Vector2(1f / sourceSize.x, 1f / sourceSize.y)); - cmd.SetComputeVectorParam(cs, "AdditionalParams", new Vector2(-1f / m_Settings.thicknessModifier.value, m_Settings.intensity.value)); + cmd.SetComputeVectorParam(cs, "AdditionalParams", new Vector3(-1f / m_Settings.thicknessModifier.value, m_Settings.intensity.value, m_Settings.zBias.value)); cmd.SetComputeTextureParam(cs, kernel, "DepthTex", source); cmd.SetComputeTextureParam(cs, kernel, "Occlusion", destination); @@ -484,7 +485,8 @@ namespace UnityEngine.Rendering.PostProcessing { bool AOUpdateNeeded = m_AmbientOnlyAO == null || !m_AmbientOnlyAO.IsCreated() || m_AmbientOnlyAO.width != context.width || m_AmbientOnlyAO.height != context.height; #if UNITY_2017_3_OR_NEWER - AOUpdateNeeded = AOUpdateNeeded || m_AmbientOnlyAO.useDynamicScale != context.camera.allowDynamicResolution; + bool dynamicResolutionEnabled = RuntimeUtilities.IsDynamicResolutionEnabled(context.camera); + AOUpdateNeeded = AOUpdateNeeded || m_AmbientOnlyAO.useDynamicScale != dynamicResolutionEnabled; #endif if (AOUpdateNeeded) { @@ -496,7 +498,7 @@ namespace UnityEngine.Rendering.PostProcessing filterMode = FilterMode.Point, enableRandomWrite = true, #if UNITY_2017_3_OR_NEWER - useDynamicScale = context.camera.allowDynamicResolution + useDynamicScale = dynamicResolutionEnabled #endif }; m_AmbientOnlyAO.Create(); diff --git a/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Effects/SubpixelMorphologicalAntialiasing.cs b/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Effects/SubpixelMorphologicalAntialiasing.cs index c3b409e..bf29cec 100644 --- a/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Effects/SubpixelMorphologicalAntialiasing.cs +++ b/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Effects/SubpixelMorphologicalAntialiasing.cs @@ -62,8 +62,9 @@ namespace UnityEngine.Rendering.PostProcessing cmd.BeginSample("SubpixelMorphologicalAntialiasing"); #if UNITY_2017_3_OR_NEWER - cmd.GetTemporaryRT(ShaderIDs.SMAA_Flip, context.width, context.height, 0, FilterMode.Bilinear, context.sourceFormat, RenderTextureReadWrite.Linear, 1, false, RenderTextureMemoryless.None, context.camera.allowDynamicResolution); - cmd.GetTemporaryRT(ShaderIDs.SMAA_Flop, context.width, context.height, 0, FilterMode.Bilinear, context.sourceFormat, RenderTextureReadWrite.Linear, 1, false, RenderTextureMemoryless.None, context.camera.allowDynamicResolution); + bool dynamicResolutionEnabled = RuntimeUtilities.IsDynamicResolutionEnabled(context.camera); + cmd.GetTemporaryRT(ShaderIDs.SMAA_Flip, context.width, context.height, 0, FilterMode.Bilinear, context.sourceFormat, RenderTextureReadWrite.Linear, 1, false, RenderTextureMemoryless.None, dynamicResolutionEnabled); + cmd.GetTemporaryRT(ShaderIDs.SMAA_Flop, context.width, context.height, 0, FilterMode.Bilinear, context.sourceFormat, RenderTextureReadWrite.Linear, 1, false, RenderTextureMemoryless.None, dynamicResolutionEnabled); #else cmd.GetTemporaryRT(ShaderIDs.SMAA_Flip, context.width, context.height, 0, FilterMode.Bilinear, context.sourceFormat, RenderTextureReadWrite.Linear, 1, false); cmd.GetTemporaryRT(ShaderIDs.SMAA_Flop, context.width, context.height, 0, FilterMode.Bilinear, context.sourceFormat, RenderTextureReadWrite.Linear, 1, false); diff --git a/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Effects/TemporalAntialiasing.cs b/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Effects/TemporalAntialiasing.cs index cde9ad4..2b9b5bd 100644 --- a/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Effects/TemporalAntialiasing.cs +++ b/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Effects/TemporalAntialiasing.cs @@ -87,7 +87,11 @@ namespace UnityEngine.Rendering.PostProcessing #if !UNITY_2017_3_OR_NEWER && !RuntimeUtilities.isVREnabled #endif +#if !UNITY_2023_1_OR_NEWER && SystemInfo.graphicsDeviceType != GraphicsDeviceType.OpenGLES2; +#else + ; +#endif } internal DepthTextureMode GetCameraFlags() @@ -160,7 +164,7 @@ namespace UnityEngine.Rendering.PostProcessing // TODO: We'll probably need to isolate most of this for SRPs public void ConfigureStereoJitteredProjectionMatrices(PostProcessRenderContext context) { -#if UNITY_2017_3_OR_NEWER +#if UNITY_2017_3_OR_NEWER var camera = context.camera; jitter = GenerateRandomOffset(); jitter *= jitterSpread; diff --git a/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/PostProcessLayer.cs b/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/PostProcessLayer.cs index 95f9158..994bc63 100644 --- a/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/PostProcessLayer.cs +++ b/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/PostProcessLayer.cs @@ -257,7 +257,7 @@ namespace UnityEngine.Rendering.PostProcessing #if UNITY_2019_1_OR_NEWER bool DynamicResolutionAllowsFinalBlitToCameraTarget() { - return (!m_Camera.allowDynamicResolution || (ScalableBufferManager.heightScaleFactor == 1.0 && ScalableBufferManager.widthScaleFactor == 1.0)); + return (!RuntimeUtilities.IsDynamicResolutionEnabled(m_Camera) || (ScalableBufferManager.heightScaleFactor == 1.0 && ScalableBufferManager.widthScaleFactor == 1.0)); } #endif diff --git a/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/PostProcessRenderContext.cs b/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/PostProcessRenderContext.cs index c2eb064..4ca66ca 100644 --- a/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/PostProcessRenderContext.cs +++ b/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/PostProcessRenderContext.cs @@ -319,7 +319,7 @@ namespace UnityEngine.Rendering.PostProcessing modifiedDesc.shadowSamplingMode = m_sourceDescriptor.shadowSamplingMode; #if UNITY_2019_1_OR_NEWER - if (m_Camera.allowDynamicResolution) + if (RuntimeUtilities.IsDynamicResolutionEnabled(m_Camera)) modifiedDesc.useDynamicScale = true; #endif @@ -368,7 +368,7 @@ namespace UnityEngine.Rendering.PostProcessing #if UNITY_2019_1_OR_NEWER cmd.GetTemporaryRT(nameID, desc, filter); #elif UNITY_2017_3_OR_NEWER - cmd.GetTemporaryRT(nameID, desc.width, desc.height, desc.depthBufferBits, filter, desc.colorFormat, readWrite, desc.msaaSamples, desc.enableRandomWrite, desc.memoryless, m_Camera.allowDynamicResolution); + cmd.GetTemporaryRT(nameID, desc.width, desc.height, desc.depthBufferBits, filter, desc.colorFormat, readWrite, desc.msaaSamples, desc.enableRandomWrite, desc.memoryless, RuntimeUtilities.IsDynamicResolutionEnabled(m_Camera)); #else cmd.GetTemporaryRT(nameID, desc.width, desc.height, desc.depthBufferBits, filter, desc.colorFormat, readWrite, desc.msaaSamples, desc.enableRandomWrite, desc.memoryless); #endif diff --git a/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/PostProcessVolume.cs b/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/PostProcessVolume.cs index b1d78e4..fa78775 100644 --- a/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/PostProcessVolume.cs +++ b/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/PostProcessVolume.cs @@ -248,7 +248,7 @@ namespace UnityEngine.Rendering.PostProcessing { var c = (BoxCollider)collider; Gizmos.DrawCube(c.center, c.size); - Gizmos.DrawWireCube(c.center, c.size + invScale * blendDistance * 4f); + Gizmos.DrawWireCube(c.center, c.size + 4f * blendDistance * invScale); } else if (type == typeof(SphereCollider)) { @@ -266,7 +266,7 @@ namespace UnityEngine.Rendering.PostProcessing // Mesh pivot should be centered or this won't work Gizmos.DrawMesh(c.sharedMesh); - Gizmos.DrawWireMesh(c.sharedMesh, Vector3.zero, Quaternion.identity, Vector3.one + invScale * blendDistance * 4f); + Gizmos.DrawWireMesh(c.sharedMesh, Vector3.zero, Quaternion.identity, Vector3.one + 4f * blendDistance * invScale); } // Nothing for capsule (DrawCapsule isn't exposed in Gizmo), terrain, wheel and diff --git a/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Utils/RuntimeUtilities.cs b/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Utils/RuntimeUtilities.cs index b03d84c..13497b8 100644 --- a/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Utils/RuntimeUtilities.cs +++ b/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Utils/RuntimeUtilities.cs @@ -1009,7 +1009,17 @@ namespace UnityEngine.Rendering.PostProcessing && layer.antialiasingMode == PostProcessLayer.Antialiasing.TemporalAntialiasing && layer.temporalAntialiasing.IsSupported(); } - +#if UNITY_2017_3_OR_NEWER + /// + /// Checks if dynamic resolution is enabled on a given camera. + /// + /// The camera to check + /// true if dynamic resolution is enabled, false otherwise + public static bool IsDynamicResolutionEnabled(Camera camera) + { + return camera.allowDynamicResolution || (camera.targetTexture != null && camera.targetTexture.useDynamicScale); + } +#endif /// /// Gets all scene objects in the hierarchy, including inactive objects. This method is slow /// on large scenes and should be used with extreme caution. @@ -1025,9 +1035,8 @@ namespace UnityEngine.Rendering.PostProcessing foreach (var root in roots) { queue.Enqueue(root.transform); - var comp = root.GetComponent(); - - if (comp != null) + + if (root.TryGetComponent(out var comp)) yield return comp; } @@ -1036,9 +1045,8 @@ namespace UnityEngine.Rendering.PostProcessing foreach (Transform child in queue.Dequeue()) { queue.Enqueue(child); - var comp = child.GetComponent(); - - if (comp != null) + + if (child.TryGetComponent(out var comp)) yield return comp; } } diff --git a/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Utils/TextureLerper.cs b/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Utils/TextureLerper.cs index 3294897..bbb7ab6 100644 --- a/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Utils/TextureLerper.cs +++ b/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Utils/TextureLerper.cs @@ -52,8 +52,7 @@ namespace UnityEngine.Rendering.PostProcessing // frame so keep them in the same order if (m_Actives.Count > 0) { - foreach (var rt in m_Actives) - m_Recycled.Add(rt); + m_Recycled.AddRange(m_Actives); m_Actives.Clear(); } diff --git a/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/Builtins/MultiScaleVORender.compute b/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/Builtins/MultiScaleVORender.compute index 486d7e3..f4cab26 100644 --- a/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/Builtins/MultiScaleVORender.compute +++ b/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/Builtins/MultiScaleVORender.compute @@ -80,11 +80,12 @@ CBUFFER_START(CB1) float4 gInvThicknessTable[3]; float4 gSampleWeightTable[3]; float4 gInvSliceDimension; - float2 AdditionalParams; + float3 AdditionalParams; CBUFFER_END #define gRejectFadeoff AdditionalParams.x #define gIntensity AdditionalParams.y +#define zBias AdditionalParams.z #ifdef MSAA float2 TestSamplePair(float frontDepth, float2 invRange, uint base, int offset) @@ -249,10 +250,10 @@ void MAIN(uint3 Gid : SV_GroupID, uint GI : SV_GroupIndex, uint3 GTid : SV_Group #endif #ifdef MSAA - const float2 invThisDepth = float2(1.0 / DepthSamples[thisIdx].x, 1.0 / DepthSamples[thisIdx].y); + const float2 invThisDepth = float2(1.0 / (DepthSamples[thisIdx].x - zBias), 1.0 / (DepthSamples[thisIdx].y - zBias)); float2 ao = 0.0; #else - const float invThisDepth = 1.0 / DepthSamples[thisIdx]; + const float invThisDepth = 1.0 / (DepthSamples[thisIdx] - zBias); float ao = 0.0; #endif diff --git a/Packages/com.unity.postprocessing@3.2.2/package.json b/Packages/com.unity.postprocessing@3.2.2/package.json index 9a8e6c3..3cf99fd 100644 --- a/Packages/com.unity.postprocessing@3.2.2/package.json +++ b/Packages/com.unity.postprocessing@3.2.2/package.json @@ -1,22 +1,11 @@ { - "name": "com.unity.postprocessing", - "version": "3.2.2", - "displayName": "Post Processing", - "unity": "2019.4", - "unityRelease": "19f1", - "description": "The post-processing stack (v2) comes with a collection of effects and image filters you can apply to your cameras to improve the visuals of your games.", - "dependencies": { - "com.unity.modules.physics": "1.0.0" - }, - "upm": { - "changelog": "### Fixed\n- Fixed FXAA artefact when trying to preserve alpha channel output." - }, - "upmCi": { - "footprint": "7e33f4ab7a0086cc729e37566f9020d7d44a5fd1" - }, - "repository": { - "url": "https://github.com/Unity-Technologies/Graphics.git", - "type": "git", - "revision": "815ce78463c7d3006fa97cd6e8898d91cb9c3ebf" - } + "name": "com.unity.postprocessing", + "version": "3.3.0", + "displayName": "Post Processing", + "unity": "2019.4", + "unityRelease": "19f1", + "description": "The post-processing stack (v2) comes with a collection of effects and image filters you can apply to your cameras to improve the visuals of your games.", + "dependencies": { + "com.unity.modules.physics": "1.0.0" + } }