This commit is contained in:
2025-05-16 23:31:59 +08:00
parent 9e4fef3f1e
commit d891e3f0ee
1198 changed files with 274242 additions and 1558 deletions

View File

@@ -0,0 +1,77 @@
Shader "RapidIcon/ImgShader"
{
Properties
{
_MainTex("Tex", 2D) = "white" {}
_UseDepthTexture("UseDepthTexture", int) = 0
}
SubShader
{
Tags { "Queue" = "Transparent" "PreviewType" = "Plane" }
//LOD 100
ZWrite Off
Blend One OneMinusSrcAlpha
Pass
{
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#include "UnityCG.cginc"
struct appdata
{
float4 vertex : POSITION;
float2 uv : TEXCOORD0;
};
struct v2f
{
float4 pos : SV_POSITION;
float2 uv : TEXCOORD0;
};
sampler2D _MainTex;
sampler2D _LastCameraDepthTexture;
int _UseDepthTexture;
v2f vert(appdata v)
{
v2f o;
o.pos = UnityObjectToClipPos(v.vertex);
o.uv = v.uv;
return o;
}
half4 frag(v2f i) : SV_Target
{
half4 col = tex2D(_MainTex, i.uv);
if (col.a > 0 && col.a < 1)
{
col.r /= col.a;
col.g /= col.a;
col.b /= col.a;
}
float depth = tex2D(_LastCameraDepthTexture, i.uv).r;
depth = Linear01Depth(depth);
depth = 1-depth;
if(depth > 0.01)
depth = 1;
if(_UseDepthTexture == 1)
{
col.a*=depth;
}
return col;
}
ENDCG
}
}
}

View File

@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: c8660893a3c43aa4fb36057a3973f713
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,59 @@
Shader "RapidIcon/ObjectRender"
{
Properties
{
[NoScaleOffset]
_MainTex("Tex", 2D) = "black" {}
[NoScaleOffset]
_Render("Object Render", 2D) = "black" {}
}
SubShader
{
Blend One OneMinusSrcAlpha
Pass
{
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#include "UnityCG.cginc"
struct appdata
{
float4 vertex : POSITION;
float2 uv : TEXCOORD0;
};
struct v2f
{
float2 uv : TEXCOORD0;
float4 vertex : SV_POSITION;
};
v2f vert(appdata v)
{
v2f o;
o.vertex = UnityObjectToClipPos(v.vertex);
o.uv = v.uv;
return o;
}
sampler2D _MainTex;
sampler2D _Render;
fixed4 frag(v2f i) : SV_Target
{
fixed4 col = tex2D(_MainTex, i.uv);
fixed4 render = tex2D(_Render, i.uv);
fixed4 output;
output.rgb = lerp(col.rgb, render.rgb, render.a);
output.a = 1 - ((1 - col.a)*(1 - render.a));
return output;
}
ENDCG
}
}
}

View File

@@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: e533984b6c5c18a4087237c04964e9f0
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
preprocessorOverride: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 3462a04ea39fe2242896806769cbb73f
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,85 @@
Shader "RapidIcon/PostProcessing/HSV"
{
Properties
{
_MainTex("Texture", 2D) = "white" {}
_Hue("Hue", range(0,1)) = 0
_Saturation("Saturation", range(0,1)) = 1
_Value("Value", range(0,1)) = 1
}
SubShader
{
// No culling or depth
Cull Off ZWrite Off ZTest Always
Pass
{
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#include "UnityCG.cginc"
struct appdata
{
float4 vertex : POSITION;
float2 uv : TEXCOORD0;
};
struct v2f
{
float2 uv : TEXCOORD0;
float4 vertex : SV_POSITION;
};
v2f vert(appdata v)
{
v2f o;
o.vertex = UnityObjectToClipPos(v.vertex);
o.uv = v.uv;
return o;
}
sampler2D _MainTex;
float _Hue;
float _Saturation;
float _Value;
fixed4 frag(v2f i) : SV_Target
{
fixed4 col = tex2D(_MainTex, i.uv);
float pi = 3.14159265359;
float U = cos(2*_Hue*pi);
float W = sin(2*_Hue*pi);
float4 newCol;
newCol.r = (.299 + .701*U + .168*W)*col.r
+ (.587 - .587*U + .330*W)*col.g
+ (.114 - .114*U - .497*W)*col.b;
newCol.g = (.299 - .299*U - .328*W)*col.r
+ (.587 + .413*U + .035*W)*col.g
+ (.114 - .114*U + .292*W)*col.b;
newCol.b = (.299 - .3*U + 1.25*W)*col.r
+ (.587 - .588*U - 1.05*W)*col.g
+ (.114 + .886*U - .203*W)*col.b;
float grayscale;
grayscale = dot(float3(0.222, 0.707, 0.071), newCol);
float3 desatCol;
desatCol = float3(grayscale, grayscale, grayscale);
col.rgb = lerp(desatCol, newCol.rgb, _Saturation)*_Value;
return col;
}
ENDCG
}
}
}

View File

@@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: bbdf8525b70b0674b9fc5434a98da0ad
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
preprocessorOverride: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,63 @@
Shader "RapidIcon/PostProcessing/Mask" {
Properties{
[NoScaleOffset]
[MainTexture]
_MainTex("Tex", 2D) = "black" {}
[NoScaleOffset]
_MaskTex("Mask", 2D) = "white" {}
[Toggle]
_UseLuminance("Use Luminance", Int) = 1
}
SubShader
{
Tags { "Queue" = "Transparent" "RenderType" = "Transparent" }
Blend One OneMinusSrcAlpha
Pass
{
CGPROGRAM
#pragma vertex vert_img
#pragma fragment frag
#include "UnityCG.cginc"
struct appdata
{
float4 vertex : POSITION;
float2 uv : TEXCOORD0;
};
struct v2f
{
float2 uv : TEXCOORD0;
float4 vertex : SV_POSITION;
};
sampler2D _MainTex;
sampler2D _MaskTex;
int _UseLuminance;
fixed4 frag(v2f_img i) : SV_Target
{
fixed4 col = tex2D(_MainTex, i.uv);
fixed3 maskCol = tex2D(_MaskTex, i.uv).rgb;
if (_UseLuminance == 1)
{
fixed maskLum = Luminance(maskCol).r;
col *= maskLum;
}
else
{
fixed maskLum = maskCol.r;
col *= maskLum;
}
return col;
}
ENDCG
}
}
FallBack "Diffuse"
}

View File

@@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 0799f06535cf3f14991a4a50bcc4673c
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
preprocessorOverride: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,113 @@
Shader "RapidIcon/PostProcessing/Overlay"
{
Properties
{
[NoScaleOffset]
_MainTex("Tex", 2D) = "black" {}
[NoScaleOffset]
_OverlayTex("Overlay Image", 2D) = "black" {}
[Toggle]
_MatchAspect("Match Image Aspect Ratio", Int) = 1
_Scale("Scale", Float) = 1
_OffsetX("X Offset", Float) = 0
_OffsetY("Y Offset", Float) = 0
}
SubShader
{
Blend One OneMinusSrcAlpha
Pass
{
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#include "UnityCG.cginc"
struct appdata
{
float4 vertex : POSITION;
float2 uvMain : TEXCOORD0;
float2 uvOverlay : TEXCOORD1;
};
struct v2f
{
float2 uvMain : TEXCOORD0;
float2 uvOverlay : TEXCOORD1;
float4 vertex : SV_POSITION;
};
float4 _MainTex_TexelSize;
float4 _OverlayTex_TexelSize;
int _MatchAspect;
float _Scale;
float _OffsetX;
float _OffsetY;
v2f vert(appdata v)
{
v2f o;
o.vertex = UnityObjectToClipPos(v.vertex);
o.uvMain = v.uvMain;
o.uvOverlay = v.uvOverlay;
o.uvOverlay.x -= _OffsetX;
o.uvOverlay.y -= _OffsetY;
o.uvOverlay = (o.uvOverlay - 0.5) / _Scale + 0.5;
if (_OverlayTex_TexelSize.z > _OverlayTex_TexelSize.w)
{
float aspectScale = _OverlayTex_TexelSize.x / _OverlayTex_TexelSize.y;
o.uvOverlay.y = (o.uvOverlay.y - 0.5) / aspectScale + 0.5;
}
else
{
float aspectScale = _OverlayTex_TexelSize.y / _OverlayTex_TexelSize.x;
o.uvOverlay.x = (o.uvOverlay.x - 0.5) / aspectScale + 0.5;
}
if (!_MatchAspect) {
if (_MainTex_TexelSize.z > _MainTex_TexelSize.w)
{
float aspectScale = _MainTex_TexelSize.y / _MainTex_TexelSize.x;
o.uvOverlay.y = (o.uvOverlay.y - 0.5) / aspectScale + 0.5;
}
else
{
float aspectScale = _MainTex_TexelSize.x / _MainTex_TexelSize.y;
o.uvOverlay.x = (o.uvOverlay.x - 0.5) / aspectScale + 0.5;
}
}
return o;
}
sampler2D _MainTex;
sampler2D _OverlayTex;
fixed4 frag(v2f i) : SV_Target
{
fixed4 main = tex2D(_MainTex, i.uvMain);
fixed4 overlay = tex2D(_OverlayTex, i.uvOverlay);
fixed4 output;
if (i.uvOverlay.x < 0 || i.uvOverlay.x > 1 || i.uvOverlay.y < 0 || i.uvOverlay.y > 1)
output = main;
else
{
if (overlay.a > 0)
output.rgb = lerp(main.rgb, overlay.rgb, overlay.a);
else
output.rgb = main;
output.a = 1 - ((1 - main.a)*(1 - overlay.a));
}
return output;
}
ENDCG
}
}
}

View File

@@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 4ed84d029799b8b42bd7d4b9899db3b2
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
preprocessorOverride: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,53 @@
Shader "RapidIcon/PostProcessing/Transparency"
{
Properties
{
_MainTex ("Texture", 2D) = "white" {}
_Transparency("Transparency", range(0, 1)) = 0
}
SubShader
{
// No culling or depth
Cull Off ZWrite Off ZTest Always
Pass
{
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#include "UnityCG.cginc"
struct appdata
{
float4 vertex : POSITION;
float2 uv : TEXCOORD0;
};
struct v2f
{
float2 uv : TEXCOORD0;
float4 vertex : SV_POSITION;
};
v2f vert (appdata v)
{
v2f o;
o.vertex = UnityObjectToClipPos(v.vertex);
o.uv = v.uv;
return o;
}
sampler2D _MainTex;
float _Transparency;
fixed4 frag (v2f i) : SV_Target
{
fixed4 col = tex2D(_MainTex, i.uv);
col *= 1-_Transparency;
return col;
}
ENDCG
}
}
}

View File

@@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 4fbf5a470ce0bd341b7e867ab7ead320
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
preprocessorOverride: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,112 @@
Shader "RapidIcon/PostProcessing/Underlay"
{
Properties
{
[NoScaleOffset]
_MainTex("Tex", 2D) = "black" {}
[NoScaleOffset]
_UnderlayTex("Underlay Image", 2D) = "black" {}
[Toggle]
_MatchAspect("Match Image Aspect Ratio", Int) = 1
_Scale("Scale", Float) = 1
_OffsetX("X Offset", Float) = 0
_OffsetY("Y Offset", Float) = 0
}
SubShader
{
Blend One OneMinusSrcAlpha
Pass
{
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#include "UnityCG.cginc"
struct appdata
{
float4 vertex : POSITION;
float2 uvMain : TEXCOORD0;
float2 uvUnderlay : TEXCOORD1;
};
struct v2f
{
float2 uvMain : TEXCOORD0;
float2 uvUnderlay : TEXCOORD1;
float4 vertex : SV_POSITION;
};
float4 _MainTex_TexelSize;
float4 _UnderlayTex_TexelSize;
int _MatchAspect;
float _Scale;
float _OffsetX;
float _OffsetY;
v2f vert(appdata v)
{
v2f o;
o.vertex = UnityObjectToClipPos(v.vertex);
o.uvMain = v.uvMain;
o.uvUnderlay = v.uvUnderlay;
o.uvUnderlay.x -= _OffsetX;
o.uvUnderlay.y -= _OffsetY;
o.uvUnderlay = (o.uvUnderlay - 0.5) / _Scale + 0.5;
if (_UnderlayTex_TexelSize.z > _UnderlayTex_TexelSize.w)
{
float aspectScale = _UnderlayTex_TexelSize.x / _UnderlayTex_TexelSize.y;
o.uvUnderlay.y = (o.uvUnderlay.y - 0.5) / aspectScale + 0.5;
}
else
{
float aspectScale = _UnderlayTex_TexelSize.y / _UnderlayTex_TexelSize.x;
o.uvUnderlay.x = (o.uvUnderlay.x - 0.5) / aspectScale + 0.5;
}
if (!_MatchAspect) {
if (_MainTex_TexelSize.z > _MainTex_TexelSize.w)
{
float aspectScale = _MainTex_TexelSize.y / _MainTex_TexelSize.x;
o.uvUnderlay.y = (o.uvUnderlay.y - 0.5) / aspectScale + 0.5;
}
else
{
float aspectScale = _MainTex_TexelSize.x / _MainTex_TexelSize.y;
o.uvUnderlay.x = (o.uvUnderlay.x - 0.5) / aspectScale + 0.5;
}
}
return o;
}
sampler2D _MainTex;
sampler2D _UnderlayTex;
fixed4 frag(v2f i) : SV_Target
{
fixed4 main = tex2D(_MainTex, i.uvMain);
fixed4 underlay = tex2D(_UnderlayTex, i.uvUnderlay);
fixed4 output;
if (i.uvUnderlay.x < 0 || i.uvUnderlay.x > 1 || i.uvUnderlay.y < 0 || i.uvUnderlay.y > 1)
output = main;
else
{
if (underlay.a > 0)
output.rgb = lerp(underlay.rgb, main.rgb, main.a);
else
output.rgb = main;
output.a = 1 - ((1 - main.a)*(1 - underlay.a));
}
return output;
}
ENDCG
}
}
}

View File

@@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 3ddb549f2327e954b9e89f3dfd58593c
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
preprocessorOverride: 0
userData:
assetBundleName:
assetBundleVariant: