This commit is contained in:
2026-01-06 17:47:11 +01:00
commit 8423e2b790
1313 changed files with 295355 additions and 0 deletions

View File

@@ -0,0 +1,153 @@
Shader "SpatialFramework/FauxBackgroundOverlayBlurURP"
{
Properties
{
_Blur("Blur", Range(0, 10)) = 1.5
_Alpha("Alpha", Range(0, 1)) = 1
_GradientSize("Gradient Size", Range(0, 6)) = 2
_MainTex("Noise Texture (REQUIRED for Blur Noise)", 2D) = "white" {}
}
SubShader
{
PackageRequirements
{
"com.unity.render-pipelines.universal": "12.1.3"
}
Tags { "RenderPipeline" = "UniversalRenderPipeline" "Queue" = "Transparent-1" "LightMode" = "Always" "IgnoreProjector" = "True" "RenderType" = "Transparent" }
ZWrite On
ZTest LEqual
Lighting Off
Blend SrcAlpha OneMinusSrcAlpha
Pass
{
Tags { "LightMode" = "UniversalForward" }
HLSLPROGRAM
#pragma vertex vert
#pragma fragment frag
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderVariablesFunctions.hlsl"
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/EntityLighting.hlsl"
SAMPLER(_MainTex);
CBUFFER_START(UnityPerMaterial)
half _Alpha;
half _Blur;
half _GradientSize;
CBUFFER_END
struct appdata_t
{
half4 position : POSITION;
half3 normal : NORMAL;
half2 texcoord : TEXCOORD0;
UNITY_VERTEX_INPUT_INSTANCE_ID
};
struct v2f
{
half4 position : POSITION;
half3 worldPos : TEXCOORD0;
half2 cleanUV : TEXCOORD2;
UNITY_VERTEX_OUTPUT_STEREO
};
v2f vert(appdata_t v)
{
v2f output;
UNITY_SETUP_INSTANCE_ID(v);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output);
output.position = TransformObjectToHClip(v.position.xyz);
output.worldPos = mul(unity_ObjectToWorld, v.position).xyz;
output.cleanUV = v.texcoord;
return output;
}
half4 frag(v2f input) : SV_Target
{
half2 uvPos = abs(input.cleanUV - float2(0.5, 0.5));
half uvMax = max(uvPos.x, uvPos.y);
half fadeFromBorderAmount = 1 - clamp(0, 1, pow(uvMax, _GradientSize) * 2);
half3 reflectionDir = -normalize(GetWorldSpaceViewDir(input.worldPos));
half noise = tex2D(_MainTex, input.cleanUV).r;
half4 reflectionData = SAMPLE_TEXTURECUBE_LOD(unity_SpecCube0, samplerunity_SpecCube0, reflectionDir, 1.5);
half3 reflectionColor = DecodeHDREnvironment(reflectionData, unity_SpecCube0_HDR);
return half4(reflectionColor, clamp(0, 1 - pow((uvMax * 2), _GradientSize * (_Blur / 10)), fadeFromBorderAmount) * _Alpha * noise);
}
ENDHLSL
}
}
SubShader
{
Tags{ "RenderPipeline" = " " "Queue" = "Transparent-1" "LightMode" = "Always" "IgnoreProjector" = "True" "RenderType" = "Transparent" }
ZWrite On
ZTest LEqual
Lighting Off
Blend SrcAlpha OneMinusSrcAlpha
Pass
{
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#include "UnityCG.cginc"
half _Alpha;
half _Blur;
half _GradientSize;
sampler2D _MainTex;
struct appdata_t
{
half4 position : POSITION;
half3 normal : NORMAL;
half2 texcoord : TEXCOORD0;
UNITY_VERTEX_INPUT_INSTANCE_ID
};
struct v2f
{
half4 position : POSITION;
half3 worldPos : TEXCOORD0;
half2 cleanUV : TEXCOORD2;
UNITY_VERTEX_OUTPUT_STEREO
};
v2f vert(appdata_t v)
{
v2f output;
UNITY_SETUP_INSTANCE_ID(v);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output);
output.position = UnityObjectToClipPos(v.position);
output.worldPos = mul(unity_ObjectToWorld, v.position).xyz;
output.cleanUV = v.texcoord;
return output;
}
fixed4 frag(v2f input) : SV_Target
{
half2 uvPos = abs(input.cleanUV - float2(0.5, 0.5));
half uvMax = max(uvPos.x, uvPos.y);
half fadeFromBorderAmount = 1 - clamp(0, 1, pow(uvMax, _GradientSize) * 2);
half3 reflectionDir = -normalize(UnityWorldSpaceViewDir(input.worldPos));
half noise = tex2D(_MainTex, input.cleanUV).r;
half4 reflectionData = UNITY_SAMPLE_TEXCUBE_LOD(unity_SpecCube0, reflectionDir, 1.5);
half3 reflectionColor = DecodeHDR(reflectionData, unity_SpecCube0_HDR);
return half4(reflectionColor, clamp(0, 1 - pow((uvMax * 2), _GradientSize * (_Blur / 10)), fadeFromBorderAmount) * _Alpha * noise);
}
ENDCG
}
}
}

View File

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

View File

@@ -0,0 +1,75 @@
Shader "Unlit/Grid"
{
Properties
{
_GridColour ("Grid Colour", color) = (1, 1, 1, 1)
_BaseColour ("Base Colour", color) = (1, 1, 1, 0)
_GridSpacing ("Grid Spacing", float) = 1
_LineThickness ("Line Thickness", float) = .1
_ODistance ("Start Transparency Distance", float) = 5
_TDistance ("Full Transparency Distance", float) = 10
}
SubShader
{
Tags { "RenderType"="Transparent" "Queue"="Transparent"}
LOD 100
Blend SrcAlpha OneMinusSrcAlpha
ZWrite Off
Pass
{
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#include "UnityCG.cginc"
struct appdata
{
float4 vertex : POSITION;
UNITY_VERTEX_INPUT_INSTANCE_ID
};
struct v2f
{
float4 vertex : SV_POSITION;
float2 uv : TEXCOORD0;
float3 worldPos : TEXCOORD1;
UNITY_VERTEX_OUTPUT_STEREO
};
fixed4 _GridColour;
fixed4 _BaseColour;
float _GridSpacing;
float _LineThickness;
float _ODistance;
float _TDistance;
v2f vert (appdata_full v)
{
v2f o;
UNITY_SETUP_INSTANCE_ID(v);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
o.vertex = UnityObjectToClipPos(v.vertex);
o.worldPos = mul(unity_ObjectToWorld, v.vertex);
o.uv = o.worldPos.xz / _GridSpacing;
return o;
}
fixed4 frag (v2f i) : SV_Target
{
float2 wrapped = frac(i.uv) - 0.5f;
float2 range = abs(wrapped);
float2 speeds;
speeds = fwidth(i.uv);
float2 pixelRange = range/speeds;
float lineWeight = saturate(min(pixelRange.x, pixelRange.y) - _LineThickness);
half4 param = lerp(_GridColour, _BaseColour, lineWeight);
//distance falloff
half3 viewDirW = _WorldSpaceCameraPos - i.worldPos;
half viewDist = length(viewDirW);
half falloff = saturate((viewDist - _ODistance) / (_TDistance - _ODistance) );
param.a *= (1.0f - falloff);
return param;
}
ENDCG
}
}
}

View File

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

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 8ccee1dee7490414ea7e8ad2b953c3e1
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 2
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 11500000, guid: 625f186215c104763be7675aa2d941aa, type: 3}

View File

@@ -0,0 +1,102 @@
Shader "SpatialFramework/Textured Fresnel/Standard"
{
Properties
{
_EdgeColor("Edge Color", COLOR) = (1,1,1,1)
_Color("Color", COLOR) = (.25,.25,.25,.25)
_EdgeData("Edge min, max, S-strength, S-Blend", VECTOR) = (0, 0.85, 0.5, 1)
_MainTex("Texture", 2D) = "white" {}
}
SubShader
{
// First, we do a stencil like technique of writing depth of the model,
// so we don't have any transparent overdraw in subsequent steps
Tags{ "RenderType" = "Transparent" "Queue" = "Transparent" }
Pass
{
Tags
{
"RenderType" = "Transparent"
"Queue" = "Transparent"
"LightMode" = "UniversalForward"
"RenderPipeline" = "UniversalPipeline"
}
LOD 100
Name "Depth Fill"
Blend One One
Lighting Off
ZTest Less
Offset -1, 0
ColorMask 0
CGPROGRAM
#pragma vertex vert
#pragma fragment fragEmpty
#include "UnityCG.cginc"
#include "TexturedStableFresnelCommon.cginc"
ENDCG
}
Pass
{
Tags
{
"RenderType" = "Transparent"
"Queue" = "Transparent"
"LightMode" = "Always"
}
LOD 100
Name "Depth Fill"
Blend One One
Lighting Off
ZWrite Off
Offset -1, 0
ColorMask 0
CGPROGRAM
#pragma vertex vert
#pragma fragment fragEmpty
#include "UnityCG.cginc"
#include "TexturedStableFresnelCommon.cginc"
ENDCG
}
// Next, fill in with the base and rim color
Pass
{
Tags
{
"RenderType" = "Transparent"
"Queue" = "Transparent"
}
Name "Fresnel Color"
Blend SrcAlpha OneMinusSrcAlpha
Lighting Off
ZTest LEqual
ZWrite Off
Offset -1, 0
CGPROGRAM
#pragma vertex vert
#pragma fragment fragRimShader
#include "UnityCG.cginc"
#include "TexturedStableFresnelCommon.cginc"
ENDCG
}
}
FallBack "Diffuse"
}

View File

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

View File

@@ -0,0 +1,54 @@
#ifndef STABLE_FRESNEL_COMMON
#define STABLE_FRESNEL_COMMON
half4 _EdgeColor; // Color and alpha of the fresnel effect
half4 _Color; // Color and alpha of the base of the object
half4 _EdgeData; // Min, Max, Power, Blend values
sampler2D _MainTex;
float4 _MainTex_ST;
struct appdata_fresnel
{
float4 vertex : POSITION;
float3 normal : NORMAL;
float2 uv : TEXCOORD0;
UNITY_VERTEX_INPUT_INSTANCE_ID
};
struct fresnel_vertex
{
float4 pos : SV_POSITION;
float3 worldPos : TEXCOORD0;
float3 worldNormal : TEXCOORD1;
float2 uv : TEXCOORD2;
UNITY_VERTEX_OUTPUT_STEREO
};
fresnel_vertex vert(appdata_fresnel v)
{
fresnel_vertex o;
UNITY_SETUP_INSTANCE_ID(v);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
o.uv = o.uv = TRANSFORM_TEX(v.uv, _MainTex);
o.pos = UnityObjectToClipPos(v.vertex);
o.worldPos = mul(unity_ObjectToWorld, v.vertex).xyz;
o.worldNormal = UnityObjectToWorldNormal(v.normal);
return o;
}
half4 fragEmpty(fresnel_vertex i) : COLOR
{
return half4(0,0,0,1);
}
half4 fragRimShader(fresnel_vertex i) : COLOR
{
half3 worldViewDir = normalize(UnityWorldSpaceViewDir(i.worldPos));
half rim = saturate(((1.0 - saturate(dot(normalize(worldViewDir), i.worldNormal))) - _EdgeData.x) / (_EdgeData.y - _EdgeData.x));
half processedRim = (3 + _EdgeData.z) * pow(rim, _EdgeData.z + 1) - (2 + _EdgeData.z) * pow(rim, _EdgeData.z + 2);
return lerp(_Color, _EdgeColor, lerp(rim, processedRim, _EdgeData.w)) * tex2D(_MainTex, i.uv).rgba;
}
#endif // STABLE_FRESNEL_COMMON

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 7e993ba3aff41e5449030adfcd2d5525
ShaderIncludeImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant: