app.hypergames.hypersdk 1.0.2 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/check-sync.yml +0 -2
- package/CHANGELOG.md +9 -0
- package/dev-hypersdk/Assets/Editor/HyperSDKSyncTool.cs +0 -1
- package/package.json +1 -1
- package/upm-hypersdk/app.hypergames.hypersdk/Resources/DOTweenSettings.asset +0 -54
- package/upm-hypersdk/app.hypergames.hypersdk/Resources/TextMesh Pro/Fonts/LiberationSans - OFL.txt +0 -46
- package/upm-hypersdk/app.hypergames.hypersdk/Resources/TextMesh Pro/Fonts/LiberationSans.ttf +0 -0
- package/upm-hypersdk/app.hypergames.hypersdk/Resources/TextMesh Pro/Resources/Fonts & Materials/LiberationSans SDF - Drop Shadow.mat +0 -106
- package/upm-hypersdk/app.hypergames.hypersdk/Resources/TextMesh Pro/Resources/Fonts & Materials/LiberationSans SDF - Fallback.asset +0 -348
- package/upm-hypersdk/app.hypergames.hypersdk/Resources/TextMesh Pro/Resources/Fonts & Materials/LiberationSans SDF - Outline.mat +0 -104
- package/upm-hypersdk/app.hypergames.hypersdk/Resources/TextMesh Pro/Resources/Fonts & Materials/LiberationSans SDF.asset +0 -7821
- package/upm-hypersdk/app.hypergames.hypersdk/Resources/TextMesh Pro/Resources/LineBreaking Following Characters.txt +0 -1
- package/upm-hypersdk/app.hypergames.hypersdk/Resources/TextMesh Pro/Resources/LineBreaking Leading Characters.txt +0 -1
- package/upm-hypersdk/app.hypergames.hypersdk/Resources/TextMesh Pro/Resources/Sprite Assets/EmojiOne.asset +0 -659
- package/upm-hypersdk/app.hypergames.hypersdk/Resources/TextMesh Pro/Resources/Style Sheets/Default Style Sheet.asset +0 -81
- package/upm-hypersdk/app.hypergames.hypersdk/Resources/TextMesh Pro/Resources/TMP Settings.asset +0 -52
- package/upm-hypersdk/app.hypergames.hypersdk/Resources/TextMesh Pro/Shaders/SDFFunctions.hlsl +0 -178
- package/upm-hypersdk/app.hypergames.hypersdk/Resources/TextMesh Pro/Shaders/TMP_Bitmap-Custom-Atlas.shader +0 -145
- package/upm-hypersdk/app.hypergames.hypersdk/Resources/TextMesh Pro/Shaders/TMP_Bitmap-Mobile.shader +0 -155
- package/upm-hypersdk/app.hypergames.hypersdk/Resources/TextMesh Pro/Shaders/TMP_Bitmap.shader +0 -145
- package/upm-hypersdk/app.hypergames.hypersdk/Resources/TextMesh Pro/Shaders/TMP_SDF Overlay.shader +0 -326
- package/upm-hypersdk/app.hypergames.hypersdk/Resources/TextMesh Pro/Shaders/TMP_SDF SSD.shader +0 -321
- package/upm-hypersdk/app.hypergames.hypersdk/Resources/TextMesh Pro/Shaders/TMP_SDF-HDRP LIT.shadergraph +0 -12074
- package/upm-hypersdk/app.hypergames.hypersdk/Resources/TextMesh Pro/Shaders/TMP_SDF-HDRP UNLIT.shadergraph +0 -11759
- package/upm-hypersdk/app.hypergames.hypersdk/Resources/TextMesh Pro/Shaders/TMP_SDF-Mobile Masking.shader +0 -258
- package/upm-hypersdk/app.hypergames.hypersdk/Resources/TextMesh Pro/Shaders/TMP_SDF-Mobile Overlay.shader +0 -252
- package/upm-hypersdk/app.hypergames.hypersdk/Resources/TextMesh Pro/Shaders/TMP_SDF-Mobile SSD.shader +0 -106
- package/upm-hypersdk/app.hypergames.hypersdk/Resources/TextMesh Pro/Shaders/TMP_SDF-Mobile-2-Pass.shader +0 -389
- package/upm-hypersdk/app.hypergames.hypersdk/Resources/TextMesh Pro/Shaders/TMP_SDF-Mobile.shader +0 -250
- package/upm-hypersdk/app.hypergames.hypersdk/Resources/TextMesh Pro/Shaders/TMP_SDF-Surface-Mobile.shader +0 -139
- package/upm-hypersdk/app.hypergames.hypersdk/Resources/TextMesh Pro/Shaders/TMP_SDF-Surface.shader +0 -159
- package/upm-hypersdk/app.hypergames.hypersdk/Resources/TextMesh Pro/Shaders/TMP_SDF-URP Lit.shadergraph +0 -11932
- package/upm-hypersdk/app.hypergames.hypersdk/Resources/TextMesh Pro/Shaders/TMP_SDF-URP Unlit.shadergraph +0 -11629
- package/upm-hypersdk/app.hypergames.hypersdk/Resources/TextMesh Pro/Shaders/TMP_SDF.shader +0 -326
- package/upm-hypersdk/app.hypergames.hypersdk/Resources/TextMesh Pro/Shaders/TMP_Sprite.shader +0 -131
- package/upm-hypersdk/app.hypergames.hypersdk/Resources/TextMesh Pro/Shaders/TMPro.cginc +0 -84
- package/upm-hypersdk/app.hypergames.hypersdk/Resources/TextMesh Pro/Shaders/TMPro_Mobile.cginc +0 -165
- package/upm-hypersdk/app.hypergames.hypersdk/Resources/TextMesh Pro/Shaders/TMPro_Properties.cginc +0 -80
- package/upm-hypersdk/app.hypergames.hypersdk/Resources/TextMesh Pro/Shaders/TMPro_Surface.cginc +0 -99
- package/upm-hypersdk/app.hypergames.hypersdk/Resources/TextMesh Pro/Sprites/EmojiOne Attribution.txt +0 -3
- package/upm-hypersdk/app.hypergames.hypersdk/Resources/TextMesh Pro/Sprites/EmojiOne.json +0 -156
- package/upm-hypersdk/app.hypergames.hypersdk/Resources/TextMesh Pro/Sprites/EmojiOne.png +0 -0
package/upm-hypersdk/app.hypergames.hypersdk/Resources/TextMesh Pro/Shaders/TMP_Bitmap.shader
DELETED
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
Shader "TextMeshPro/Bitmap" {
|
|
2
|
-
|
|
3
|
-
Properties {
|
|
4
|
-
_MainTex ("Font Atlas", 2D) = "white" {}
|
|
5
|
-
_FaceTex ("Font Texture", 2D) = "white" {}
|
|
6
|
-
_FaceColor ("Text Color", Color) = (1,1,1,1)
|
|
7
|
-
|
|
8
|
-
_VertexOffsetX ("Vertex OffsetX", float) = 0
|
|
9
|
-
_VertexOffsetY ("Vertex OffsetY", float) = 0
|
|
10
|
-
_MaskSoftnessX ("Mask SoftnessX", float) = 0
|
|
11
|
-
_MaskSoftnessY ("Mask SoftnessY", float) = 0
|
|
12
|
-
|
|
13
|
-
_ClipRect ("Clip Rect", vector) = (-32767, -32767, 32767, 32767)
|
|
14
|
-
|
|
15
|
-
_StencilComp ("Stencil Comparison", Float) = 8
|
|
16
|
-
_Stencil ("Stencil ID", Float) = 0
|
|
17
|
-
_StencilOp ("Stencil Operation", Float) = 0
|
|
18
|
-
_StencilWriteMask ("Stencil Write Mask", Float) = 255
|
|
19
|
-
_StencilReadMask ("Stencil Read Mask", Float) = 255
|
|
20
|
-
|
|
21
|
-
_CullMode ("Cull Mode", Float) = 0
|
|
22
|
-
_ColorMask ("Color Mask", Float) = 15
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
SubShader{
|
|
26
|
-
|
|
27
|
-
Tags { "Queue" = "Transparent" "IgnoreProjector" = "True" "RenderType" = "Transparent" }
|
|
28
|
-
|
|
29
|
-
Stencil
|
|
30
|
-
{
|
|
31
|
-
Ref[_Stencil]
|
|
32
|
-
Comp[_StencilComp]
|
|
33
|
-
Pass[_StencilOp]
|
|
34
|
-
ReadMask[_StencilReadMask]
|
|
35
|
-
WriteMask[_StencilWriteMask]
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
Lighting Off
|
|
40
|
-
Cull [_CullMode]
|
|
41
|
-
ZTest [unity_GUIZTestMode]
|
|
42
|
-
ZWrite Off
|
|
43
|
-
Fog { Mode Off }
|
|
44
|
-
Blend SrcAlpha OneMinusSrcAlpha
|
|
45
|
-
ColorMask[_ColorMask]
|
|
46
|
-
|
|
47
|
-
Pass {
|
|
48
|
-
CGPROGRAM
|
|
49
|
-
#pragma vertex vert
|
|
50
|
-
#pragma fragment frag
|
|
51
|
-
|
|
52
|
-
#pragma multi_compile __ UNITY_UI_CLIP_RECT
|
|
53
|
-
#pragma multi_compile __ UNITY_UI_ALPHACLIP
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
#include "UnityCG.cginc"
|
|
57
|
-
#include "UnityUI.cginc"
|
|
58
|
-
|
|
59
|
-
struct appdata_t
|
|
60
|
-
{
|
|
61
|
-
float4 vertex : POSITION;
|
|
62
|
-
fixed4 color : COLOR;
|
|
63
|
-
float4 texcoord0 : TEXCOORD0;
|
|
64
|
-
float2 texcoord1 : TEXCOORD1;
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
struct v2f
|
|
68
|
-
{
|
|
69
|
-
float4 vertex : SV_POSITION;
|
|
70
|
-
fixed4 color : COLOR;
|
|
71
|
-
float2 texcoord0 : TEXCOORD0;
|
|
72
|
-
float2 texcoord1 : TEXCOORD1;
|
|
73
|
-
float4 mask : TEXCOORD2;
|
|
74
|
-
};
|
|
75
|
-
|
|
76
|
-
uniform sampler2D _MainTex;
|
|
77
|
-
uniform sampler2D _FaceTex;
|
|
78
|
-
uniform float4 _FaceTex_ST;
|
|
79
|
-
uniform fixed4 _FaceColor;
|
|
80
|
-
|
|
81
|
-
uniform float _VertexOffsetX;
|
|
82
|
-
uniform float _VertexOffsetY;
|
|
83
|
-
uniform float4 _ClipRect;
|
|
84
|
-
uniform float _MaskSoftnessX;
|
|
85
|
-
uniform float _MaskSoftnessY;
|
|
86
|
-
uniform float _UIMaskSoftnessX;
|
|
87
|
-
uniform float _UIMaskSoftnessY;
|
|
88
|
-
uniform int _UIVertexColorAlwaysGammaSpace;
|
|
89
|
-
|
|
90
|
-
v2f vert (appdata_t v)
|
|
91
|
-
{
|
|
92
|
-
float4 vert = v.vertex;
|
|
93
|
-
vert.x += _VertexOffsetX;
|
|
94
|
-
vert.y += _VertexOffsetY;
|
|
95
|
-
|
|
96
|
-
vert.xy += (vert.w * 0.5) / _ScreenParams.xy;
|
|
97
|
-
|
|
98
|
-
float4 vPosition = UnityPixelSnap(UnityObjectToClipPos(vert));
|
|
99
|
-
|
|
100
|
-
if (_UIVertexColorAlwaysGammaSpace && !IsGammaSpace())
|
|
101
|
-
{
|
|
102
|
-
v.color.rgb = UIGammaToLinear(v.color.rgb);
|
|
103
|
-
}
|
|
104
|
-
fixed4 faceColor = v.color;
|
|
105
|
-
faceColor *= _FaceColor;
|
|
106
|
-
|
|
107
|
-
v2f OUT;
|
|
108
|
-
OUT.vertex = vPosition;
|
|
109
|
-
OUT.color = faceColor;
|
|
110
|
-
OUT.texcoord0 = v.texcoord0;
|
|
111
|
-
OUT.texcoord1 = TRANSFORM_TEX(v.texcoord1, _FaceTex);
|
|
112
|
-
float2 pixelSize = vPosition.w;
|
|
113
|
-
pixelSize /= abs(float2(_ScreenParams.x * UNITY_MATRIX_P[0][0], _ScreenParams.y * UNITY_MATRIX_P[1][1]));
|
|
114
|
-
|
|
115
|
-
// Clamp _ClipRect to 16bit.
|
|
116
|
-
const float4 clampedRect = clamp(_ClipRect, -2e10, 2e10);
|
|
117
|
-
const half2 maskSoftness = half2(max(_UIMaskSoftnessX, _MaskSoftnessX), max(_UIMaskSoftnessY, _MaskSoftnessY));
|
|
118
|
-
OUT.mask = float4(vert.xy * 2 - clampedRect.xy - clampedRect.zw, 0.25 / (0.25 * maskSoftness + pixelSize.xy));
|
|
119
|
-
|
|
120
|
-
return OUT;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
fixed4 frag (v2f IN) : SV_Target
|
|
124
|
-
{
|
|
125
|
-
fixed4 color = tex2D(_MainTex, IN.texcoord0);
|
|
126
|
-
color = fixed4 (tex2D(_FaceTex, IN.texcoord1).rgb * IN.color.rgb, IN.color.a * color.a);
|
|
127
|
-
|
|
128
|
-
// Alternative implementation to UnityGet2DClipping with support for softness.
|
|
129
|
-
#if UNITY_UI_CLIP_RECT
|
|
130
|
-
half2 m = saturate((_ClipRect.zw - _ClipRect.xy - abs(IN.mask.xy)) * IN.mask.zw);
|
|
131
|
-
color *= m.x * m.y;
|
|
132
|
-
#endif
|
|
133
|
-
|
|
134
|
-
#if UNITY_UI_ALPHACLIP
|
|
135
|
-
clip(color.a - 0.001);
|
|
136
|
-
#endif
|
|
137
|
-
|
|
138
|
-
return color;
|
|
139
|
-
}
|
|
140
|
-
ENDCG
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
CustomEditor "TMPro.EditorUtilities.TMP_BitmapShaderGUI"
|
|
145
|
-
}
|
package/upm-hypersdk/app.hypergames.hypersdk/Resources/TextMesh Pro/Shaders/TMP_SDF Overlay.shader
DELETED
|
@@ -1,326 +0,0 @@
|
|
|
1
|
-
Shader "TextMeshPro/Distance Field Overlay" {
|
|
2
|
-
|
|
3
|
-
Properties {
|
|
4
|
-
_FaceTex ("Face Texture", 2D) = "white" {}
|
|
5
|
-
_FaceUVSpeedX ("Face UV Speed X", Range(-5, 5)) = 0.0
|
|
6
|
-
_FaceUVSpeedY ("Face UV Speed Y", Range(-5, 5)) = 0.0
|
|
7
|
-
_FaceColor ("Face Color", Color) = (1,1,1,1)
|
|
8
|
-
_FaceDilate ("Face Dilate", Range(-1,1)) = 0
|
|
9
|
-
|
|
10
|
-
_OutlineColor ("Outline Color", Color) = (0,0,0,1)
|
|
11
|
-
_OutlineTex ("Outline Texture", 2D) = "white" {}
|
|
12
|
-
_OutlineUVSpeedX ("Outline UV Speed X", Range(-5, 5)) = 0.0
|
|
13
|
-
_OutlineUVSpeedY ("Outline UV Speed Y", Range(-5, 5)) = 0.0
|
|
14
|
-
_OutlineWidth ("Outline Thickness", Range(0, 1)) = 0
|
|
15
|
-
_OutlineSoftness ("Outline Softness", Range(0,1)) = 0
|
|
16
|
-
|
|
17
|
-
_Bevel ("Bevel", Range(0,1)) = 0.5
|
|
18
|
-
_BevelOffset ("Bevel Offset", Range(-0.5,0.5)) = 0
|
|
19
|
-
_BevelWidth ("Bevel Width", Range(-.5,0.5)) = 0
|
|
20
|
-
_BevelClamp ("Bevel Clamp", Range(0,1)) = 0
|
|
21
|
-
_BevelRoundness ("Bevel Roundness", Range(0,1)) = 0
|
|
22
|
-
|
|
23
|
-
_LightAngle ("Light Angle", Range(0.0, 6.2831853)) = 3.1416
|
|
24
|
-
_SpecularColor ("Specular", Color) = (1,1,1,1)
|
|
25
|
-
_SpecularPower ("Specular", Range(0,4)) = 2.0
|
|
26
|
-
_Reflectivity ("Reflectivity", Range(5.0,15.0)) = 10
|
|
27
|
-
_Diffuse ("Diffuse", Range(0,1)) = 0.5
|
|
28
|
-
_Ambient ("Ambient", Range(1,0)) = 0.5
|
|
29
|
-
|
|
30
|
-
_BumpMap ("Normal map", 2D) = "bump" {}
|
|
31
|
-
_BumpOutline ("Bump Outline", Range(0,1)) = 0
|
|
32
|
-
_BumpFace ("Bump Face", Range(0,1)) = 0
|
|
33
|
-
|
|
34
|
-
_ReflectFaceColor ("Reflection Color", Color) = (0,0,0,1)
|
|
35
|
-
_ReflectOutlineColor("Reflection Color", Color) = (0,0,0,1)
|
|
36
|
-
_Cube ("Reflection Cubemap", Cube) = "black" { /* TexGen CubeReflect */ }
|
|
37
|
-
_EnvMatrixRotation ("Texture Rotation", vector) = (0, 0, 0, 0)
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
_UnderlayColor ("Border Color", Color) = (0,0,0, 0.5)
|
|
41
|
-
_UnderlayOffsetX ("Border OffsetX", Range(-1,1)) = 0
|
|
42
|
-
_UnderlayOffsetY ("Border OffsetY", Range(-1,1)) = 0
|
|
43
|
-
_UnderlayDilate ("Border Dilate", Range(-1,1)) = 0
|
|
44
|
-
_UnderlaySoftness ("Border Softness", Range(0,1)) = 0
|
|
45
|
-
|
|
46
|
-
_GlowColor ("Color", Color) = (0, 1, 0, 0.5)
|
|
47
|
-
_GlowOffset ("Offset", Range(-1,1)) = 0
|
|
48
|
-
_GlowInner ("Inner", Range(0,1)) = 0.05
|
|
49
|
-
_GlowOuter ("Outer", Range(0,1)) = 0.05
|
|
50
|
-
_GlowPower ("Falloff", Range(1, 0)) = 0.75
|
|
51
|
-
|
|
52
|
-
_WeightNormal ("Weight Normal", float) = 0
|
|
53
|
-
_WeightBold ("Weight Bold", float) = 0.5
|
|
54
|
-
|
|
55
|
-
_ShaderFlags ("Flags", float) = 0
|
|
56
|
-
_ScaleRatioA ("Scale RatioA", float) = 1
|
|
57
|
-
_ScaleRatioB ("Scale RatioB", float) = 1
|
|
58
|
-
_ScaleRatioC ("Scale RatioC", float) = 1
|
|
59
|
-
|
|
60
|
-
_MainTex ("Font Atlas", 2D) = "white" {}
|
|
61
|
-
_TextureWidth ("Texture Width", float) = 512
|
|
62
|
-
_TextureHeight ("Texture Height", float) = 512
|
|
63
|
-
_GradientScale ("Gradient Scale", float) = 5.0
|
|
64
|
-
_ScaleX ("Scale X", float) = 1.0
|
|
65
|
-
_ScaleY ("Scale Y", float) = 1.0
|
|
66
|
-
_PerspectiveFilter ("Perspective Correction", Range(0, 1)) = 0.875
|
|
67
|
-
_Sharpness ("Sharpness", Range(-1,1)) = 0
|
|
68
|
-
|
|
69
|
-
_VertexOffsetX ("Vertex OffsetX", float) = 0
|
|
70
|
-
_VertexOffsetY ("Vertex OffsetY", float) = 0
|
|
71
|
-
|
|
72
|
-
_MaskCoord ("Mask Coordinates", vector) = (0, 0, 32767, 32767)
|
|
73
|
-
_ClipRect ("Clip Rect", vector) = (-32767, -32767, 32767, 32767)
|
|
74
|
-
_MaskSoftnessX ("Mask SoftnessX", float) = 0
|
|
75
|
-
_MaskSoftnessY ("Mask SoftnessY", float) = 0
|
|
76
|
-
|
|
77
|
-
_StencilComp ("Stencil Comparison", Float) = 8
|
|
78
|
-
_Stencil ("Stencil ID", Float) = 0
|
|
79
|
-
_StencilOp ("Stencil Operation", Float) = 0
|
|
80
|
-
_StencilWriteMask ("Stencil Write Mask", Float) = 255
|
|
81
|
-
_StencilReadMask ("Stencil Read Mask", Float) = 255
|
|
82
|
-
|
|
83
|
-
_CullMode ("Cull Mode", Float) = 0
|
|
84
|
-
_ColorMask ("Color Mask", Float) = 15
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
SubShader {
|
|
88
|
-
|
|
89
|
-
Tags
|
|
90
|
-
{
|
|
91
|
-
"Queue"="Overlay"
|
|
92
|
-
"IgnoreProjector"="True"
|
|
93
|
-
"RenderType"="Transparent"
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
Stencil
|
|
97
|
-
{
|
|
98
|
-
Ref [_Stencil]
|
|
99
|
-
Comp [_StencilComp]
|
|
100
|
-
Pass [_StencilOp]
|
|
101
|
-
ReadMask [_StencilReadMask]
|
|
102
|
-
WriteMask [_StencilWriteMask]
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
Cull [_CullMode]
|
|
106
|
-
ZWrite Off
|
|
107
|
-
Lighting Off
|
|
108
|
-
Fog { Mode Off }
|
|
109
|
-
ZTest Always
|
|
110
|
-
Blend One OneMinusSrcAlpha
|
|
111
|
-
ColorMask [_ColorMask]
|
|
112
|
-
|
|
113
|
-
Pass {
|
|
114
|
-
CGPROGRAM
|
|
115
|
-
#pragma target 3.0
|
|
116
|
-
#pragma vertex VertShader
|
|
117
|
-
#pragma fragment PixShader
|
|
118
|
-
#pragma shader_feature __ BEVEL_ON
|
|
119
|
-
#pragma shader_feature __ UNDERLAY_ON UNDERLAY_INNER
|
|
120
|
-
#pragma shader_feature __ GLOW_ON
|
|
121
|
-
|
|
122
|
-
#pragma multi_compile __ UNITY_UI_CLIP_RECT
|
|
123
|
-
#pragma multi_compile __ UNITY_UI_ALPHACLIP
|
|
124
|
-
|
|
125
|
-
#include "UnityCG.cginc"
|
|
126
|
-
#include "UnityUI.cginc"
|
|
127
|
-
#include "TMPro_Properties.cginc"
|
|
128
|
-
#include "TMPro.cginc"
|
|
129
|
-
|
|
130
|
-
struct vertex_t
|
|
131
|
-
{
|
|
132
|
-
UNITY_VERTEX_INPUT_INSTANCE_ID
|
|
133
|
-
float4 position : POSITION;
|
|
134
|
-
float3 normal : NORMAL;
|
|
135
|
-
fixed4 color : COLOR;
|
|
136
|
-
float4 texcoord0 : TEXCOORD0;
|
|
137
|
-
float2 texcoord1 : TEXCOORD1;
|
|
138
|
-
};
|
|
139
|
-
|
|
140
|
-
struct pixel_t
|
|
141
|
-
{
|
|
142
|
-
UNITY_VERTEX_INPUT_INSTANCE_ID
|
|
143
|
-
UNITY_VERTEX_OUTPUT_STEREO
|
|
144
|
-
float4 position : SV_POSITION;
|
|
145
|
-
fixed4 color : COLOR;
|
|
146
|
-
float2 atlas : TEXCOORD0; // Atlas
|
|
147
|
-
float4 param : TEXCOORD1; // alphaClip, scale, bias, weight
|
|
148
|
-
float4 mask : TEXCOORD2; // Position in object space(xy), pixel Size(zw)
|
|
149
|
-
float3 viewDir : TEXCOORD3;
|
|
150
|
-
|
|
151
|
-
#if (UNDERLAY_ON || UNDERLAY_INNER)
|
|
152
|
-
float4 texcoord2 : TEXCOORD4; // u,v, scale, bias
|
|
153
|
-
fixed4 underlayColor : COLOR1;
|
|
154
|
-
#endif
|
|
155
|
-
|
|
156
|
-
float4 textures : TEXCOORD5;
|
|
157
|
-
};
|
|
158
|
-
|
|
159
|
-
// Used by Unity internally to handle Texture Tiling and Offset.
|
|
160
|
-
uniform float4 _FaceTex_ST;
|
|
161
|
-
uniform float4 _OutlineTex_ST;
|
|
162
|
-
uniform float _UIMaskSoftnessX;
|
|
163
|
-
uniform float _UIMaskSoftnessY;
|
|
164
|
-
uniform int _UIVertexColorAlwaysGammaSpace;
|
|
165
|
-
|
|
166
|
-
pixel_t VertShader(vertex_t input)
|
|
167
|
-
{
|
|
168
|
-
pixel_t output;
|
|
169
|
-
|
|
170
|
-
UNITY_INITIALIZE_OUTPUT(pixel_t, output);
|
|
171
|
-
UNITY_SETUP_INSTANCE_ID(input);
|
|
172
|
-
UNITY_TRANSFER_INSTANCE_ID(input,output);
|
|
173
|
-
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output);
|
|
174
|
-
|
|
175
|
-
float bold = step(input.texcoord0.w, 0);
|
|
176
|
-
|
|
177
|
-
float4 vert = input.position;
|
|
178
|
-
vert.x += _VertexOffsetX;
|
|
179
|
-
vert.y += _VertexOffsetY;
|
|
180
|
-
|
|
181
|
-
float4 vPosition = UnityObjectToClipPos(vert);
|
|
182
|
-
|
|
183
|
-
float2 pixelSize = vPosition.w;
|
|
184
|
-
pixelSize /= float2(_ScaleX, _ScaleY) * abs(mul((float2x2)UNITY_MATRIX_P, _ScreenParams.xy));
|
|
185
|
-
float scale = rsqrt(dot(pixelSize, pixelSize));
|
|
186
|
-
scale *= abs(input.texcoord0.w) * _GradientScale * (_Sharpness + 1);
|
|
187
|
-
if (UNITY_MATRIX_P[3][3] == 0) scale = lerp(abs(scale) * (1 - _PerspectiveFilter), scale, abs(dot(UnityObjectToWorldNormal(input.normal.xyz), normalize(WorldSpaceViewDir(vert)))));
|
|
188
|
-
|
|
189
|
-
float weight = lerp(_WeightNormal, _WeightBold, bold) / 4.0;
|
|
190
|
-
weight = (weight + _FaceDilate) * _ScaleRatioA * 0.5;
|
|
191
|
-
|
|
192
|
-
float bias =(.5 - weight) + (.5 / scale);
|
|
193
|
-
|
|
194
|
-
float alphaClip = (1.0 - _OutlineWidth*_ScaleRatioA - _OutlineSoftness*_ScaleRatioA);
|
|
195
|
-
|
|
196
|
-
#if GLOW_ON
|
|
197
|
-
alphaClip = min(alphaClip, 1.0 - _GlowOffset * _ScaleRatioB - _GlowOuter * _ScaleRatioB);
|
|
198
|
-
#endif
|
|
199
|
-
|
|
200
|
-
alphaClip = alphaClip / 2.0 - ( .5 / scale) - weight;
|
|
201
|
-
|
|
202
|
-
#if (UNDERLAY_ON || UNDERLAY_INNER)
|
|
203
|
-
float4 underlayColor = _UnderlayColor;
|
|
204
|
-
underlayColor.rgb *= underlayColor.a;
|
|
205
|
-
|
|
206
|
-
float bScale = scale;
|
|
207
|
-
bScale /= 1 + ((_UnderlaySoftness*_ScaleRatioC) * bScale);
|
|
208
|
-
float bBias = (0.5 - weight) * bScale - 0.5 - ((_UnderlayDilate * _ScaleRatioC) * 0.5 * bScale);
|
|
209
|
-
|
|
210
|
-
float x = -(_UnderlayOffsetX * _ScaleRatioC) * _GradientScale / _TextureWidth;
|
|
211
|
-
float y = -(_UnderlayOffsetY * _ScaleRatioC) * _GradientScale / _TextureHeight;
|
|
212
|
-
float2 bOffset = float2(x, y);
|
|
213
|
-
#endif
|
|
214
|
-
|
|
215
|
-
// Generate UV for the Masking Texture
|
|
216
|
-
float4 clampedRect = clamp(_ClipRect, -2e10, 2e10);
|
|
217
|
-
float2 maskUV = (vert.xy - clampedRect.xy) / (clampedRect.zw - clampedRect.xy);
|
|
218
|
-
|
|
219
|
-
// Support for texture tiling and offset
|
|
220
|
-
float2 textureUV = input.texcoord1;
|
|
221
|
-
float2 faceUV = TRANSFORM_TEX(textureUV, _FaceTex);
|
|
222
|
-
float2 outlineUV = TRANSFORM_TEX(textureUV, _OutlineTex);
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
if (_UIVertexColorAlwaysGammaSpace && !IsGammaSpace())
|
|
226
|
-
{
|
|
227
|
-
input.color.rgb = UIGammaToLinear(input.color.rgb);
|
|
228
|
-
}
|
|
229
|
-
output.position = vPosition;
|
|
230
|
-
output.color = input.color;
|
|
231
|
-
output.atlas = input.texcoord0;
|
|
232
|
-
output.param = float4(alphaClip, scale, bias, weight);
|
|
233
|
-
const half2 maskSoftness = half2(max(_UIMaskSoftnessX, _MaskSoftnessX), max(_UIMaskSoftnessY, _MaskSoftnessY));
|
|
234
|
-
output.mask = half4(vert.xy * 2 - clampedRect.xy - clampedRect.zw, 0.25 / (0.25 * maskSoftness + pixelSize.xy));
|
|
235
|
-
output.viewDir = mul((float3x3)_EnvMatrix, _WorldSpaceCameraPos.xyz - mul(unity_ObjectToWorld, vert).xyz);
|
|
236
|
-
#if (UNDERLAY_ON || UNDERLAY_INNER)
|
|
237
|
-
output.texcoord2 = float4(input.texcoord0 + bOffset, bScale, bBias);
|
|
238
|
-
output.underlayColor = underlayColor;
|
|
239
|
-
#endif
|
|
240
|
-
output.textures = float4(faceUV, outlineUV);
|
|
241
|
-
|
|
242
|
-
return output;
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
fixed4 PixShader(pixel_t input) : SV_Target
|
|
247
|
-
{
|
|
248
|
-
UNITY_SETUP_INSTANCE_ID(input);
|
|
249
|
-
|
|
250
|
-
float c = tex2D(_MainTex, input.atlas).a;
|
|
251
|
-
|
|
252
|
-
#ifndef UNDERLAY_ON
|
|
253
|
-
clip(c - input.param.x);
|
|
254
|
-
#endif
|
|
255
|
-
|
|
256
|
-
float scale = input.param.y;
|
|
257
|
-
float bias = input.param.z;
|
|
258
|
-
float weight = input.param.w;
|
|
259
|
-
float sd = (bias - c) * scale;
|
|
260
|
-
|
|
261
|
-
float outline = (_OutlineWidth * _ScaleRatioA) * scale;
|
|
262
|
-
float softness = (_OutlineSoftness * _ScaleRatioA) * scale;
|
|
263
|
-
|
|
264
|
-
half4 faceColor = _FaceColor;
|
|
265
|
-
half4 outlineColor = _OutlineColor;
|
|
266
|
-
|
|
267
|
-
faceColor.rgb *= input.color.rgb;
|
|
268
|
-
|
|
269
|
-
faceColor *= tex2D(_FaceTex, input.textures.xy + float2(_FaceUVSpeedX, _FaceUVSpeedY) * _Time.y);
|
|
270
|
-
outlineColor *= tex2D(_OutlineTex, input.textures.zw + float2(_OutlineUVSpeedX, _OutlineUVSpeedY) * _Time.y);
|
|
271
|
-
|
|
272
|
-
faceColor = GetColor(sd, faceColor, outlineColor, outline, softness);
|
|
273
|
-
|
|
274
|
-
#if BEVEL_ON
|
|
275
|
-
float3 dxy = float3(0.5 / _TextureWidth, 0.5 / _TextureHeight, 0);
|
|
276
|
-
float3 n = GetSurfaceNormal(input.atlas, weight, dxy);
|
|
277
|
-
|
|
278
|
-
float3 bump = UnpackNormal(tex2D(_BumpMap, input.textures.xy + float2(_FaceUVSpeedX, _FaceUVSpeedY) * _Time.y)).xyz;
|
|
279
|
-
bump *= lerp(_BumpFace, _BumpOutline, saturate(sd + outline * 0.5));
|
|
280
|
-
n = normalize(n- bump);
|
|
281
|
-
|
|
282
|
-
float3 light = normalize(float3(sin(_LightAngle), cos(_LightAngle), -1.0));
|
|
283
|
-
|
|
284
|
-
float3 col = GetSpecular(n, light);
|
|
285
|
-
faceColor.rgb += col*faceColor.a;
|
|
286
|
-
faceColor.rgb *= 1-(dot(n, light)*_Diffuse);
|
|
287
|
-
faceColor.rgb *= lerp(_Ambient, 1, n.z*n.z);
|
|
288
|
-
|
|
289
|
-
fixed4 reflcol = texCUBE(_Cube, reflect(input.viewDir, -n));
|
|
290
|
-
faceColor.rgb += reflcol.rgb * lerp(_ReflectFaceColor.rgb, _ReflectOutlineColor.rgb, saturate(sd + outline * 0.5)) * faceColor.a;
|
|
291
|
-
#endif
|
|
292
|
-
|
|
293
|
-
#if UNDERLAY_ON
|
|
294
|
-
float d = tex2D(_MainTex, input.texcoord2.xy).a * input.texcoord2.z;
|
|
295
|
-
faceColor += input.underlayColor * saturate(d - input.texcoord2.w) * (1 - faceColor.a);
|
|
296
|
-
#endif
|
|
297
|
-
|
|
298
|
-
#if UNDERLAY_INNER
|
|
299
|
-
float d = tex2D(_MainTex, input.texcoord2.xy).a * input.texcoord2.z;
|
|
300
|
-
faceColor += input.underlayColor * (1 - saturate(d - input.texcoord2.w)) * saturate(1 - sd) * (1 - faceColor.a);
|
|
301
|
-
#endif
|
|
302
|
-
|
|
303
|
-
#if GLOW_ON
|
|
304
|
-
float4 glowColor = GetGlowColor(sd, scale);
|
|
305
|
-
faceColor.rgb += glowColor.rgb * glowColor.a;
|
|
306
|
-
#endif
|
|
307
|
-
|
|
308
|
-
// Alternative implementation to UnityGet2DClipping with support for softness.
|
|
309
|
-
#if UNITY_UI_CLIP_RECT
|
|
310
|
-
half2 m = saturate((_ClipRect.zw - _ClipRect.xy - abs(input.mask.xy)) * input.mask.zw);
|
|
311
|
-
faceColor *= m.x * m.y;
|
|
312
|
-
#endif
|
|
313
|
-
|
|
314
|
-
#if UNITY_UI_ALPHACLIP
|
|
315
|
-
clip(faceColor.a - 0.001);
|
|
316
|
-
#endif
|
|
317
|
-
|
|
318
|
-
return faceColor * input.color.a;
|
|
319
|
-
}
|
|
320
|
-
ENDCG
|
|
321
|
-
}
|
|
322
|
-
}
|
|
323
|
-
|
|
324
|
-
Fallback "TextMeshPro/Mobile/Distance Field"
|
|
325
|
-
CustomEditor "TMPro.EditorUtilities.TMP_SDFShaderGUI"
|
|
326
|
-
}
|