Skip to content

Commit d156a9d

Browse files
committed
Changed navigation method
* Fixed bug with highlighted buttons after clicking
1 parent 932dce9 commit d156a9d

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

Assets/MainScene.unity

3.61 KB
Binary file not shown.

Assets/Shaders/Smoothness_Preview.shader

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@
7171

7272
float _GamaCorrection;
7373

74+
int _Invert;
75+
7476
#include "Photoshop.cginc"
7577

7678
// vertex-to-fragment interpolation data
@@ -124,6 +126,7 @@
124126
sample2Mask *= 1.0 / ( _HueWeight2 + _SatWeight2 + _LumWeight2 );
125127
sample2Mask = smoothstep( _MaskLow2, _MaskHigh2, sample2Mask );
126128
}
129+
127130

128131
float finalSmoothness = _BaseSmoothness;
129132
finalSmoothness = lerp( finalSmoothness, _Sample2Smoothness, sample2Mask );
@@ -132,9 +135,13 @@
132135

133136
finalSmoothness *= clamp( overlayGrey * _BlurOverlay + 1.0, 0.0, 10.0 );
134137

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 );
138145

139146
if( _IsolateSample1 == 1 ){
140147
finalSmoothness = sample1Mask;
@@ -143,10 +150,12 @@
143150
if( _IsolateSample2 == 1 ){
144151
finalSmoothness = sample2Mask;
145152
}
153+
float3 finalColor;
146154

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+
148157

149-
return float4( finalColor, 1 );
158+
return float4( finalColor , 1 );
150159
}
151160

152161
ENDCG

0 commit comments

Comments
 (0)