# Conflicts:
#	UserSettings/Layouts/default-2021.dwlt
This commit is contained in:
Roman 2022-08-24 10:42:58 +08:00
commit d1fe07492a
71 changed files with 31468 additions and 202 deletions

View File

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: e00e6f90ab8233e46a41c5e33917c642
timeCreated: 1585839223
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 6ecbfd0a046659943a69328c98ff0442
timeCreated: 1520956522
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: c0a0a980c9ba86345bc15411db88d34f
timeCreated: 1585839223
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: a9d68dd8913f05d4d9ce75e7b40c6044
timeCreated: 1575902011
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 191365b4aece81443875ae2bb7243b55
timeCreated: 1539791396
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 9a5e61a8b3421b944863d0946e32da0a
timeCreated: 1531836588
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 4c816894a3147d343891060451241bfe
timeCreated: 1520621352
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: f86c907c9d9e85846835ba31e656bd60
timeCreated: 1550245105
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 4dc1afbcc68875c4780502f5e6b80158
timeCreated: 1540292246
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 5d615bf612f33364e96fb9fd2959ae9c
timeCreated: 1555497476
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: f51b7b861facbc3429fcc5f1f6f91183
timeCreated: 1557327368
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: e137dba02f4d0f542ab09dcedea27314
timeCreated: 1583243128
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 38b4bfd7c725505409f8f4d944961db4
timeCreated: 1622209077
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 3aeabe705b70b154ea99893f91351100
timeCreated: 1607957446
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: b53d2f3b156ff104f90d4d7693d769c8
timeCreated: 1540215707
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 3e8eabcfae1e5aa4397de89fedeb48db
timeCreated: 1555497476
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: f54faaaf4faf8784183ede7f87dfeb23
timeCreated: 1608224299
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 57fcea0ed8b5eb347923c4c21fa31b57
timeCreated: 1569420442
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: f597f19f656ba56eae4f6a3a7cc528f4
timeCreated: 1488828285
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 48e08dc33330d11e9d4a1b246c52e4f6
timeCreated: 1488828285
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: ed09910c0094cb27be8f3ca264680da3
timeCreated: 1488828285
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: cc355dd4cf1e6173beaeb22c2858cbe1
timeCreated: 1488828285
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,8 +1,8 @@
fileFormatVersion: 2
guid: dff05fea7446d7b4e9029bfab77455d2
timeCreated: 1559836117
licenseType: Store
guid: 131a6b21c8605f84396be9f6751fb6e3
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,53 @@
using UnityEngine;
using UnityEngine.Rendering;
using UnityEngine.Rendering.Universal;
public class HLRenderPass : ScriptableRenderPass
{
public Material mMat;
public int blitShaderPassIndex = 0;
public FilterMode filterMode { get; set; }
private RenderTargetIdentifier source { get; set; }
private RenderTargetHandle destination { get; set; }
RenderTargetHandle m_temporaryColorTexture;
string m_ProfilerTag;
public HLRenderPass(string passname, RenderPassEvent _event, Material _mat,float contrast)
{
m_ProfilerTag = passname;
this.renderPassEvent = _event;
mMat = _mat;
mMat.SetFloat("_Contrast", contrast);
m_temporaryColorTexture.Init("temporaryColorTexture");
}
public void Setup(RenderTargetIdentifier src, RenderTargetHandle dest)
{
this.source = src;
this.destination = dest;
}
public override void Execute(ScriptableRenderContext context, ref RenderingData renderingData)
{
CommandBuffer cmd = CommandBufferPool.Get(m_ProfilerTag);
RenderTextureDescriptor opaqueDesc = renderingData.cameraData.cameraTargetDescriptor;
opaqueDesc.depthBufferBits = 0;
if (destination == RenderTargetHandle.CameraTarget)
{
cmd.GetTemporaryRT(m_temporaryColorTexture.id, opaqueDesc, filterMode);
Blit(cmd, source, m_temporaryColorTexture.Identifier(), mMat, blitShaderPassIndex);
Blit(cmd, m_temporaryColorTexture.Identifier(), source);
}
else
{
Blit(cmd, source, destination.Identifier(), mMat, blitShaderPassIndex);
}
context.ExecuteCommandBuffer(cmd);
CommandBufferPool.Release(cmd);
}
public override void FrameCleanup(CommandBuffer cmd)
{
if (destination == RenderTargetHandle.CameraTarget)
cmd.ReleaseTemporaryRT(m_temporaryColorTexture.id);
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 2fc0b119027be2d4da2f16efb178bae5
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,51 @@
using UnityEngine;
using UnityEngine.Rendering;
using UnityEngine.Rendering.Universal;
public class RenderPassFeature : ScriptableRendererFeature
{
public enum Target
{
Color,
Texture
}
[System.Serializable]
public class HLSettings
{
public RenderPassEvent renderPassEvent = RenderPassEvent.AfterRenderingSkybox;
public Material mMat;
public Target destination = Target.Color;
public int blitMaterialPassIndex = -1;
public string textureId = "_ScreenTexture";
public float contrast = 0.5f;
}
public HLSettings settings = new HLSettings();
RenderTargetHandle m_renderTargetHandle;
HLRenderPass m_ScriptablePass;
public override void Create()
{
int passIndex = settings.mMat != null ? settings.mMat.passCount - 1 : 1;
settings.blitMaterialPassIndex = Mathf.Clamp(settings.blitMaterialPassIndex, -1, passIndex);
m_ScriptablePass = new HLRenderPass("HLPostEffectRender", settings.renderPassEvent, settings.mMat, settings.contrast);
m_renderTargetHandle.Init(settings.textureId);
}
public override void AddRenderPasses(ScriptableRenderer renderer, ref RenderingData renderingData)
{
var src = renderer.cameraColorTarget;
var dest = (settings.destination == Target.Color) ? RenderTargetHandle.CameraTarget : m_renderTargetHandle;
if (settings.mMat == null)
{
Debug.LogWarningFormat("丢失blit材质");
return;
}
m_ScriptablePass.Setup(src,dest);
renderer.EnqueuePass(m_ScriptablePass);
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 144de74964a842543b3eae9a30640d04
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 2cda990e2423bbf4892e6590ba056729
guid: 71dba31e516132f4e9ceb8e8198ccc60
DefaultImporter:
externalObjects: {}
userData:

View File

@ -1,8 +1,8 @@
fileFormatVersion: 2
guid: d1c0b77896049554fa4b635531caf741
timeCreated: 1533059192
licenseType: Store
guid: cd254df9ac5b0a44f9e2746ecfe7b438
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,8 +1,8 @@
fileFormatVersion: 2
guid: f7c4e22642de60d448f4e4809190f7b1
timeCreated: 1559837332
licenseType: Store
guid: f883b378e1126e941808091ce7a5a9dc
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: e75b27a51ebb26441ab440154f20ffa4
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,44 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Shader Graphs_fire
m_Shader: {fileID: -6465566751694194690, guid: 39a82e87889eab841b3c04366be2875c, type: 3}
m_ValidKeywords: []
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _MainTex:
m_Texture: {fileID: 2800000, guid: c51d2b2ddb542b04f8f0236a9c645557, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_Lightmaps:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_LightmapsInd:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_ShadowMasks:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- Vector1_1124929359104cdab19d273f42e1cb7e: 2.86
- Vector1_2d89981c066d4b71a45102c5060147ff: 0.42
m_Colors: []
m_BuildTextureStacks: []

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: ba3b3f056455c994788ca474ffd7fbac
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load Diff

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 178 KiB

View File

@ -0,0 +1,98 @@
fileFormatVersion: 2
guid: c51d2b2ddb542b04f8f0236a9c645557
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 11
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
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMasterTextureLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 1
wrapV: 1
wrapW: 1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
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: []
outline: []
physicsShape: []
bones: []
spriteID: 5e97eb03825dee720800000000000000
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
nameFileIdTable: {}
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 725da784668487546b08142f568bd50c
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

View File

@ -0,0 +1,114 @@
Shader "Unlit/GaussianBlur"
{
//
//                                                   
//                                      
//                
//                                  
//                            
//                           
//                                     
//                         
//                           
//                             
//                                    
//                            
//                                       
//                                                                                                                      
Properties
{
_MainTex ("Texture", 2D) = "white" {} //基础贴图
_BlurRadius ("BlurRadius", Range(2, 15)) = 5 //模糊半径
_TextureSize ("TextureSize", Float) = 640
}
SubShader
{
Tags { "RenderType"="Opaque" }
LOD 100
Pass
{
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#pragma multi_compile_fog
#include "UnityCG.cginc"
struct appdata
{
float4 vertex : POSITION;
float2 uv : TEXCOORD0;
};
struct v2f
{
float2 uv : TEXCOORD0;
float4 vertex : SV_POSITION;
};
sampler2D _MainTex;
int _BlurRadius;
float _TextureSize;
float GetGaussWeight(float x, float y, float sigma)
{
float sigma2 = pow(sigma, 2.0f); //pow 次方公式 这里是平方
float left = 1 / (2 * sigma2 * 3.1415926f);
float right = exp(-(x*x+y*y)/(2*sigma2)); //e的指数幂
return left * right;
}
fixed4 GaussBlur(float2 uv) //高斯模糊 根据高斯公式计算出的颜色值
{
float sigma = (float)_BlurRadius / 3.0f;//权重
float4 col = float4(0, 0, 0, 0);
for (int x = - _BlurRadius; x <= _BlurRadius; ++x)
{
for (int y = - _BlurRadius; y <= _BlurRadius; ++y)
{
//获取周围像素的颜色
//转为uv上的坐标值
float4 color = tex2D(_MainTex, uv + float2(x / _TextureSize, y / _TextureSize));
//获取此像素的权重
float weight = GetGaussWeight(x, y, sigma);
//计算此点的最终颜色
col += color * weight; //颜色乘以权重
}
}
return col;
}
fixed4 SimpleBlur(float2 uv)
{
float4 col = float4(0, 0, 0, 0);
for (int x = - _BlurRadius; x <= _BlurRadius; ++x)
{
for (int y = - _BlurRadius; y <= _BlurRadius; ++y)
{
float4 color = tex2D(_MainTex, uv + float2(x / _TextureSize, y / _TextureSize));
col += color;
}
}
//取平均数,所取像素为边长为(半径*2+1)的矩阵
col = col / pow(_BlurRadius * 2 + 1, 2.0f);
return col;
}
v2f vert (appdata v)
{
v2f o;
o.vertex = UnityObjectToClipPos(v.vertex);
o.uv = v.uv;
return o;
}
fixed4 frag (v2f i) : SV_Target
{
float4 col = SimpleBlur(i.uv);
return col;
}
ENDCG
}
}
}

View File

@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: a35e938d77637794697b9b222e9589df
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
preprocessorOverride: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,32 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Unlit_GaussianBlur
m_Shader: {fileID: 4800000, guid: a35e938d77637794697b9b222e9589df, type: 3}
m_ValidKeywords: []
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _BlurRadius: 5
- _TextureSize: 640
m_Colors: []
m_BuildTextureStacks: []

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: beee38ef51bb5454c87f3fecc9c6badd
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 77cca44b3d63444498bbb01061dd6bf3
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,44 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: "Shader Graphs_\u6EB6\u89E3"
m_Shader: {fileID: -6465566751694194690, guid: 9db5a464f06fd7e4b957800e1be3cea6, type: 3}
m_ValidKeywords: []
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_Lightmaps:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_LightmapsInd:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_ShadowMasks:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- Vector1_1e04cf3781c84b43bbb152f7f3df932e: 0.36
- Vector1_abc0e12f459c4084a7b64935c6dc891a: 0.82
m_Colors: []
m_BuildTextureStacks: []

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 69109d965f47b0e49ab0a28ea4b0b7c3
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load Diff

View File

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

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: a27060eda4ecba04b8206c84b1cc55cf
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,71 @@
Shader "my/Additive Color" {
Properties {
_TintColor ("Tint Color", Color) = (0.5,0.5,0.5,0.5)
_MainTex ("Particle Texture", 2D) = "white" {}
_PixelSize("Pixel Size", Range(1,256)) = 64 //转化后的像素大小
}
Category {
Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" "PreviewType"="Plane" }
Blend SrcAlpha One
ColorMask RGB
Cull Off Lighting Off ZWrite Off
SubShader {
Pass {
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#pragma target 2.0
#pragma multi_compile_particles
#pragma multi_compile_fog
#include "UnityCG.cginc"
sampler2D _MainTex;
fixed4 _TintColor;
struct appdata_t {
float4 vertex : POSITION;
fixed4 color : COLOR;
float2 texcoord : TEXCOORD0;
UNITY_VERTEX_INPUT_INSTANCE_ID
};
struct v2f {
float4 vertex : SV_POSITION;
fixed4 color : COLOR;
float2 texcoord : TEXCOORD0;
UNITY_VERTEX_OUTPUT_STEREO
};
float4 _MainTex_ST;
float _PixelSize;
v2f vert (appdata_t v)
{
v2f o;
UNITY_SETUP_INSTANCE_ID(v);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
o.vertex = UnityObjectToClipPos(v.vertex);
o.color = v.color;
o.texcoord = TRANSFORM_TEX(v.texcoord,_MainTex);
return o;
}
UNITY_DECLARE_DEPTH_TEXTURE(_CameraDepthTexture);
fixed4 frag (v2f i) : SV_Target
{
float ratioX = (int)(i.texcoord.x * _PixelSize) / _PixelSize;
float ratioY = (int)(i.texcoord.y * _PixelSize) / _PixelSize;
fixed4 col = 2.0f * i.color * _TintColor * tex2D(_MainTex, float2(ratioX, ratioY));
col.a = saturate(col.a); // alpha should not have double-brightness applied to it, but we can't fix that legacy behavior without breaking everyone's effects, so instead clamp the output to get sensible HDR behavior (case 967476)
return col;
}
ENDCG
}
}
}
}

View File

@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 29fc7f1c9b430d14cab1f63613d026c7
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
preprocessorOverride: 0
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

View File

@ -0,0 +1,98 @@
fileFormatVersion: 2
guid: 3b6c4fa01f9ec334696d43647d33b981
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 11
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
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMasterTextureLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 1
wrapV: 1
wrapW: 1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
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: []
outline: []
physicsShape: []
bones: []
spriteID: 5e97eb03825dee720800000000000000
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
nameFileIdTable: {}
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,44 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: huichen
m_Shader: {fileID: -6465566751694194690, guid: 39a82e87889eab841b3c04366be2875c, type: 3}
m_ValidKeywords: []
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _MainTex:
m_Texture: {fileID: 2800000, guid: 3b6c4fa01f9ec334696d43647d33b981, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_Lightmaps:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_LightmapsInd:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_ShadowMasks:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- Vector1_1124929359104cdab19d273f42e1cb7e: 0.29
- Vector1_2d89981c066d4b71a45102c5060147ff: 0.41
m_Colors: []
m_BuildTextureStacks: []

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 84fe29be285cded4dbcf274fed5ddd34
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,32 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: my_Additive Color
m_Shader: {fileID: 4800000, guid: 29fc7f1c9b430d14cab1f63613d026c7, type: 3}
m_ValidKeywords: []
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _MainTex:
m_Texture: {fileID: 2800000, guid: 3b6c4fa01f9ec334696d43647d33b981, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _PixelSize: 13
m_Colors:
- _TintColor: {r: 0.5, g: 0.5, b: 0.5, a: 0.5}
m_BuildTextureStacks: []

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: c5125f1105b610e42bff78eac682e473
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: b1f7c78e59c8f8b4a9c610c170cb19a6
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: e416f25598192fe4f99378e3e04f852b
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,36 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Custom_Flash
m_Shader: {fileID: 4800000, guid: 0b7845e010545e14097d8f1ed2307bc7, type: 3}
m_ValidKeywords: []
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _Angle: 75
- _DelayTime: 0.2
- _FlashTime: 1
- _LoopInterval: 2
- _Width: 0.2
m_Colors:
- _Color: {r: 1, g: 1, b: 1, a: 1}
m_BuildTextureStacks: []

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 6fb9b13f22d56284fab036b68cfb14c8
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,121 @@
Shader "Custom/Flash"
{
//                        
//               
//                     
//                      
//                      
//             
//                       
//                      
//                     
//                  
//                   
//                     
//                
Properties
{
_MainTex ("Base (RGB), Alpha (A)", 2D) = "black" {}
_Color("Color", Color) = (1,1,1,1)
_Angle("angle", Range(0, 360)) = 75
_Width("width", Range(0, 1)) = 0.2
_FlashTime("flash time", Range(0, 100)) = 1
_DelayTime("delay time", Range(0, 100)) = 0.2
_LoopInterval("interval time", Range(0, 100)) = 2
}
SubShader
{
LOD 200
Tags
{
"Queue" = "Transparent"
"IgnoreProjector" = "True"
"RenderType" = "Transparent"
}
Pass
{
Cull Off
Lighting Off
ZWrite Off
Fog { Mode Off }
Offset -1, -1
Blend SrcAlpha OneMinusSrcAlpha
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#include "UnityCG.cginc"
sampler2D _MainTex;
float4 _Color;
float _Angle;
float _Width;
float _FlashTime;
float _DelayTime;
float _LoopInterval;
float4 _MainTex_ST;
struct appdata_t
{
float4 vertex : POSITION;
float2 texcoord : TEXCOORD0;
fixed4 color : COLOR;
};
struct v2f
{
float4 vertex : SV_POSITION;
half2 texcoord : TEXCOORD0;
fixed4 color : COLOR;
};
v2f o;
v2f vert (appdata_t v)
{
o.vertex = UnityObjectToClipPos(v.vertex);
o.texcoord = v.texcoord;
o.color = v.color;
return o;
}
// 计算亮度
//角度 宽度(x方向) 运行时间 开始时间 循环间隔
float flash(float2 uv, float angle, float w, float runtime, float delay, float interval)
{
float brightness = 0;
float radian = 0.0174444 * angle;
float curtime = _Time.y; //当前时间
float starttime = floor(curtime/interval) * interval; //本次flash开始时间
float passtime = curtime - starttime;//本次flash流逝时间
if (passtime > delay)
{
float projx = uv.y / tan(radian); //y的x投影长度
float br = (passtime - delay) / runtime; //底部右边界
float bl = br - w; //底部左边界
float posr = br + projx; //此点所在行右边界
float posl = bl + projx; //此点所在行左边界
if (uv.x > posl && uv.x < posr)
{
float mid = (posl + posr) * 0.5; //flash中心点
brightness = 1 - abs(uv.x - mid)/(w*0.5);
}
}
return brightness;
}
float4 frag (v2f i) : COLOR
{
float4 col = tex2D(_MainTex, i.texcoord);
float bright = flash(i.texcoord, _Angle, _Width, _FlashTime, _DelayTime, _LoopInterval);
float4 outcol = col + _Color*bright * col.a;// * step(0.5, col.a);
return outcol;
}
ENDCG
}
}
}

View File

@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 0b7845e010545e14097d8f1ed2307bc7
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
preprocessorOverride: 0
userData:
assetBundleName:
assetBundleVariant:

8
Assets/霄/场景.meta Normal file
View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 1d618ef50ec03ff44880c57c07e7875a
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 2d7fe4f7c19e90f41b893bc01fc17230
guid: 5d3cafc2bff4f014b9941cd80a7dde4a
DefaultImporter:
externalObjects: {}
userData:

File diff suppressed because it is too large Load Diff

View File

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

View File

@ -544,7 +544,7 @@ PlayerSettings:
webGLThreadsSupport: 0
webGLDecompressionFallback: 0
scriptingDefineSymbols:
Standalone: ODIN_INSPECTOR;ODIN_INSPECTOR_3
Standalone: ODIN_INSPECTOR;ODIN_INSPECTOR_3;AMPLIFY_SHADER_EDITOR
additionalCompilerArguments: {}
platformArchitecture: {}
scriptingBackend: {}

View File

@ -0,0 +1,16 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &1
MonoBehaviour:
m_ObjectHideFlags: 61
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: de02f9e1d18f588468e474319d09a723, type: 3}
m_Name:
m_EditorClassIdentifier:
customInterpolatorErrorThreshold: 32
customInterpolatorWarningThreshold: 16

View File

@ -6,32 +6,44 @@ EditorUserSettings:
serializedVersion: 4
m_ConfigSettings:
RecentlyUsedSceneGuid-0:
value: 515250075c0c595e5f5a5e71122159444e4e4a2f7a7d7f602f284d66b4b76661
flags: 0
RecentlyUsedSceneGuid-1:
value: 5550060701065c085e5c5924162609444f4f4b297e70226674284564b1b8326d
flags: 0
RecentlyUsedSceneGuid-2:
value: 0204525104005f5f5e5d5526117b0b44424e4073752d2536747c1b31e7b3673c
flags: 0
RecentlyUsedSceneGuid-3:
RecentlyUsedSceneGuid-1:
value: 02020157070050580c5b582340215c44464f4b297f7d7e64792d1c62b1e16269
flags: 0
RecentlyUsedSceneGuid-4:
RecentlyUsedSceneGuid-2:
value: 54000c5304065f580b5d5f7045730c444315197c75797f317f714a60b2b6323d
flags: 0
RecentlyUsedSceneGuid-5:
value: 5b520d0503545b0d0c0c0a2715770748154f4d2c7d7d7e627a7d4a35b4e1646a
flags: 0
RecentlyUsedSceneGuid-6:
RecentlyUsedSceneGuid-3:
value: 05080302550c580e080c092712740644154f19737e7872697d284a64b4e2663e
flags: 0
RecentlyUsedSceneGuid-7:
RecentlyUsedSceneGuid-4:
value: 5b520d0503545b0d0c0c0a2715770748154f4d2c7d7d7e627a7d4a35b4e1646a
flags: 0
RecentlyUsedSceneGuid-5:
value: 02070656525008025e595f23132659444f4e4178787c756679784f35e3b8373e
flags: 0
RecentlyUsedSceneGuid-8:
RecentlyUsedSceneGuid-6:
value: 5603015e5556080c0b585e27167308444f4e1c2e7c7f7132797e1f31b4b76c3c
flags: 0
RecentlyUsedSceneGuid-7:
value: 0155065451575c020b575877137b5a4414161c2b287e2068792b4a67e3e4326d
flags: 0
RecentlyUsedSceneGuid-8:
value: 0057010504575e595c085a7b46200f4417161a797a7f24667e704966b5b3643e
flags: 0
RecentlyUsedSceneGuid-9:
value: 5655070504530a090f080a7616730e44144e417e7d2b22687d284a37e6e56039
flags: 0
UnityEditor.ShaderGraph.Blackboard:
value: 18135939215a0a5004000b0e15254b524c030a3f2964643d120d1230e9e93a3fd6e826abbd2e2d293c4ead313b08042de6030a0afa240c0d020be94c4ba75e435d8715fa32c70d15d11612dacc11fee5d3c5d1fe9ab1bf968e93e2ffcbc3e7e2f0b3ffe0e8b0be9af8ffaeffff8e85dd8390e3949c8899daa7
flags: 0
UnityEditor.ShaderGraph.FloatingWindowsLayout2:
value: 181344140043005e1a220d3b1f364b524c0c5a27130c293326201334cee5322ca0bd30e8eb293a707b0fd0180b3d0a36fc0d3d04e649500d1002ee0b5dbd1d2c27c00ad113cb1e10e41f1addc80993b98d9884a69ae6d8f0d1cda9e8fbfefaf9f9dea3fdb9ade882f0f7b0e1e380cafbf2c3adc18e9cd285a2908b82ec869c8395949c9483d68a8e97ddbd90bf
flags: 0
UnityEditor.ShaderGraph.InspectorWindow:
value: 18135939215a0a5004000b0e15254b524c1119263f2d6a722016393ce1eb3d36e5d339f9a5602b2e2c07a37e0901373ae01e0008f707250d171df81a53a5485d41895ac825e0100ec20313c0d91cddccd3d0c7efcca9bd80908fecb0f9cfddf1eff4e7a1b1eae482f0fcaee1e1928b86d888ed969b938797a7cf
flags: 0
vcSharedLogLevel:
value: 0d5e400f0650
flags: 0