summaryrefslogtreecommitdiff
path: root/VRCSDK3Worlds/Assets/Bakery/ftFarSphereDilate.shader
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--VRCSDK3Worlds/Assets/Bakery/ftFarSphereDilate.shader68
-rw-r--r--VRCSDK3Worlds/Assets/Bakery/ftFarSphereDilate.shader.meta9
2 files changed, 77 insertions, 0 deletions
diff --git a/VRCSDK3Worlds/Assets/Bakery/ftFarSphereDilate.shader b/VRCSDK3Worlds/Assets/Bakery/ftFarSphereDilate.shader
new file mode 100644
index 00000000..29a8d428
--- /dev/null
+++ b/VRCSDK3Worlds/Assets/Bakery/ftFarSphereDilate.shader
@@ -0,0 +1,68 @@
+// 1px dilate
+
+Shader "Hidden/ftFarSphereDilate"
+{
+ Properties
+ {
+ }
+ SubShader
+ {
+ // No culling or depth
+ Cull Off ZWrite Off ZTest Always
+
+ Pass
+ {
+ CGPROGRAM
+ #pragma vertex vert
+ #pragma fragment frag
+
+ #include "UnityCG.cginc"
+
+ struct v2f
+ {
+ float4 vertex : SV_POSITION;
+ float2 uv : TEXCOORD0;
+ };
+
+ v2f vert (uint id : SV_VertexID)
+ {
+ v2f o;
+ float4 pos[6];
+ pos[0] = float4(-1, -1, 0.5, 1);
+ pos[1] = float4(-1, 1, 0.5, 1);
+ pos[2] = float4(1, 1, 0.5, 1);
+
+ pos[3] = float4(1, 1, 0.5, 1);
+ pos[4] = float4(1, -1, 0.5, 1);
+ pos[5] = float4(-1, -1, 0.5, 1);
+
+ o.vertex = pos[id];
+ o.uv = o.vertex.xy * 0.5f + 0.5f;
+ o.uv.y = 1.0f - o.uv.y;
+ return o;
+ }
+
+ sampler2D _MainTex;
+ float _InvCubeSize;
+
+ float4 frag (v2f i) : SV_Target
+ {
+ float4 c = tex2Dlod(_MainTex, float4(i.uv,0,0));
+ if (c.a > 0) return c;
+
+ int dilate = 1;
+ for(int y=-dilate; y<=dilate; y++)
+ {
+ for(int x=-dilate; x<=dilate; x++)
+ {
+ float4 c2 = tex2Dlod(_MainTex, float4(i.uv + float2(x,y) * _InvCubeSize,0,0));
+ if (c2.a > 0) c = c2;
+ }
+ }
+
+ return c;
+ }
+ ENDCG
+ }
+ }
+}
diff --git a/VRCSDK3Worlds/Assets/Bakery/ftFarSphereDilate.shader.meta b/VRCSDK3Worlds/Assets/Bakery/ftFarSphereDilate.shader.meta
new file mode 100644
index 00000000..a473c0fb
--- /dev/null
+++ b/VRCSDK3Worlds/Assets/Bakery/ftFarSphereDilate.shader.meta
@@ -0,0 +1,9 @@
+fileFormatVersion: 2
+guid: 95030fde9d087e447be39fccd8818c93
+timeCreated: 1526836856
+licenseType: Store
+ShaderImporter:
+ defaultTextures: []
+ userData:
+ assetBundleName:
+ assetBundleVariant: