Add shaders

This commit is contained in:
Williams
2026-05-19 15:33:18 +02:00
committed by Lucien
parent 593c2e75b2
commit cd9df45d08
1358 changed files with 2429155 additions and 0 deletions
@@ -1,57 +0,0 @@
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
// ============================================================
// Name: AtlasShader
// Author: Joen Joensen (@UnLogick)
// ============================================================
Shader "UMA/AtlasCutoutShader" {
Properties {
_Color ("Main Color", Color) = (1,1,1,1)
_MainTex ("Base Texture", 2D) = "white" {}
}
SubShader {
Tags {"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"}
Pass
{
Tags { "LightMode" = "Vertex" }
Fog { Mode Off }
BlendOp Add, RevSub
Blend Zero One, One One
Lighting Off
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#include "UnityCG.cginc"
float4 _Color;
sampler2D _MainTex;
struct v2f {
float4 pos : SV_POSITION;
float2 uv : TEXCOORD0;
};
float4 _MainTex_ST;
v2f vert (appdata_base v)
{
v2f o;
o.pos = UnityObjectToClipPos (v.vertex);
o.uv = TRANSFORM_TEX (v.texcoord, _MainTex);
return o;
}
half4 frag (v2f i) : COLOR
{
return half4(0, 0, 0, 1 - tex2D(_MainTex, i.uv).r);
}
ENDCG
}
}
Fallback "Transparent/VertexLit"
}
@@ -1,9 +0,0 @@
fileFormatVersion: 2
guid: 6ec55823d603ee4478b56d3f0d7ce6bb
timeCreated: 1467918749
licenseType: Store
ShaderImporter:
defaultTextures: []
userData:
assetBundleName:
assetBundleVariant:
@@ -1,60 +0,0 @@
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
// ============================================================
// Name: AtlasDetailNormalPostShader
// Author: Umut Ozkan
// This works in conjunction with the AtlasDetailNormalShader.
// ============================================================
Shader "UMA/AtlasDetailNormalPostShader" {
Properties{
_MainTex("Normalmap", 2D) = "bump" {}
}
SubShader
{
Pass
{
Tags{ "LightMode" = "Vertex" }
Fog{ Mode Off }
Blend off
Lighting Off
Cull Off
ZWrite Off
ZTest Always
CGPROGRAM
#pragma vertex vert_img
#pragma fragment frag
#include "UnityCG.cginc"
uniform sampler2D _MainTex;
inline float4 PACK_INTERNAL(half3 unpacked) {
#if defined(UNITY_NO_DXT5nm)
half4 packednormal;
packednormal.xyz = (unpacked.xyz + 1) / 2;
packednormal.w = 1;
return packednormal;
#else
half4 packednormal;
packednormal.wy = (unpacked.xy + 1) / 2;
packednormal.x = 1;
packednormal.z = 1;
return packednormal;
#endif
}
half4 frag(v2f_img i) : COLOR
{
half4 normal = tex2D(_MainTex, i.uv);
normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy)));
half3 normalized = normalize(normal.xyz);
return PACK_INTERNAL(normalized);
}
ENDCG
}
}
Fallback "Transparent/VertexLit"
}
@@ -1,9 +0,0 @@
fileFormatVersion: 2
guid: 1cd76f272fa3efe4a802da9a48f7688f
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData:
assetBundleName:
assetBundleVariant:
@@ -1,81 +0,0 @@
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
// ============================================================
// Name: AtlasShader
// Author: Umut Ozkan
// ============================================================
Shader "UMA/AtlasDetailShaderNormal" {
Properties {
_Color ("Main Color", Color) = (1,1,1,1)
_AdditiveColor ("Additive Color", Color) = (0,0,0,0)
_MainTex ("Normalmap", 2D) = "bump" {}
_ExtraTex ("mask", 2D) = "white" {}
}
SubShader
{
Tags {"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"}
Pass
{
Tags{ "LightMode" = "Vertex" }
Fog{ Mode Off }
Blend One One
Lighting Off
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#include "UnityCG.cginc"
#include "UnityStandardUtils.cginc"
float4 _Color;
float4 _AdditiveColor;
sampler2D _MainTex;
sampler2D _ExtraTex;
struct v2f {
float4 pos : SV_POSITION;
float2 uv : TEXCOORD0;
};
float4 _MainTex_ST;
v2f vert(appdata_base v)
{
v2f o;
o.pos = UnityObjectToClipPos(v.vertex);
o.uv = TRANSFORM_TEX(v.texcoord, _MainTex);
return o;
}
half2 UNPACK_WITH_WEIGHT_INTERNAL(half4 packednormal, half bumpScale)
{
#if defined(UNITY_NO_DXT5nm)
half2 normal = half2(packednormal.xy * 2 - 1);
normal.xy *= bumpScale;
return normal;
#else
half2 result = half2(packednormal.wy * 2 - 1);
result.xy *= bumpScale;
return result;
#endif
}
// This atlas shader has Blend mode add
// It adds adds unpacked values of normal textures. The post process normalize and packs them
half4 frag(v2f i) : COLOR
{
half4 current = tex2D(_MainTex, i.uv);
half4 extra = tex2D(_ExtraTex, i.uv);
half2 n = UNPACK_WITH_WEIGHT_INTERNAL(current, min(extra.a, _Color.a));
// We only need 2 values to calculate normal. Post process will calculate the 3rd vector component
return half4(n.x, n.y, 0, 0);
}
ENDCG
}
}
Fallback "Transparent/VertexLit"
}
@@ -1,9 +0,0 @@
fileFormatVersion: 2
guid: e5ba71eed666aef459dbb1dce2bc3d2f
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData:
assetBundleName:
assetBundleVariant:
@@ -1,63 +0,0 @@
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
// ============================================================
// Name: AtlasShader
// Author: Joen Joensen (@UnLogick)
// ============================================================
Shader "UMA/AtlasDiffuseShader" {
Properties {
_Color ("Main Color", Color) = (1,1,1,1)
_AdditiveColor ("Additive Color", Color) = (0,0,0,0)
_MainTex ("Base Texture", 2D) = "white" {}
_ExtraTex ("mask", 2D) = "white" {}
}
SubShader {
Tags {"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"}
Pass
{
Tags { "LightMode" = "Vertex" }
Fog { Mode Off }
BlendOp Add, Add
Blend SrcAlpha OneMinusSrcAlpha, One OneMinusSrcAlpha
Lighting Off
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#include "UnityCG.cginc"
float4 _Color;
float4 _AdditiveColor;
sampler2D _MainTex;
sampler2D _ExtraTex;
struct v2f {
float4 pos : SV_POSITION;
float2 uv : TEXCOORD0;
};
float4 _MainTex_ST;
v2f vert (appdata_base v)
{
v2f o;
o.pos = UnityObjectToClipPos (v.vertex);
o.uv = TRANSFORM_TEX (v.texcoord, _MainTex);
return o;
}
half4 frag (v2f i) : COLOR
{
half4 texcol = tex2D(_MainTex, i.uv);
half4 mask = tex2D(_ExtraTex, i.uv);
return half4(texcol.xyz, mask.w)*_Color+_AdditiveColor;
}
ENDCG
}
}
Fallback "Transparent/VertexLit"
}
@@ -1,9 +0,0 @@
fileFormatVersion: 2
guid: ae83be5246f311646b3043ed012d9d64
timeCreated: 1467924405
licenseType: Store
ShaderImporter:
defaultTextures: []
userData:
assetBundleName:
assetBundleVariant:
@@ -1,71 +0,0 @@
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
// ============================================================
// Name: AtlasShader
// Author: Joen Joensen (@UnLogick)
// ============================================================
Shader "UMA/AtlasShaderNormal" {
Properties {
_Color ("Main Color", Color) = (1,1,1,1)
_AdditiveColor ("Additive Color", Color) = (0,0,0,0)
_MainTex ("Normalmap", 2D) = "bump" {}
_ExtraTex ("mask", 2D) = "white" {}
}
SubShader
{
Tags {"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"}
Pass
{
Tags{ "LightMode" = "Vertex" }
Fog{ Mode Off }
Blend SrcAlpha OneMinusSrcAlpha
Lighting Off
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#include "UnityCG.cginc"
#include "UnityStandardUtils.cginc"
float4 _Color;
float4 _AdditiveColor;
sampler2D _MainTex;
sampler2D _ExtraTex;
struct v2f {
float4 pos : SV_POSITION;
float2 uv : TEXCOORD0;
};
float4 _MainTex_ST;
v2f vert(appdata_base v)
{
v2f o;
o.pos = UnityObjectToClipPos(v.vertex);
o.uv = TRANSFORM_TEX(v.texcoord, _MainTex);
return o;
}
half4 frag(v2f i) : COLOR
{
half4 n = tex2D(_MainTex, i.uv);
half4 extra = tex2D(_ExtraTex, i.uv);
#if !defined(UNITY_NO_DXT5nm)
//swizzle the alpha and red channel, we will swizzle back in the post process SwizzleShader
n.r = n.a;
#endif
n.a = min(extra.a, _Color.a);
return n;
}
ENDCG
}
}
Fallback "Transparent/VertexLit"
}
@@ -1,9 +0,0 @@
fileFormatVersion: 2
guid: 0c7937a991ef0764fb16577ebf24911e
timeCreated: 1426630728
licenseType: Store
ShaderImporter:
defaultTextures: []
userData:
assetBundleName:
assetBundleVariant:
@@ -1,102 +0,0 @@
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
// ============================================================
// Name: AtlasShader
// Author: Joen Joensen (@UnLogick)
// ============================================================
Shader "UMA/AtlasShaderNormal32" {
Properties {
_Color ("Main Color", Color) = (1,1,1,1)
_AdditiveColor ("Additive Color", Color) = (0,0,0,0)
_MainTex ("Normalmap", 2D) = "bump" {}
_ExtraTex ("mask", 2D) = "white" {}
}
SubShader {
Tags {"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"}
Pass
{
Tags { "LightMode" = "Vertex" }
Fog { Mode Off }
Blend Zero SrcAlpha
Lighting Off
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#include "UnityCG.cginc"
float4 _Color;
float4 _AdditiveColor;
sampler2D _MainTex;
sampler2D _ExtraTex;
struct v2f {
float4 pos : SV_POSITION;
float2 uv : TEXCOORD0;
};
float4 _MainTex_ST;
v2f vert (appdata_base v)
{
v2f o;
o.pos = UnityObjectToClipPos (v.vertex);
o.uv = TRANSFORM_TEX (v.texcoord, _MainTex);
return o;
}
half4 frag (v2f i) : COLOR
{
half4 maskcol = tex2D (_ExtraTex, i.uv);
float value = 1 - maskcol.a;
return half4(value, value, value, value);
}
ENDCG
}
Pass
{
Tags { "LightMode" = "Vertex" }
Fog { Mode Off }
Blend One One
Lighting Off
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#include "UnityCG.cginc"
float4 _Color;
float4 _AdditiveColor;
sampler2D _MainTex;
sampler2D _ExtraTex;
struct v2f {
float4 pos : SV_POSITION;
float2 uv : TEXCOORD0;
};
float4 _MainTex_ST;
v2f vert (appdata_base v)
{
v2f o;
o.pos = UnityObjectToClipPos (v.vertex);
o.uv = TRANSFORM_TEX (v.texcoord, _MainTex);
return o;
}
half4 frag (v2f i) : COLOR
{
half4 texcol = tex2D (_MainTex, i.uv) * _Color + _AdditiveColor;
half4 maskcol = tex2D (_ExtraTex, i.uv);
return texcol * maskcol.a;
}
ENDCG
}
}
Fallback "Transparent/VertexLit"
}
@@ -1,10 +0,0 @@
fileFormatVersion: 2
guid: f001376c60e187e48ba6139415f60d3a
timeCreated: 1536937299
licenseType: Store
ShaderImporter:
externalObjects: {}
defaultTextures: []
userData:
assetBundleName:
assetBundleVariant:
@@ -1,102 +0,0 @@
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
// ============================================================
// Name: AtlasShader
// Author: Joen Joensen (@UnLogick)
// ============================================================
Shader "UMA/AtlasShaderNew" {
Properties {
_Color ("Main Color", Color) = (1,1,1,1)
_AdditiveColor ("Additive Color", Color) = (0,0,0,0)
_MainTex ("Base Texture", 2D) = "white" {}
_ExtraTex ("mask", 2D) = "white" {}
}
SubShader {
Tags {"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"}
Pass
{
Tags { "LightMode" = "Vertex" }
Fog { Mode Off }
Blend Zero SrcAlpha
Lighting Off
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#include "UnityCG.cginc"
float4 _Color;
float4 _AdditiveColor;
sampler2D _MainTex;
sampler2D _ExtraTex;
struct v2f {
float4 pos : SV_POSITION;
float2 uv : TEXCOORD0;
};
float4 _MainTex_ST;
v2f vert (appdata_base v)
{
v2f o;
o.pos = UnityObjectToClipPos (v.vertex);
o.uv = TRANSFORM_TEX (v.texcoord, _MainTex);
return o;
}
half4 frag (v2f i) : COLOR
{
half4 maskcol = tex2D (_ExtraTex, i.uv);
float value = 1 - maskcol.a;
return half4(value, value, value, value);
}
ENDCG
}
Pass
{
Tags { "LightMode" = "Vertex" }
Fog { Mode Off }
Blend One One
Lighting Off
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#include "UnityCG.cginc"
float4 _Color;
float4 _AdditiveColor;
sampler2D _MainTex;
sampler2D _ExtraTex;
struct v2f {
float4 pos : SV_POSITION;
float2 uv : TEXCOORD0;
};
float4 _MainTex_ST;
v2f vert (appdata_base v)
{
v2f o;
o.pos = UnityObjectToClipPos (v.vertex);
o.uv = TRANSFORM_TEX (v.texcoord, _MainTex);
return o;
}
half4 frag (v2f i) : COLOR
{
half4 texcol = tex2D (_MainTex, i.uv) * _Color + _AdditiveColor;
half4 maskcol = tex2D (_ExtraTex, i.uv);
return texcol * maskcol.a;
}
ENDCG
}
}
Fallback "Transparent/VertexLit"
}
@@ -1,5 +0,0 @@
fileFormatVersion: 2
guid: 8179a5383e28f6840a80314368b93979
ShaderImporter:
defaultTextures: []
userData:
@@ -1,50 +0,0 @@
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
// ============================================================
// Name: NormalSwizzleShader
// Author: Kenan Chabuk (@Kenamis)
// This works in conjunction with the AtlasNormalShader that swizzles the alpha to red channel of the packed normal and blends them.
// Then this post effect re-swizzles the normal into the packed format for use with standard shaders.
// ============================================================
Shader "UMA/NormalSwizzleShader" {
Properties{
_MainTex("Normalmap", 2D) = "bump" {}
}
SubShader
{
Pass
{
Tags{ "LightMode" = "Vertex" }
Fog{ Mode Off }
Blend off
Lighting Off
Cull Off
ZWrite Off
ZTest Always
CGPROGRAM
#pragma vertex vert_img
#pragma fragment frag
#include "UnityCG.cginc"
uniform sampler2D _MainTex;
half4 frag(v2f_img i) : COLOR
{
half4 r = tex2D(_MainTex, i.uv);
//G and A are the important ones.
#if defined(UNITY_NO_DXT5nm)
return half4(r.r, r.g, r.b, 0);
#else
return half4(1, r.y, 1, r.x);
#endif
}
ENDCG
}
}
Fallback "Transparent/VertexLit"
}
@@ -1,9 +0,0 @@
fileFormatVersion: 2
guid: 4ba4fc977756a804ca835788b496e3f7
timeCreated: 1546899607
licenseType: Store
ShaderImporter:
defaultTextures: []
userData:
assetBundleName:
assetBundleVariant: