|
71 | 71 |
|
72 | 72 | float _GamaCorrection; |
73 | 73 |
|
| 74 | + int _Invert; |
| 75 | + |
74 | 76 | #include "Photoshop.cginc" |
75 | 77 |
|
76 | 78 | // vertex-to-fragment interpolation data |
|
124 | 126 | sample2Mask *= 1.0 / ( _HueWeight2 + _SatWeight2 + _LumWeight2 ); |
125 | 127 | sample2Mask = smoothstep( _MaskLow2, _MaskHigh2, sample2Mask ); |
126 | 128 | } |
| 129 | + |
127 | 130 |
|
128 | 131 | float finalSmoothness = _BaseSmoothness; |
129 | 132 | finalSmoothness = lerp( finalSmoothness, _Sample2Smoothness, sample2Mask ); |
|
132 | 135 |
|
133 | 136 | finalSmoothness *= clamp( overlayGrey * _BlurOverlay + 1.0, 0.0, 10.0 ); |
134 | 137 |
|
135 | | - finalSmoothness = saturate( ( finalSmoothness - 0.5 ) * _FinalContrast + 0.5 + _FinalBias ); |
136 | | - |
137 | | - finalSmoothness = saturate( finalSmoothness ); |
| 138 | + if (_Invert) { |
| 139 | + finalSmoothness = saturate((finalSmoothness - 0.5) * ((_FinalContrast + 0.5) + _FinalBias) *-1); |
| 140 | + } |
| 141 | + else { |
| 142 | + finalSmoothness = saturate((finalSmoothness - 0.5) * _FinalContrast + 0.5 + _FinalBias); |
| 143 | + } |
| 144 | + finalSmoothness = saturate( finalSmoothness ); |
138 | 145 |
|
139 | 146 | if( _IsolateSample1 == 1 ){ |
140 | 147 | finalSmoothness = sample1Mask; |
|
143 | 150 | if( _IsolateSample2 == 1 ){ |
144 | 151 | finalSmoothness = sample2Mask; |
145 | 152 | } |
| 153 | + float3 finalColor; |
146 | 154 |
|
147 | | - float3 finalColor = lerp( mainTex.xyz, finalSmoothness.xxx, smoothstep( _Slider - 0.01, _Slider + 0.01, UV.x ) ); |
| 155 | + finalColor = lerp(mainTex.xyz, finalSmoothness.xxx, smoothstep(_Slider - 0.01, _Slider + 0.01, UV.x)); |
| 156 | + |
148 | 157 |
|
149 | | - return float4( finalColor, 1 ); |
| 158 | + return float4( finalColor , 1 ); |
150 | 159 | } |
151 | 160 |
|
152 | 161 | ENDCG |
|
0 commit comments