@@ -19,14 +19,13 @@ Shader "Hidden/Post FX/Uber Shader"
1919 #pragma target 3.0
2020
2121 #pragma multi_compile __ UNITY_COLORSPACE_GAMMA
22- #pragma multi_compile __ EYE_ADAPTATION
2322 #pragma multi_compile __ CHROMATIC_ABERRATION
2423 #pragma multi_compile __ DEPTH_OF_FIELD DEPTH_OF_FIELD_COC_VIEW
2524 #pragma multi_compile __ BLOOM BLOOM_LENS_DIRT
2625 #pragma multi_compile __ COLOR_GRADING COLOR_GRADING_LOG_VIEW
2726 #pragma multi_compile __ USER_LUT
2827 #pragma multi_compile __ GRAIN
29- #pragma multi_compile __ VIGNETTE_CLASSIC VIGNETTE_ROUND VIGNETTE_MASKED
28+ #pragma multi_compile __ VIGNETTE_CLASSIC VIGNETTE_MASKED
3029 #pragma multi_compile __ DITHERING
3130
3231 #include "UnityCG.cginc"
@@ -67,7 +66,7 @@ Shader "Hidden/Post FX/Uber Shader"
6766 // Vignette
6867 half3 _Vignette_Color;
6968 half2 _Vignette_Center; // UV space
70- half3 _Vignette_Settings; // x: intensity, y: smoothness, z: roundness
69+ half4 _Vignette_Settings; // x: intensity, y: smoothness, z: roundness, w: rounded
7170 sampler2D _Vignette_Mask;
7271 half _Vignette_Opacity; // [0;1]
7372
@@ -101,14 +100,7 @@ Shader "Hidden/Post FX/Uber Shader"
101100 half4 FragUber (VaryingsFlipped i) : SV_Target
102101 {
103102 float2 uv = i.uv;
104- half autoExposure = 1.0 ;
105-
106- // Store the auto exposure value for later
107- #if EYE_ADAPTATION
108- {
109- autoExposure = tex2D (_AutoExposure, uv).r;
110- }
111- #endif
103+ half autoExposure = tex2D (_AutoExposure, uv).r;
112104
113105 half3 color = (0.0 ).xxx;
114106 #if DEPTH_OF_FIELD && CHROMATIC_ABERRATION
@@ -235,20 +227,12 @@ Shader "Hidden/Post FX/Uber Shader"
235227 #if VIGNETTE_CLASSIC
236228 {
237229 half2 d = abs (uv - _Vignette_Center) * _Vignette_Settings.x;
230+ d.x *= lerp (1.0 , _ScreenParams .x / _ScreenParams .y, _Vignette_Settings.w);
238231 d = pow (d, _Vignette_Settings.z); // Roundness
239232 half vfactor = pow (saturate (1.0 - dot (d, d)), _Vignette_Settings.y);
240233 color *= lerp (_Vignette_Color, (1.0 ).xxx, vfactor);
241234 }
242235
243- // Perfectly round vignette
244- #elif VIGNETTE_ROUND
245- {
246- half2 d = abs (uv - _Vignette_Center) * _Vignette_Settings.x;
247- d.x *= _ScreenParams .x / _ScreenParams .y;
248- half vfactor = pow (saturate (1.0 - dot (d, d)), _Vignette_Settings.y);
249- color *= lerp (_Vignette_Color, (1.0 ).xxx, vfactor);
250- }
251-
252236 // Masked vignette
253237 #elif VIGNETTE_MASKED
254238 {
0 commit comments