加入很多新内容,这波一块交了
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
Shader "Hidden/Bansonic/GlobalAfterimage"
|
||||
{
|
||||
SubShader
|
||||
{
|
||||
Tags { "RenderPipeline" = "UniversalPipeline" }
|
||||
ZWrite Off
|
||||
Cull Off
|
||||
ZTest Always
|
||||
|
||||
Pass
|
||||
{
|
||||
Name "GlobalAfterimage"
|
||||
|
||||
HLSLPROGRAM
|
||||
#pragma vertex Vert
|
||||
#pragma fragment Frag
|
||||
#pragma target 4.5
|
||||
|
||||
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
|
||||
#include "Packages/com.unity.render-pipelines.core/Runtime/Utilities/Blit.hlsl"
|
||||
|
||||
float _AfterimageOpacity;
|
||||
float _AfterimageScale;
|
||||
TEXTURE2D(_SnapshotTex);
|
||||
SAMPLER(sampler_SnapshotTex);
|
||||
|
||||
half4 Frag(Varyings input) : SV_Target
|
||||
{
|
||||
float2 uv = input.texcoord;
|
||||
half4 baseColor = SAMPLE_TEXTURE2D_X(_BlitTexture, sampler_LinearClamp, uv);
|
||||
|
||||
float safeScale = max(_AfterimageScale, 1.0);
|
||||
float2 scaledUv = (uv - 0.5) / safeScale + 0.5;
|
||||
float inside = step(0.0, scaledUv.x) * step(0.0, scaledUv.y) * step(scaledUv.x, 1.0) * step(scaledUv.y, 1.0);
|
||||
half4 snapshot = SAMPLE_TEXTURE2D(_SnapshotTex, sampler_SnapshotTex, saturate(scaledUv));
|
||||
float alpha = saturate(_AfterimageOpacity) * inside;
|
||||
return lerp(baseColor, snapshot, alpha);
|
||||
}
|
||||
ENDHLSL
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 08e184084ff672d4f8e6b649d27dc10d
|
||||
ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
nonModifiableTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,52 @@
|
||||
Shader "Hidden/Bansonic/GlobalDistortion"
|
||||
{
|
||||
SubShader
|
||||
{
|
||||
Tags { "RenderPipeline" = "UniversalPipeline" }
|
||||
ZWrite Off
|
||||
Cull Off
|
||||
ZTest Always
|
||||
|
||||
Pass
|
||||
{
|
||||
Name "GlobalDistortion"
|
||||
|
||||
HLSLPROGRAM
|
||||
#pragma vertex Vert
|
||||
#pragma fragment Frag
|
||||
#pragma target 4.5
|
||||
|
||||
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
|
||||
#include "Packages/com.unity.render-pipelines.core/Runtime/Utilities/Blit.hlsl"
|
||||
|
||||
float _DistortionIntensity;
|
||||
float _NoiseStrength;
|
||||
float _RadialStrength;
|
||||
float _NoiseScale;
|
||||
float2 _DistortionCenter;
|
||||
float _EdgeFade;
|
||||
|
||||
half4 Frag(Varyings input) : SV_Target
|
||||
{
|
||||
float2 uv = input.texcoord;
|
||||
float2 centered = uv - _DistortionCenter;
|
||||
float distanceFromCenter = length(centered);
|
||||
float2 direction = distanceFromCenter > 0.0001 ? centered / distanceFromCenter : float2(0.0, 0.0);
|
||||
float normalizedDistance = saturate(distanceFromCenter * 1.41421356);
|
||||
float edgeMask = saturate(1.0 - pow(normalizedDistance, _EdgeFade));
|
||||
|
||||
float t = _Time.y;
|
||||
float noiseA = sin((uv.x + t * 0.73) * _NoiseScale) * cos((uv.y - t * 1.13) * (_NoiseScale * 0.87));
|
||||
float noiseB = cos((uv.x * 1.31 - t * 0.41) * (_NoiseScale * 0.63)) * sin((uv.y * 1.11 + t * 0.52) * (_NoiseScale * 1.21));
|
||||
|
||||
float2 radialOffset = direction * edgeMask * (_RadialStrength * 0.03) * _DistortionIntensity;
|
||||
float2 noiseOffset = float2(noiseA, noiseB) * (_NoiseStrength * 0.015) * _DistortionIntensity;
|
||||
float2 sampleUv = uv + radialOffset + noiseOffset;
|
||||
sampleUv = clamp(sampleUv, 0.0, 1.0);
|
||||
|
||||
return SAMPLE_TEXTURE2D_X(_BlitTexture, sampler_LinearClamp, sampleUv);
|
||||
}
|
||||
ENDHLSL
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: dc80b7dbbe782854c9f0c6ae053bfc70
|
||||
ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
nonModifiableTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,71 @@
|
||||
Shader "Hidden/Bansonic/GlobalGlitch"
|
||||
{
|
||||
SubShader
|
||||
{
|
||||
Tags { "RenderPipeline" = "UniversalPipeline" }
|
||||
ZWrite Off
|
||||
Cull Off
|
||||
ZTest Always
|
||||
|
||||
Pass
|
||||
{
|
||||
Name "GlobalGlitch"
|
||||
|
||||
HLSLPROGRAM
|
||||
#pragma vertex Vert
|
||||
#pragma fragment Frag
|
||||
#pragma target 4.5
|
||||
|
||||
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
|
||||
#include "Packages/com.unity.render-pipelines.core/Runtime/Utilities/Blit.hlsl"
|
||||
|
||||
float _GlitchIntensity;
|
||||
float _BlockStrength;
|
||||
float _ColorSplit;
|
||||
float _JitterAmount;
|
||||
float _StripFrequency;
|
||||
float _ScanlineStrength;
|
||||
|
||||
float Hash(float2 p)
|
||||
{
|
||||
p = frac(p * float2(123.34, 345.45));
|
||||
p += dot(p, p + 34.345);
|
||||
return frac(p.x * p.y);
|
||||
}
|
||||
|
||||
half4 Frag(Varyings input) : SV_Target
|
||||
{
|
||||
float2 uv = input.texcoord;
|
||||
float timeSlice = floor(_Time.y * 24.0);
|
||||
float stripIndex = floor(uv.y * _StripFrequency);
|
||||
float stripNoise = Hash(float2(stripIndex, timeSlice));
|
||||
float blockMask = step(0.58, stripNoise);
|
||||
|
||||
float blockShift = (stripNoise - 0.5) * _BlockStrength * 0.12 * _GlitchIntensity * blockMask;
|
||||
float lineJitter = sin((uv.y + _Time.y * 14.0) * 420.0) * _JitterAmount * 0.003 * _GlitchIntensity;
|
||||
float combinedShift = blockShift + lineJitter;
|
||||
|
||||
float2 baseUv = uv;
|
||||
baseUv.x = clamp(baseUv.x + combinedShift, 0.0, 1.0);
|
||||
|
||||
float colorSplit = _ColorSplit * _GlitchIntensity;
|
||||
float2 redUv = float2(clamp(baseUv.x + colorSplit, 0.0, 1.0), baseUv.y);
|
||||
float2 greenUv = baseUv;
|
||||
float2 blueUv = float2(clamp(baseUv.x - colorSplit, 0.0, 1.0), baseUv.y);
|
||||
|
||||
half red = SAMPLE_TEXTURE2D_X(_BlitTexture, sampler_LinearClamp, redUv).r;
|
||||
half green = SAMPLE_TEXTURE2D_X(_BlitTexture, sampler_LinearClamp, greenUv).g;
|
||||
half blue = SAMPLE_TEXTURE2D_X(_BlitTexture, sampler_LinearClamp, blueUv).b;
|
||||
|
||||
half4 color = half4(red, green, blue, 1.0);
|
||||
|
||||
float scan = sin(uv.y * _ScreenParams.y * 1.15 + _Time.y * 12.0) * 0.5 + 0.5;
|
||||
float scanMask = lerp(1.0, 1.0 - scan * 0.35, _ScanlineStrength * _GlitchIntensity);
|
||||
color.rgb *= scanMask;
|
||||
|
||||
return color;
|
||||
}
|
||||
ENDHLSL
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 32a0932fed2df844c8796df10247873b
|
||||
ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
nonModifiableTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,36 @@
|
||||
Shader "Hidden/Bansonic/GlobalMonochrome"
|
||||
{
|
||||
SubShader
|
||||
{
|
||||
Tags { "RenderPipeline" = "UniversalPipeline" }
|
||||
ZWrite Off
|
||||
Cull Off
|
||||
ZTest Always
|
||||
|
||||
Pass
|
||||
{
|
||||
Name "GlobalMonochrome"
|
||||
|
||||
HLSLPROGRAM
|
||||
#pragma vertex Vert
|
||||
#pragma fragment Frag
|
||||
#pragma target 4.5
|
||||
|
||||
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
|
||||
#include "Packages/com.unity.render-pipelines.core/Runtime/Utilities/Blit.hlsl"
|
||||
|
||||
float _MonochromeIntensity;
|
||||
|
||||
half4 Frag(Varyings input) : SV_Target
|
||||
{
|
||||
float2 uv = input.texcoord;
|
||||
half4 color = SAMPLE_TEXTURE2D_X(_BlitTexture, sampler_LinearClamp, uv);
|
||||
half luminance = dot(color.rgb, half3(0.299h, 0.587h, 0.114h));
|
||||
half3 grayscale = luminance.xxx;
|
||||
color.rgb = lerp(color.rgb, grayscale, saturate(_MonochromeIntensity));
|
||||
return color;
|
||||
}
|
||||
ENDHLSL
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: adee8c544438ff3498bececba27c3c76
|
||||
ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
nonModifiableTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user