initial commit

This commit is contained in:
cblech
2025-01-04 13:29:07 +01:00
commit 22f67f4347
124 changed files with 12157 additions and 0 deletions
Binary file not shown.

After

Width:  |  Height:  |  Size: 92 B

@@ -0,0 +1,196 @@
fileFormatVersion: 2
guid: 41acea03acbaebe4a9dc26dd8264449e
TextureImporter:
internalIDToNameTable:
- first:
213: 7482667652216324306
second: Square
externalObjects: {}
serializedVersion: 12
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 0
aniso: 1
mipBias: 0
wrapU: 0
wrapV: 0
wrapW: 0
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 2
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 4
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 0
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: 0
textureType: 0
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 1
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: iPhone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Android
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Server
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: WebGL
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites:
- serializedVersion: 2
name: Square
rect:
serializedVersion: 2
x: 0
y: 0
width: 256
height: 256
alignment: 0
pivot: {x: 0.5, y: 0.5}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
tessellationDetail: 0
bones: []
spriteID: 2d009a6b596c7d760800000000000000
internalID: 7482667652216324306
vertices: []
indices:
edges: []
weights: []
outline: []
physicsShape:
- - {x: -128, y: 128}
- {x: -128, y: -128}
- {x: 128, y: -128}
- {x: 128, y: 128}
bones: []
spriteID: 5e97eb03825dee720800000000000000
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
nameFileIdTable:
Square: 7482667652216324306
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 290431
packageName: Outline 2D/3D
packageVersion: 1.0
assetPath: Assets/Outline/Runtime/Shaders/Checker.png
uploadId: 678360
+184
View File
@@ -0,0 +1,184 @@
Shader "Hidden/OutlineFx/Main"
{
SubShader
{
Pass // 0
{
name "Transparent"
Cull Off
ZWrite Off
ZTest LEqual
Blend SrcAlpha OneMinusSrcAlpha
HLSLPROGRAM
#include "Utils.hlsl"
#pragma vertex vert_mesh
#pragma fragment frag
sampler2D _MainTex;
float4 _Color;
float _Alpha;
// =======================================================================
float4 frag(fragIn i) : SV_Target
{
if (tex2D(_MainTex, i.uv).a < _Alpha)
discard;
return _Color;
}
ENDHLSL
}
Pass // 1
{
name "Outline"
Cull Off
ZWrite Off
ZTest Off
Blend SrcAlpha OneMinusSrcAlpha
HLSLPROGRAM
#include "Utils.hlsl"
#pragma vertex vert_screen
#pragma fragment frag
#pragma multi_compile_local BOX CROSS
#pragma multi_compile_local SOFT HARD
#pragma multi_compile_local _ ALPHA_MASK
#define BLUR_LENGTH 9
#define BLUR_LENGTH_HALF ((BLUR_LENGTH - 1) / 2)
static const float k_BlurWeights[BLUR_LENGTH] =
{
0.046995 * 2,
0.064759 * 2,
0.120985 * 2,
0.176033 * 2,
0.199471 * 2,
0.176033 * 2,
0.120985 * 2,
0.064759 * 2,
0.046995 * 2,
};
sampler2D _MainTex;
sampler2D _AlphaTex;
float4 _AlphaTO;
float2 _Step;
float _Solid;
// =======================================================================
float4 _sample_soft(float2 uv, in const float2 step)
{
float4 result = 0;
uv -= BLUR_LENGTH_HALF * step;
[unroll]
for (int n = 0; n < BLUR_LENGTH; n ++)
{
result += tex2D(_MainTex, uv) * k_BlurWeights[n];
uv += step;
}
return result;
}
float4 _sample_hard(float2 uv, in const float2 step)
{
float4 result = 0;
uv -= BLUR_LENGTH_HALF * step;
[unroll]
for (int n = 0; n < BLUR_LENGTH; n ++)
{
float4 sample = tex2D(_MainTex, uv);
result = max(sample, result);
uv += step;
}
return result;
}
float4 _sample(const float2 uv, in const float2 step)
{
#ifdef SOFT
return _sample_soft(uv, step);
#endif
#ifdef HARD
return _sample_hard(uv, step);
#endif
}
float4 frag(fragIn i) : SV_Target
{
float4 color = tex2D(_MainTex, i.uv);
if (color.a > .0)
{
#ifdef ALPHA_MASK
return float4(color.xyz, color.a * _Solid * tex2D(_AlphaTex, mad(i.uv, _AlphaTO.xy, _AlphaTO.zw)).a);
#endif
return float4(color.xyz, color.a * _Solid);
}
float4 result = 0;
#ifdef BOX
const float2 stepX = float2(_Step.x, 0);
const float2 stepY = float2(0, _Step.y);
float2 uv = i.uv - BLUR_LENGTH_HALF * stepX;
[unroll]
for (int n = 0; n < BLUR_LENGTH; n ++)
{
#ifdef SOFT
result += _sample(uv, stepY) * k_BlurWeights[n];
#endif
#ifdef HARD
result = max(result, _sample(uv, stepY));
#endif
uv += stepX;
}
#endif
#ifdef CROSS
result = (_sample(i.uv, _Step) + _sample(i.uv, float2(_Step.x, -_Step.y))) * .5f;
#endif
return result;
}
ENDHLSL
}
Pass // 2
{
name "Overlay"
Cull Off
ZWrite Off
ZTest Off
Blend SrcAlpha OneMinusSrcAlpha
HLSLPROGRAM
#include "Utils.hlsl"
#pragma vertex vert_screen
#pragma fragment frag
sampler2D _MainTex;
// =======================================================================
float4 frag(fragIn i) : SV_Target
{
return tex2D(_MainTex, i.uv);
}
ENDHLSL
}
}
}
@@ -0,0 +1,16 @@
fileFormatVersion: 2
guid: 9a902e6d68fe8344890c5926c684e820
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 290431
packageName: Outline 2D/3D
packageVersion: 1.0
assetPath: Assets/Outline/Runtime/Shaders/Main.shader
uploadId: 678360
+41
View File
@@ -0,0 +1,41 @@
#ifndef OUTLINE_UTILS_INCLUDED
#define OUTLINE_UTILS_INCLUDED
#include "UnityCG.cginc"
struct vertIn
{
float4 vertex : POSITION;
float2 uv : TEXCOORD0;
};
struct fragIn
{
float4 vertex : SV_POSITION;
float2 uv : TEXCOORD0;
};
fragIn vert_mesh(vertIn v)
{
fragIn o;
o.vertex = UnityObjectToClipPos(v.vertex);
o.uv = v.uv;
return o;
}
fragIn vert_screen(vertIn v)
{
fragIn o;
o.vertex = v.vertex;
o.uv = v.uv;
return o;
}
float random(in const float2 uv)
{
return frac(sin(dot(uv, float2(12.9898, 78.233))) * 43758.5453123);
}
#endif
@@ -0,0 +1,14 @@
fileFormatVersion: 2
guid: 0cda35a27fcc461bb5a4ed317f358de3
ShaderIncludeImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 290431
packageName: Outline 2D/3D
packageVersion: 1.0
assetPath: Assets/Outline/Runtime/Shaders/Utils.hlsl
uploadId: 678360