diff options
Diffstat (limited to 'Assets/Bundle/Shaders/Common/Image')
4 files changed, 117 insertions, 0 deletions
diff --git a/Assets/Bundle/Shaders/Common/Image/common_img_bloom.cs b/Assets/Bundle/Shaders/Common/Image/common_img_bloom.cs new file mode 100644 index 00000000..a5603324 --- /dev/null +++ b/Assets/Bundle/Shaders/Common/Image/common_img_bloom.cs @@ -0,0 +1,18 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class common_img_bloom : MonoBehaviour +{ + // Start is called before the first frame update + void Start() + { + + } + + // Update is called once per frame + void Update() + { + + } +} diff --git a/Assets/Bundle/Shaders/Common/Image/common_img_bloom.cs.meta b/Assets/Bundle/Shaders/Common/Image/common_img_bloom.cs.meta new file mode 100644 index 00000000..a94e86e5 --- /dev/null +++ b/Assets/Bundle/Shaders/Common/Image/common_img_bloom.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 31492de5533444b49bab8c503b8c6d0f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Bundle/Shaders/Common/Image/common_img_blur.shader b/Assets/Bundle/Shaders/Common/Image/common_img_blur.shader new file mode 100644 index 00000000..2cebb028 --- /dev/null +++ b/Assets/Bundle/Shaders/Common/Image/common_img_blur.shader @@ -0,0 +1,79 @@ +Shader "Erika/Common/Image/Blur" +{ + Properties + { + _MainTex("Texture", 2D) = "white" {} + _Angle("Angle", float) = 0 + _Distance("Distance", float) = 0 + } + + SubShader + { + Tags { "RenderType" = "Opaque" "Queue" = "Transparent-1"} + LOD 100 + + ZWrite Off + ZTest LEqual + + Blend SrcAlpha OneMinusSrcAlpha + + 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 _Angle; + + fixed _Distance; + + 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 + { + _Angle = 0; + _Distance = 0.02f; + + fixed2 uv = i.uv; + fixed2 offset = fixed2(0.05, 0.05); + const float sampleCount = 30; + fixed4 color = fixed4(0,0,0,0); + float radian = radians(_Angle); + float distance = _Distance; + for (int i = 0; i < sampleCount; i++) + { + float dx = distance * cos(radian) / sampleCount * i; + float dy = distance * sin(radian) / sampleCount * i; + color += tex2D(_MainTex,float2(uv.x + dx,uv.y + dy)) * (1 / sampleCount); + } + //color = tex2D(_MainTex, uv); + return color; + } + ENDCG + } + } + +} // shader diff --git a/Assets/Bundle/Shaders/Common/Image/common_img_blur.shader.meta b/Assets/Bundle/Shaders/Common/Image/common_img_blur.shader.meta new file mode 100644 index 00000000..8053135d --- /dev/null +++ b/Assets/Bundle/Shaders/Common/Image/common_img_blur.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 582d2065809e3814c98b6f0806996415 +ShaderImporter: + externalObjects: {} + defaultTextures: [] + nonModifiableTextures: [] + userData: + assetBundleName: + assetBundleVariant: |