religion/Assets/Shader/像素化/pixelStyle.shader
Roman f4b96539c5 Squashed commit of the following:
commit 994279b09e8676155176aecbcd43f13ab90f2c92
Author: SAIPO <grasste0403@hotmail.com>
Date:   Mon Nov 29 23:59:44 2021 +0800

    任务:编写效果Shader
    1.增加了通过高斯模糊公式实现的高斯模糊shader(建议用在背景层,让画面有一些景深感觉)
    2.增加了像素化的shader,通过在片元着色器上的uv合并,可以使贴图变为像素风格
    3.增加了闪光划过的shader

commit 271e45aeb97212640573a9faf71483cece293043
Author: SAIPO <grasste0403@hotmail.com>
Date:   Mon Nov 29 23:09:30 2021 +0800

    11.29合并分支

commit dfa618fabaf36626e1b92e7ab34c87d497bcdeb3
Author: SAIPO <grasste0403@hotmail.com>
Date:   Sat Nov 27 13:42:16 2021 +0800

    合并分支

commit de8d79b73e560814ff9fc8a0c3418009682c5ef8
Author: SAIPO <grasste0403@hotmail.com>
Date:   Tue Nov 23 21:25:44 2021 +0800

    任务:搭建Mysql数据库相关框架
    1.完成Mysql动态链接库的导入
    2.实现基本的服务器连接数据框架
    3.实现Sql语句查询框架

# Conflicts:
#	Assets/Behavior Designer/Resources/BehaviorDesignerGlobalVariables.asset.meta
#	Assets/Demigiant/DOTween/Editor.meta
#	Assets/Fungus/Integrations/Playmaker/Fungus-PlayMaker.unitypackage.meta
#	Assets/Fungus/Integrations/Spine/Fungus-Spine.unitypackage.meta
#	Assets/Plugins/Sirenix/Demos/Custom Attribute Processors.unitypackage.meta
#	Assets/Plugins/Sirenix/Demos/Custom Drawers.unitypackage.meta
#	Assets/Plugins/Sirenix/Demos/Editor Windows.unitypackage.meta
#	Assets/Plugins/Sirenix/Demos/Sample - RPG Editor.unitypackage.meta
#	Assets/Shader.meta
#	Assets/Shader/像素化.meta
2021-11-30 00:50:39 +08:00

76 lines
3.3 KiB
Plaintext
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

Shader "Unlit/pixelStyle"
{
//                                     
//                     
//                                
//                  
//                   
//                       
//                      
//                   
//                       
//                   
//                       
//                      
//                         
//                                                                                        
Properties
{
_MainTex("Texture", 2D) = "white" {}
_PixelSize("Pixel Size", Range(1,256)) = 64 //转化后的像素大小
}
SubShader
{
Tags { "RenderType"="Opaque" }
Blend SrcAlpha OneMinusSrcAlpha
LOD 100
Pass
{
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#include "UnityCG.cginc"
struct appdata
{
float4 vertex : POSITION;
float2 uv : TEXCOORD0;
};
struct v2f
{
float2 uv : TEXCOORD0;
float4 vertex : SV_POSITION;
};
sampler2D _MainTex;
float4 _MainTex_ST;
float _PixelSize;
v2f vert (appdata v)
{
v2f o;
o.vertex = UnityObjectToClipPos(v.vertex);
o.uv = TRANSFORM_TEX(v.uv, _MainTex);
return o;
}
fixed4 frag (v2f i) : SV_Target
{
fixed4 col;
float ratioX = (int)(i.uv.x * _PixelSize) / _PixelSize;
float ratioY = (int)(i.uv.y * _PixelSize) / _PixelSize;
col = tex2D(_MainTex, float2(ratioX, ratioY));
if (col.a < 0.5)
{
col.a = 0;
}
return col;
}
ENDCG
}
}
}