mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-09-27 10:46:17 +00:00
提交FairyGUI
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b5137d7a41873f9499f95f860a6cef17
|
||||
folderAsset: yes
|
||||
timeCreated: 1465913233
|
||||
licenseType: Pro
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -0,0 +1,58 @@
|
||||
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
|
||||
|
||||
Shader "FairyGUI/BlurFilter" {
|
||||
Properties {
|
||||
_MainTex ("Base (RGB)", 2D) = "white" {}
|
||||
}
|
||||
|
||||
SubShader {
|
||||
Pass {
|
||||
ZTest Always
|
||||
ZWrite Off
|
||||
|
||||
CGPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
|
||||
#include "UnityCG.cginc"
|
||||
|
||||
struct appdata_t {
|
||||
float4 vertex : POSITION;
|
||||
float2 texcoord : TEXCOORD0;
|
||||
};
|
||||
|
||||
struct v2f {
|
||||
float4 vertex : SV_POSITION;
|
||||
half2 texcoord : TEXCOORD0;
|
||||
half2 taps[4] : TEXCOORD1;
|
||||
};
|
||||
|
||||
sampler2D _MainTex;
|
||||
half4 _MainTex_TexelSize;
|
||||
half4 _BlurOffsets;
|
||||
|
||||
v2f vert (appdata_t v)
|
||||
{
|
||||
v2f o;
|
||||
o.vertex = UnityObjectToClipPos(v.vertex);
|
||||
o.texcoord = v.texcoord - _BlurOffsets.xy * _MainTex_TexelSize.xy;
|
||||
o.taps[0] = o.texcoord + _MainTex_TexelSize * _BlurOffsets.xy;
|
||||
o.taps[1] = o.texcoord - _MainTex_TexelSize * _BlurOffsets.xy;
|
||||
o.taps[2] = o.texcoord + _MainTex_TexelSize * _BlurOffsets.xy * half2(1,-1);
|
||||
o.taps[3] = o.texcoord - _MainTex_TexelSize * _BlurOffsets.xy * half2(1,-1);
|
||||
return o;
|
||||
}
|
||||
|
||||
fixed4 frag (v2f i) : SV_Target
|
||||
{
|
||||
half4 color = tex2D(_MainTex, i.taps[0]);
|
||||
color += tex2D(_MainTex, i.taps[1]);
|
||||
color += tex2D(_MainTex, i.taps[2]);
|
||||
color += tex2D(_MainTex, i.taps[3]);
|
||||
return color * 0.25;
|
||||
}
|
||||
ENDCG
|
||||
}
|
||||
}
|
||||
Fallback off
|
||||
}
|
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f83d3bb1d90aaf54d8aed0783317662f
|
||||
timeCreated: 1465913243
|
||||
licenseType: Pro
|
||||
ShaderImporter:
|
||||
defaultTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -0,0 +1,154 @@
|
||||
// Upgrade NOTE: replaced '_Object2World' with 'unity_ObjectToWorld'
|
||||
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
|
||||
|
||||
Shader "FairyGUI/BMFont"
|
||||
{
|
||||
Properties
|
||||
{
|
||||
_MainTex ("Base (RGB), Alpha (A)", 2D) = "black" {}
|
||||
|
||||
_StencilComp ("Stencil Comparison", Float) = 8
|
||||
_Stencil ("Stencil ID", Float) = 0
|
||||
_StencilOp ("Stencil Operation", Float) = 0
|
||||
_StencilWriteMask ("Stencil Write Mask", Float) = 255
|
||||
_StencilReadMask ("Stencil Read Mask", Float) = 255
|
||||
|
||||
_ColorMask ("Color Mask", Float) = 15
|
||||
|
||||
_BlendSrcFactor ("Blend SrcFactor", Float) = 5
|
||||
_BlendDstFactor ("Blend DstFactor", Float) = 10
|
||||
}
|
||||
|
||||
SubShader
|
||||
{
|
||||
LOD 100
|
||||
|
||||
Tags
|
||||
{
|
||||
"Queue" = "Transparent"
|
||||
"IgnoreProjector" = "True"
|
||||
"RenderType" = "Transparent"
|
||||
}
|
||||
|
||||
Stencil
|
||||
{
|
||||
Ref [_Stencil]
|
||||
Comp [_StencilComp]
|
||||
Pass [_StencilOp]
|
||||
ReadMask [_StencilReadMask]
|
||||
WriteMask [_StencilWriteMask]
|
||||
}
|
||||
|
||||
Cull Off
|
||||
Lighting Off
|
||||
ZWrite Off
|
||||
Fog { Mode Off }
|
||||
Blend [_BlendSrcFactor] [_BlendDstFactor]
|
||||
ColorMask [_ColorMask]
|
||||
|
||||
Pass
|
||||
{
|
||||
CGPROGRAM
|
||||
#pragma multi_compile NOT_GRAYED GRAYED
|
||||
#pragma multi_compile NOT_CLIPPED CLIPPED SOFT_CLIPPED
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
#pragma exclude_renderers d3d9 opengl flash
|
||||
|
||||
#include "UnityCG.cginc"
|
||||
|
||||
struct appdata_t
|
||||
{
|
||||
float4 vertex : POSITION;
|
||||
fixed4 color : COLOR;
|
||||
float4 texcoord : TEXCOORD0;
|
||||
};
|
||||
|
||||
struct v2f
|
||||
{
|
||||
float4 vertex : SV_POSITION;
|
||||
fixed4 color : COLOR;
|
||||
float4 texcoord : TEXCOORD0;
|
||||
|
||||
#ifdef CLIPPED
|
||||
float2 clipPos : TEXCOORD1;
|
||||
#endif
|
||||
|
||||
#ifdef SOFT_CLIPPED
|
||||
float2 clipPos : TEXCOORD1;
|
||||
#endif
|
||||
};
|
||||
|
||||
sampler2D _MainTex;
|
||||
|
||||
CBUFFER_START(UnityPerMaterial)
|
||||
#ifdef CLIPPED
|
||||
float4 _ClipBox = float4(-2, -2, 0, 0);
|
||||
#endif
|
||||
|
||||
#ifdef SOFT_CLIPPED
|
||||
float4 _ClipBox = float4(-2, -2, 0, 0);
|
||||
float4 _ClipSoftness = float4(0, 0, 0, 0);
|
||||
#endif
|
||||
CBUFFER_END
|
||||
|
||||
v2f vert (appdata_t v)
|
||||
{
|
||||
v2f o;
|
||||
o.vertex = UnityObjectToClipPos(v.vertex);
|
||||
o.texcoord = v.texcoord;
|
||||
#if !defined(UNITY_COLORSPACE_GAMMA) && (UNITY_VERSION >= 550)
|
||||
o.color.rgb = GammaToLinearSpace(v.color.rgb);
|
||||
o.color.a = v.color.a;
|
||||
#else
|
||||
o.color = v.color;
|
||||
#endif
|
||||
|
||||
#ifdef CLIPPED
|
||||
o.clipPos = mul(unity_ObjectToWorld, v.vertex).xy * _ClipBox.zw + _ClipBox.xy;
|
||||
#endif
|
||||
|
||||
#ifdef SOFT_CLIPPED
|
||||
o.clipPos = mul(unity_ObjectToWorld, v.vertex).xy * _ClipBox.zw + _ClipBox.xy;
|
||||
#endif
|
||||
|
||||
return o;
|
||||
}
|
||||
|
||||
fixed4 frag (v2f i) : SV_Target
|
||||
{
|
||||
fixed4 col = i.color;
|
||||
fixed4 tcol = tex2D(_MainTex, i.texcoord);
|
||||
col.a *= tcol[i.texcoord.z];//z stores channel
|
||||
|
||||
#ifdef GRAYED
|
||||
fixed grey = dot(col.rgb, fixed3(0.299, 0.587, 0.114));
|
||||
col.rgb = fixed3(grey, grey, grey);
|
||||
#endif
|
||||
|
||||
#ifdef SOFT_CLIPPED
|
||||
float2 factor = float2(0,0);
|
||||
if(i.clipPos.x<0)
|
||||
factor.x = (1.0-abs(i.clipPos.x)) * _ClipSoftness.x;
|
||||
else
|
||||
factor.x = (1.0-i.clipPos.x) * _ClipSoftness.z;
|
||||
if(i.clipPos.y<0)
|
||||
factor.y = (1.0-abs(i.clipPos.y)) * _ClipSoftness.w;
|
||||
else
|
||||
factor.y = (1.0-i.clipPos.y) * _ClipSoftness.y;
|
||||
col.a *= clamp(min(factor.x, factor.y), 0.0, 1.0);
|
||||
#endif
|
||||
|
||||
#ifdef CLIPPED
|
||||
float2 factor = abs(i.clipPos);
|
||||
col.a *= step(max(factor.x, factor.y), 1);
|
||||
#endif
|
||||
|
||||
return col;
|
||||
}
|
||||
ENDCG
|
||||
}
|
||||
}
|
||||
|
||||
Fallback "FairyGUI/Text"
|
||||
}
|
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: cd79153f88fa7334ea6c5564c053bdca
|
||||
timeCreated: 1459224288
|
||||
licenseType: Pro
|
||||
ShaderImporter:
|
||||
defaultTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -0,0 +1,182 @@
|
||||
// Upgrade NOTE: replaced '_Object2World' with 'unity_ObjectToWorld'
|
||||
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
|
||||
|
||||
Shader "FairyGUI/Image"
|
||||
{
|
||||
Properties
|
||||
{
|
||||
_MainTex ("Base (RGB), Alpha (A)", 2D) = "black" {}
|
||||
|
||||
_StencilComp ("Stencil Comparison", Float) = 8
|
||||
_Stencil ("Stencil ID", Float) = 0
|
||||
_StencilOp ("Stencil Operation", Float) = 0
|
||||
_StencilWriteMask ("Stencil Write Mask", Float) = 255
|
||||
_StencilReadMask ("Stencil Read Mask", Float) = 255
|
||||
|
||||
_ColorMask ("Color Mask", Float) = 15
|
||||
|
||||
_BlendSrcFactor ("Blend SrcFactor", Float) = 5
|
||||
_BlendDstFactor ("Blend DstFactor", Float) = 10
|
||||
}
|
||||
|
||||
SubShader
|
||||
{
|
||||
LOD 100
|
||||
|
||||
Tags
|
||||
{
|
||||
"Queue" = "Transparent"
|
||||
"IgnoreProjector" = "True"
|
||||
"RenderType" = "Transparent"
|
||||
}
|
||||
|
||||
Stencil
|
||||
{
|
||||
Ref [_Stencil]
|
||||
Comp [_StencilComp]
|
||||
Pass [_StencilOp]
|
||||
ReadMask [_StencilReadMask]
|
||||
WriteMask [_StencilWriteMask]
|
||||
}
|
||||
|
||||
Cull Off
|
||||
Lighting Off
|
||||
ZWrite Off
|
||||
Fog { Mode Off }
|
||||
Blend [_BlendSrcFactor] [_BlendDstFactor], One One
|
||||
ColorMask [_ColorMask]
|
||||
|
||||
Pass
|
||||
{
|
||||
CGPROGRAM
|
||||
#pragma multi_compile NOT_COMBINED COMBINED
|
||||
#pragma multi_compile NOT_GRAYED GRAYED COLOR_FILTER
|
||||
#pragma multi_compile NOT_CLIPPED CLIPPED SOFT_CLIPPED ALPHA_MASK
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
|
||||
#include "UnityCG.cginc"
|
||||
|
||||
struct appdata_t
|
||||
{
|
||||
float4 vertex : POSITION;
|
||||
fixed4 color : COLOR;
|
||||
float4 texcoord : TEXCOORD0;
|
||||
};
|
||||
|
||||
struct v2f
|
||||
{
|
||||
float4 vertex : SV_POSITION;
|
||||
fixed4 color : COLOR;
|
||||
float4 texcoord : TEXCOORD0;
|
||||
|
||||
#ifdef CLIPPED
|
||||
float2 clipPos : TEXCOORD1;
|
||||
#endif
|
||||
|
||||
#ifdef SOFT_CLIPPED
|
||||
float2 clipPos : TEXCOORD1;
|
||||
#endif
|
||||
};
|
||||
|
||||
sampler2D _MainTex;
|
||||
|
||||
#ifdef COMBINED
|
||||
sampler2D _AlphaTex;
|
||||
#endif
|
||||
|
||||
CBUFFER_START(UnityPerMaterial)
|
||||
#ifdef CLIPPED
|
||||
float4 _ClipBox = float4(-2, -2, 0, 0);
|
||||
#endif
|
||||
|
||||
#ifdef SOFT_CLIPPED
|
||||
float4 _ClipBox = float4(-2, -2, 0, 0);
|
||||
float4 _ClipSoftness = float4(0, 0, 0, 0);
|
||||
#endif
|
||||
CBUFFER_END
|
||||
|
||||
#ifdef COLOR_FILTER
|
||||
float4x4 _ColorMatrix;
|
||||
float4 _ColorOffset;
|
||||
float _ColorOption = 0;
|
||||
#endif
|
||||
|
||||
v2f vert (appdata_t v)
|
||||
{
|
||||
v2f o;
|
||||
o.vertex = UnityObjectToClipPos(v.vertex);
|
||||
o.texcoord = v.texcoord;
|
||||
#if !defined(UNITY_COLORSPACE_GAMMA) && (UNITY_VERSION >= 550)
|
||||
o.color.rgb = GammaToLinearSpace(v.color.rgb);
|
||||
o.color.a = v.color.a;
|
||||
#else
|
||||
o.color = v.color;
|
||||
#endif
|
||||
|
||||
#ifdef CLIPPED
|
||||
o.clipPos = mul(unity_ObjectToWorld, v.vertex).xy * _ClipBox.zw + _ClipBox.xy;
|
||||
#endif
|
||||
|
||||
#ifdef SOFT_CLIPPED
|
||||
o.clipPos = mul(unity_ObjectToWorld, v.vertex).xy * _ClipBox.zw + _ClipBox.xy;
|
||||
#endif
|
||||
|
||||
return o;
|
||||
}
|
||||
|
||||
fixed4 frag (v2f i) : SV_Target
|
||||
{
|
||||
fixed4 col = tex2D(_MainTex, i.texcoord.xy / i.texcoord.w) * i.color;
|
||||
|
||||
#ifdef COMBINED
|
||||
col.a *= tex2D(_AlphaTex, i.texcoord.xy / i.texcoord.w).g;
|
||||
#endif
|
||||
|
||||
#ifdef GRAYED
|
||||
fixed grey = dot(col.rgb, fixed3(0.299, 0.587, 0.114));
|
||||
col.rgb = fixed3(grey, grey, grey);
|
||||
#endif
|
||||
|
||||
#ifdef SOFT_CLIPPED
|
||||
float2 factor = float2(0,0);
|
||||
if(i.clipPos.x<0)
|
||||
factor.x = (1.0-abs(i.clipPos.x)) * _ClipSoftness.x;
|
||||
else
|
||||
factor.x = (1.0-i.clipPos.x) * _ClipSoftness.z;
|
||||
if(i.clipPos.y<0)
|
||||
factor.y = (1.0-abs(i.clipPos.y)) * _ClipSoftness.w;
|
||||
else
|
||||
factor.y = (1.0-i.clipPos.y) * _ClipSoftness.y;
|
||||
col.a *= clamp(min(factor.x, factor.y), 0.0, 1.0);
|
||||
#endif
|
||||
|
||||
#ifdef CLIPPED
|
||||
float2 factor = abs(i.clipPos);
|
||||
col.a *= step(max(factor.x, factor.y), 1);
|
||||
#endif
|
||||
|
||||
#ifdef COLOR_FILTER
|
||||
if (_ColorOption == 0)
|
||||
{
|
||||
fixed4 col2 = col;
|
||||
col2.r = dot(col, _ColorMatrix[0]) + _ColorOffset.x;
|
||||
col2.g = dot(col, _ColorMatrix[1]) + _ColorOffset.y;
|
||||
col2.b = dot(col, _ColorMatrix[2]) + _ColorOffset.z;
|
||||
col2.a = dot(col, _ColorMatrix[3]) + _ColorOffset.w;
|
||||
col = col2;
|
||||
}
|
||||
else //premultiply alpha
|
||||
col.rgb *= col.a;
|
||||
#endif
|
||||
|
||||
#ifdef ALPHA_MASK
|
||||
clip(col.a - 0.001);
|
||||
#endif
|
||||
|
||||
return col;
|
||||
}
|
||||
ENDCG
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 263c97191482b3649ac7bf0810cc4f77
|
||||
timeCreated: 1459224288
|
||||
licenseType: Pro
|
||||
ShaderImporter:
|
||||
defaultTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -0,0 +1,150 @@
|
||||
// Upgrade NOTE: replaced '_Object2World' with 'unity_ObjectToWorld'
|
||||
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
|
||||
|
||||
Shader "FairyGUI/Text"
|
||||
{
|
||||
Properties
|
||||
{
|
||||
_MainTex ("Alpha (A)", 2D) = "white" {}
|
||||
|
||||
_StencilComp ("Stencil Comparison", Float) = 8
|
||||
_Stencil ("Stencil ID", Float) = 0
|
||||
_StencilOp ("Stencil Operation", Float) = 0
|
||||
_StencilWriteMask ("Stencil Write Mask", Float) = 255
|
||||
_StencilReadMask ("Stencil Read Mask", Float) = 255
|
||||
|
||||
_ColorMask ("Color Mask", Float) = 15
|
||||
|
||||
_BlendSrcFactor ("Blend SrcFactor", Float) = 5
|
||||
_BlendDstFactor ("Blend DstFactor", Float) = 10
|
||||
}
|
||||
|
||||
SubShader
|
||||
{
|
||||
LOD 100
|
||||
|
||||
Tags
|
||||
{
|
||||
"Queue" = "Transparent"
|
||||
"IgnoreProjector" = "True"
|
||||
"RenderType" = "Transparent"
|
||||
}
|
||||
|
||||
Stencil
|
||||
{
|
||||
Ref [_Stencil]
|
||||
Comp [_StencilComp]
|
||||
Pass [_StencilOp]
|
||||
ReadMask [_StencilReadMask]
|
||||
WriteMask [_StencilWriteMask]
|
||||
}
|
||||
|
||||
Cull Off
|
||||
Lighting Off
|
||||
ZWrite Off
|
||||
Fog { Mode Off }
|
||||
Blend [_BlendSrcFactor] [_BlendDstFactor]
|
||||
ColorMask [_ColorMask]
|
||||
|
||||
Pass
|
||||
{
|
||||
CGPROGRAM
|
||||
#pragma multi_compile NOT_GRAYED GRAYED
|
||||
#pragma multi_compile NOT_CLIPPED CLIPPED SOFT_CLIPPED
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
|
||||
#include "UnityCG.cginc"
|
||||
|
||||
struct appdata_t
|
||||
{
|
||||
float4 vertex : POSITION;
|
||||
fixed4 color : COLOR;
|
||||
float4 texcoord : TEXCOORD0;
|
||||
};
|
||||
|
||||
struct v2f
|
||||
{
|
||||
float4 vertex : SV_POSITION;
|
||||
fixed4 color : COLOR;
|
||||
float4 texcoord : TEXCOORD0;
|
||||
|
||||
#ifdef CLIPPED
|
||||
float2 clipPos : TEXCOORD1;
|
||||
#endif
|
||||
|
||||
#ifdef SOFT_CLIPPED
|
||||
float2 clipPos : TEXCOORD1;
|
||||
#endif
|
||||
};
|
||||
|
||||
sampler2D _MainTex;
|
||||
|
||||
CBUFFER_START(UnityPerMaterial)
|
||||
#ifdef CLIPPED
|
||||
float4 _ClipBox = float4(-2, -2, 0, 0);
|
||||
#endif
|
||||
|
||||
#ifdef SOFT_CLIPPED
|
||||
float4 _ClipBox = float4(-2, -2, 0, 0);
|
||||
float4 _ClipSoftness = float4(0, 0, 0, 0);
|
||||
#endif
|
||||
CBUFFER_END
|
||||
|
||||
v2f vert (appdata_t v)
|
||||
{
|
||||
v2f o;
|
||||
o.vertex = UnityObjectToClipPos(v.vertex);
|
||||
o.texcoord = v.texcoord;
|
||||
#if !defined(UNITY_COLORSPACE_GAMMA) && (UNITY_VERSION >= 550)
|
||||
o.color.rgb = GammaToLinearSpace(v.color.rgb);
|
||||
o.color.a = v.color.a;
|
||||
#else
|
||||
o.color = v.color;
|
||||
#endif
|
||||
|
||||
#ifdef CLIPPED
|
||||
o.clipPos = mul(unity_ObjectToWorld, v.vertex).xy * _ClipBox.zw + _ClipBox.xy;
|
||||
#endif
|
||||
|
||||
#ifdef SOFT_CLIPPED
|
||||
o.clipPos = mul(unity_ObjectToWorld, v.vertex).xy * _ClipBox.zw + _ClipBox.xy;
|
||||
#endif
|
||||
|
||||
return o;
|
||||
}
|
||||
|
||||
fixed4 frag (v2f i) : SV_Target
|
||||
{
|
||||
fixed4 col = i.color;
|
||||
col.a *= tex2D(_MainTex, i.texcoord).a;
|
||||
|
||||
#ifdef GRAYED
|
||||
fixed grey = dot(col.rgb, fixed3(0.299, 0.587, 0.114));
|
||||
col.rgb = fixed3(grey, grey, grey);
|
||||
#endif
|
||||
|
||||
#ifdef SOFT_CLIPPED
|
||||
float2 factor = float2(0,0);
|
||||
if(i.clipPos.x<0)
|
||||
factor.x = (1.0-abs(i.clipPos.x)) * _ClipSoftness.x;
|
||||
else
|
||||
factor.x = (1.0-i.clipPos.x) * _ClipSoftness.z;
|
||||
if(i.clipPos.y<0)
|
||||
factor.y = (1.0-abs(i.clipPos.y)) * _ClipSoftness.w;
|
||||
else
|
||||
factor.y = (1.0-i.clipPos.y) * _ClipSoftness.y;
|
||||
col.a *= clamp(min(factor.x, factor.y), 0.0, 1.0);
|
||||
#endif
|
||||
|
||||
#ifdef CLIPPED
|
||||
float2 factor = abs(i.clipPos);
|
||||
col.a *= step(max(factor.x, factor.y), 1);
|
||||
#endif
|
||||
|
||||
return col;
|
||||
}
|
||||
ENDCG
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8526777372c6fef4f8162b3a7901dcb0
|
||||
timeCreated: 1459224288
|
||||
licenseType: Pro
|
||||
ShaderImporter:
|
||||
defaultTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Reference in New Issue
Block a user