fix menu UI cassé a cause Shader + fineTouch

This commit is contained in:
Jean Lamarre 2022-10-29 03:54:34 -04:00
parent f4cad8a5c5
commit d4eb08d7ed
4 changed files with 46 additions and 24 deletions

View File

@ -117,18 +117,21 @@ Material:
- _Surface: 0 - _Surface: 0
- _WorkflowMode: 1 - _WorkflowMode: 1
- _ZWrite: 1 - _ZWrite: 1
- u_bend: 2.21 - u_bend: 3.15
- u_blue_offset_y: 0.00403
- u_green_offset_y: 0
- u_noise_amount: 0.012 - u_noise_amount: 0.012
- u_noise_size: 337 - u_noise_size: 337
- u_scanlin_transparence1: 0.38 - u_red_offset_y: -0.00409
- u_scanlin_transparence1: 0.194
- u_scanlin_transparence2: 0.098 - u_scanlin_transparence2: 0.098
- u_scanline_amount: 0.019 - u_scanline_amount: 0.019
- u_scanline_size_1: 308 - u_scanline_size_1: 308
- u_scanline_size_2: 521 - u_scanline_size_2: 521
- u_scanline_speed_1: 94.13 - u_scanline_speed_1: 94.13
- u_scanline_speed_2: 14.83 - u_scanline_speed_2: 30
- u_time: 15.95 - u_time: 15.95
- u_vignette_edge_round: 7 - u_vignette_edge_round: 8.5
- u_vignette_size: 1.89 - u_vignette_size: 1.89
- u_vignette_smoothness: 0.56 - u_vignette_smoothness: 0.56
m_Colors: m_Colors:
@ -137,6 +140,9 @@ Material:
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1} - _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1} - _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
- u_blue_offset: {r: 0, g: 0.002, b: 0, a: 0} - u_blue_offset: {r: 0, g: 0.002, b: 0, a: 0}
- u_blue_offset_y: {r: 0.25, g: 0.5, b: 0.5, a: 0}
- u_green_offset: {r: 0, g: 0, b: 0, a: 0} - u_green_offset: {r: 0, g: 0, b: 0, a: 0}
- u_red_offset: {r: 0, g: 0.002, b: 0, a: 0} - u_green_offset_y: {r: 0.25, g: 0.5, b: 0.5, a: 0}
- u_red_offset: {r: 0, g: -0.002, b: 0, a: 0}
- u_red_offset_y: {r: 0.25, g: 0.5, b: 0.5, a: 0}
m_BuildTextureStacks: [] m_BuildTextureStacks: []

View File

@ -237,9 +237,9 @@ MonoBehaviour:
m_Transition: 1 m_Transition: 1
m_Colors: m_Colors:
m_NormalColor: {r: 1, g: 1, b: 1, a: 1} m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} m_HighlightedColor: {r: 0.5377358, g: 0.5377358, b: 0.5377358, a: 1}
m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} m_PressedColor: {r: 0.5754717, g: 0.3441972, b: 0.3441972, a: 1}
m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} m_SelectedColor: {r: 0.5283019, g: 0.5283019, b: 0.5283019, a: 1}
m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608}
m_ColorMultiplier: 1 m_ColorMultiplier: 1
m_FadeDuration: 0.1 m_FadeDuration: 0.1

View File

@ -380,7 +380,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 76c392e42b5098c458856cdf6ecaaaa1, type: 3} m_Script: {fileID: 11500000, guid: 76c392e42b5098c458856cdf6ecaaaa1, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
m_FirstSelected: {fileID: 0} m_FirstSelected: {fileID: 1335784365}
m_sendNavigationEvents: 1 m_sendNavigationEvents: 1
m_DragThreshold: 10 m_DragThreshold: 10
--- !u!4 &185700930 --- !u!4 &185700930
@ -698,7 +698,7 @@ MonoBehaviour:
m_BlockingObjects: 0 m_BlockingObjects: 0
m_BlockingMask: m_BlockingMask:
serializedVersion: 2 serializedVersion: 2
m_Bits: 4294967295 m_Bits: 255
--- !u!114 &753457326 --- !u!114 &753457326
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -918,7 +918,7 @@ PrefabInstance:
- target: {fileID: 5917528464183523172, guid: 0bdc45a9254ade843b7ba60aaab62301, - target: {fileID: 5917528464183523172, guid: 0bdc45a9254ade843b7ba60aaab62301,
type: 3} type: 3}
propertyPath: m_fontSize propertyPath: m_fontSize
value: 11.85 value: 10.05
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 5917528464644539588, guid: 0bdc45a9254ade843b7ba60aaab62301, - target: {fileID: 5917528464644539588, guid: 0bdc45a9254ade843b7ba60aaab62301,
type: 3} type: 3}
@ -1073,7 +1073,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 1, y: 1} m_AnchorMin: {x: 1, y: 1}
m_AnchorMax: {x: 1, y: 1} m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: -77.453, y: -53.482} m_AnchoredPosition: {x: -77.453, y: -53.481995}
m_SizeDelta: {x: 154.907, y: 106.963} m_SizeDelta: {x: 154.907, y: 106.963}
m_Pivot: {x: 0.5, y: 0.5} m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1281004662 --- !u!114 &1281004662
@ -1173,6 +1173,12 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1281004660} m_GameObject: {fileID: 1281004660}
m_CullTransparentMesh: 1 m_CullTransparentMesh: 1
--- !u!1 &1335784365 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 5917528464644539588, guid: 0bdc45a9254ade843b7ba60aaab62301,
type: 3}
m_PrefabInstance: {fileID: 5917528464004223745}
m_PrefabAsset: {fileID: 0}
--- !u!1 &1451380979 --- !u!1 &1451380979
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -1293,7 +1299,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0} m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1} m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 82.547, y: -53.407} m_AnchoredPosition: {x: 82.547, y: -53.407013}
m_SizeDelta: {x: -165.09, y: -106.81} m_SizeDelta: {x: -165.09, y: -106.81}
m_Pivot: {x: 0.5, y: 0.5} m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1703051055 --- !u!114 &1703051055

View File

@ -17,9 +17,9 @@
u_vignette_edge_round("Vignette Edge Round",range(0, 100)) = 0.5 u_vignette_edge_round("Vignette Edge Round",range(0, 100)) = 0.5
u_noise_size("Noise Size",range(0, 500 )) = 0.5 u_noise_size("Noise Size",range(0, 500 )) = 0.5
u_noise_amount("Noise Amount",range(0, 0.3)) = 0.5 u_noise_amount("Noise Amount",range(0, 0.3)) = 0.5
[ShowAsVector2] u_red_offset("Red Offset",Vector) = (.25, .5, .5, 0) u_red_offset_y("Red Offset",range(-0.01,0.01)) = 0
[ShowAsVector2] u_green_offset("Green Offset",Vector) = (.25, .5, .5, 0) u_green_offset_y("Green Offset",range(-0.01,0.01)) = 0
[ShowAsVector2] u_blue_offset("Blue Offset",Vector) = (.25, .5, .5, 0) u_blue_offset_y("Blue Offset",range(-0.01,0.01)) = 0
} }
// The Unity Editor uses the class ExampleCustomEditor to configure the Inspector for this shader asset // The Unity Editor uses the class ExampleCustomEditor to configure the Inspector for this shader asset
@ -74,18 +74,28 @@
uniform float u_vignette_edge_round; uniform float u_vignette_edge_round;
uniform float u_noise_size; uniform float u_noise_size;
uniform float u_noise_amount; uniform float u_noise_amount;
uniform half2 u_red_offset; uniform float u_red_offset_y;
uniform half2 u_green_offset; uniform float u_green_offset_y;
uniform half2 u_blue_offset; uniform float u_blue_offset_y;
half2 u_color_offset(float offset)
{
return half2(0,offset);
}
half2 crt_coords(half2 uv, float bend) half2 crt_coords(half2 uv, float bend)
{ {
// By subtracting 0.5, we go from 0 to 1 into -0.5 to 0.5
uv -= 0.5; uv -= 0.5;
// Multiplying by puts us in -1 to 1 space.
uv *= 2.; uv *= 2.;
// Curves lines
uv.x *= 1. + pow(abs(uv.y) / bend, 2.); uv.x *= 1. + pow(abs(uv.y) / bend, 2.);
uv.y *= 1. + pow(abs(uv.x) / bend, 2.); uv.y *= 1. + pow(abs(uv.x) / bend, 2.);
uv /= 2.5; //return coordinates to 0 to 1 space.
uv /= 2;
return uv + 0.5; return uv + 0.5;
} }
@ -129,9 +139,9 @@
u_time = _Time; u_time = _Time;
half2 crt_uv = crt_coords(i.uv, u_bend); half2 crt_uv = crt_coords(i.uv, u_bend);
fixed4 col; fixed4 col;
col.r = tex2D(_MainTex, crt_uv + u_red_offset).r; col.r = tex2D(_MainTex, crt_uv + u_color_offset(u_red_offset_y)).r;
col.g = tex2D(_MainTex, crt_uv + u_green_offset).g; col.g = tex2D(_MainTex, crt_uv + u_color_offset(u_green_offset_y)).g;
col.b = tex2D(_MainTex, crt_uv + u_blue_offset).b; col.b = tex2D(_MainTex, crt_uv + u_color_offset(u_blue_offset_y)).b;
col.a = tex2D(_MainTex, crt_uv).a; col.a = tex2D(_MainTex, crt_uv).a;
float s1 = scanline(i.uv, u_scanline_size_1, u_scanline_speed_1, u_scanlin_transparence1); float s1 = scanline(i.uv, u_scanline_size_1, u_scanline_speed_1, u_scanlin_transparence1);