├── .npmignore ├── .npmrc ├── CHANGELOG.md ├── CHANGELOG.md.meta ├── LICENSE.md ├── LICENSE.md.meta ├── README.md ├── README.md.meta ├── Shaders.meta ├── Shaders ├── Blending.cginc ├── Blending.cginc.meta ├── Sprites.meta ├── Sprites │ ├── Add.shader │ ├── Add.shader.meta │ ├── Average.shader │ ├── Average.shader.meta │ ├── ColorBurn.shader │ ├── ColorBurn.shader.meta │ ├── ColorDodge.shader │ ├── ColorDodge.shader.meta │ ├── Darken.shader │ ├── Darken.shader.meta │ ├── Difference.shader │ ├── Difference.shader.meta │ ├── Exclusion.shader │ ├── Exclusion.shader.meta │ ├── Glow.shader │ ├── Glow.shader.meta │ ├── HardLight.shader │ ├── HardLight.shader.meta │ ├── HardMix.shader │ ├── HardMix.shader.meta │ ├── Lighten.shader │ ├── Lighten.shader.meta │ ├── LinearBurn.shader │ ├── LinearBurn.shader.meta │ ├── LinearDodge.shader │ ├── LinearDodge.shader.meta │ ├── LinearLight.shader │ ├── LinearLight.shader.meta │ ├── Multiply.shader │ ├── Multiply.shader.meta │ ├── Negation.shader │ ├── Negation.shader.meta │ ├── Overlay.shader │ ├── Overlay.shader.meta │ ├── Phoenix.shader │ ├── Phoenix.shader.meta │ ├── PinLight.shader │ ├── PinLight.shader.meta │ ├── Reflect.shader │ ├── Reflect.shader.meta │ ├── Screen.shader │ ├── Screen.shader.meta │ ├── SoftLight.shader │ ├── SoftLight.shader.meta │ ├── Subtract.shader │ ├── Subtract.shader.meta │ ├── VividLight.shader │ └── VividLight.shader.meta ├── Surface.meta └── Surface │ ├── Add.shader │ ├── Add.shader.meta │ ├── Average.shader │ ├── Average.shader.meta │ ├── ColorBurn.shader │ ├── ColorBurn.shader.meta │ ├── ColorDodge.shader │ ├── ColorDodge.shader.meta │ ├── Darken.shader │ ├── Darken.shader.meta │ ├── Difference.shader │ ├── Difference.shader.meta │ ├── Exclusion.shader │ ├── Exclusion.shader.meta │ ├── Glow.shader │ ├── Glow.shader.meta │ ├── HardLight.shader │ ├── HardLight.shader.meta │ ├── HardMix.shader │ ├── HardMix.shader.meta │ ├── Lighten.shader │ ├── Lighten.shader.meta │ ├── LinearBurn.shader │ ├── LinearBurn.shader.meta │ ├── LinearDodge.shader │ ├── LinearDodge.shader.meta │ ├── LinearLight.shader │ ├── LinearLight.shader.meta │ ├── Multiply.shader │ ├── Multiply.shader.meta │ ├── Negation.shader │ ├── Negation.shader.meta │ ├── Overlay.shader │ ├── Overlay.shader.meta │ ├── Phoenix.shader │ ├── Phoenix.shader.meta │ ├── PinLight.shader │ ├── PinLight.shader.meta │ ├── Reflect.shader │ ├── Reflect.shader.meta │ ├── Screen.shader │ ├── Screen.shader.meta │ ├── SoftLight.shader │ ├── SoftLight.shader.meta │ ├── Subtract.shader │ ├── Subtract.shader.meta │ ├── VividLight.shader │ └── VividLight.shader.meta ├── package.json └── package.json.meta /.npmignore: -------------------------------------------------------------------------------- 1 | .github/ 2 | -------------------------------------------------------------------------------- /.npmrc: -------------------------------------------------------------------------------- 1 | registry=https://registry.npmjs.org/ 2 | @zigurous:registry=https://npm.pkg.github.com 3 | //npm.pkg.github.com/:_authToken= 4 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | All notable changes to this project will be documented in this file. 4 | 5 | The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), 6 | and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). 7 | 8 | ## [2.0.0] - 2022/05/24 9 | 10 | ### Added 11 | 12 | - Added all new vertex/fragment shaders for 2D sprites 13 | - Added support for blend textures 14 | - Added support for partial blending using the alpha channel 15 | 16 | ## [1.0.3] - 2021/04/13 17 | 18 | ### Fixed 19 | 20 | - Moved non-compiled assets outside of the Runtime directory 21 | 22 | ## [1.0.2] - 2021/03/21 23 | 24 | ### Changed 25 | 26 | - Adjusted shader syntax/formatting 27 | 28 | ## [1.0.1] - 2021/03/07 29 | 30 | ### Changed 31 | 32 | - Updated package metadata 33 | 34 | ## [1.0.0] - 2021/02/16 35 | 36 | ### Added 37 | 38 | - Add.shader 39 | - Average.shader 40 | - Blending.cginc 41 | - ColorBurn.shader 42 | - ColorDodge.shader 43 | - Darken.shader 44 | - Difference.shader 45 | - Exclusion.shader 46 | - Glow.shader 47 | - HardLight.shader 48 | - HardMix.shader 49 | - Lighten.shader 50 | - LinearBurn.shader 51 | - LinearDodge.shader 52 | - LinearLight.shader 53 | - Multiply.shader 54 | - Negation.shader 55 | - Overlay.shader 56 | - Phoenix.shader 57 | - PinLight.shader 58 | - Reflect.shader 59 | - Screen.shader 60 | - SoftLight.shader 61 | - Subtract.shader 62 | - VividLight.shader 63 | -------------------------------------------------------------------------------- /CHANGELOG.md.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7873d09286f018543a5a3f640c24114d 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Zigurous 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /LICENSE.md.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 506284a9873540d4f9abff615f5c5abd 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Blend Shaders 2 | 3 | [![](https://img.shields.io/badge/github-repo-blue?logo=github)](https://github.com/zigurous/unity-blend-shaders) [![](https://img.shields.io/github/package-json/v/zigurous/unity-blend-shaders)](https://github.com/zigurous/unity-blend-shaders/releases) [![](https://img.shields.io/github/license/zigurous/unity-blend-shaders)](https://github.com/zigurous/unity-blend-shaders/blob/main/LICENSE.md) 4 | 5 | The **Blend Shaders** package contains over 20 shaders for blending textures and sprites in Unity (based on Photoshop's blend modes), and it contains a cginc file with a standalone function for each of the blend modes. 6 | 7 | ## Supported Modes 8 | 9 | - Add 10 | - Average 11 | - Color Burn 12 | - Color Dodge 13 | - Darken 14 | - Difference 15 | - Exclusion 16 | - Glow 17 | - Hard Light 18 | - Hard Mix 19 | - Lighten 20 | - Linear Dodge 21 | - Linear Light 22 | - Multiply 23 | - Negation 24 | - Overlay 25 | - Phoenix 26 | - Pin Light 27 | - Reflect 28 | - Screen 29 | - Soft Light 30 | - Subtract 31 | - Vivid Light 32 | 33 | ## Installation 34 | 35 | Use the Unity [Package Manager](https://docs.unity3d.com/Manual/upm-ui.html) to install the **Blend Shaders** package. 36 | 37 | 1. Open the Package Manager in `Window > Package Manager` 38 | 2. Click the add (`+`) button in the status bar 39 | 3. Select `Add package from git URL` from the add menu 40 | 4. Enter the following Git URL in the text box and click Add: 41 | 42 | ``` 43 | https://github.com/zigurous/unity-blend-shaders.git 44 | ``` 45 | -------------------------------------------------------------------------------- /README.md.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fbe744df266e0344aace16b2059a34a6 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Shaders.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3cb840d44cdd3264793b0477728bed35 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Shaders/Blending.cginc: -------------------------------------------------------------------------------- 1 | fixed3 add(fixed3 a, fixed3 b) 2 | { 3 | return min(a + b, 1.0); 4 | } 5 | 6 | fixed3 average(fixed3 a, fixed3 b) 7 | { 8 | return (a + b) / 2.0; 9 | } 10 | 11 | fixed3 colorBurn(fixed3 a, fixed3 b) 12 | { 13 | return b == 0.0 ? b : max((1.0 - ((1.0 - a) / b)), 0.0); 14 | } 15 | 16 | fixed3 colorDodge(fixed3 a, fixed3 b) 17 | { 18 | return b == 1.0 ? b : min(a / (1.0 - b), 1.0); 19 | } 20 | 21 | fixed3 darken(fixed3 a, fixed3 b) 22 | { 23 | return min(a, b); 24 | } 25 | 26 | fixed3 difference(fixed3 a, fixed3 b) 27 | { 28 | return abs(a - b); 29 | } 30 | 31 | fixed3 exclusion(fixed3 a, fixed3 b) 32 | { 33 | return a + b - 2.0 * a * b; 34 | } 35 | 36 | fixed3 glow(fixed3 a, fixed3 b) 37 | { 38 | return (a == 1.0) ? a : min(b * b / (1.0 - a), 1.0); 39 | } 40 | 41 | fixed3 hardLight(fixed3 a, fixed3 b) 42 | { 43 | return b < 0.5 ? (2.0 * a * b) : (1.0 - 2.0 * (1.0 - a) * (1.0 - b)); 44 | } 45 | 46 | fixed3 lighten(fixed3 a, fixed3 b) 47 | { 48 | return max(a, b); 49 | } 50 | 51 | fixed3 linearBurn(fixed3 a, fixed3 b) 52 | { 53 | return max(a + b - 1.0, 0.0); 54 | } 55 | 56 | fixed3 linearDodge(fixed3 a, fixed3 b) 57 | { 58 | return min(a + b, 1.0); 59 | } 60 | 61 | fixed3 linearLight(fixed3 a, fixed3 b) 62 | { 63 | return b < 0.5 ? linearBurn(a, (2.0 * b)) : linearDodge(a, (2.0 * (b - 0.5))); 64 | } 65 | 66 | fixed3 multiply(fixed3 a, fixed3 b) 67 | { 68 | return a * b; 69 | } 70 | 71 | fixed3 negation(fixed3 a, fixed3 b) 72 | { 73 | return 1.0 - abs(1.0 - a - b); 74 | } 75 | 76 | fixed3 normal(fixed3 a, fixed3 b) 77 | { 78 | return b; 79 | } 80 | 81 | fixed3 overlay(fixed3 a, fixed3 b) 82 | { 83 | return a < 0.5 ? (2.0 * a * b) : (1.0 - 2.0 * (1.0 - a) * (1.0 - b)); 84 | } 85 | 86 | fixed3 phoenix(fixed3 a, fixed3 b) 87 | { 88 | return min(a, b) - max(a, b) + 1.0; 89 | } 90 | 91 | fixed3 pinLight(fixed3 a, fixed3 b) 92 | { 93 | return (b < 0.5) ? darken(a, (2.0 * b)) : lighten(a, (2.0 * (b - 0.5))); 94 | } 95 | 96 | fixed3 reflect(fixed3 a, fixed3 b) 97 | { 98 | return (b == 1.0) ? b : min(a * a / (1.0 - b), 1.0); 99 | } 100 | 101 | fixed3 screen(fixed3 a, fixed3 b) 102 | { 103 | return 1.0 - (1.0 - a) * (1.0 - b); 104 | } 105 | 106 | fixed3 softLight(fixed3 a, fixed3 b) 107 | { 108 | return (b < 0.5) ? (2.0 * a * b + a * a * (1.0 - 2.0 * b)) : (sqrt(a) * (2.0 * b - 1.0) + (2.0 * a) * (1.0 - b)); 109 | } 110 | 111 | fixed3 subtract(fixed3 a, fixed3 b) 112 | { 113 | return max(a + b - 1.0, 0.0); 114 | } 115 | 116 | fixed3 vividLight(fixed3 a, fixed3 b) 117 | { 118 | return (b < 0.5) ? colorBurn(a, (2.0 * b)) : colorDodge(a, (2.0 * (b - 0.5))); 119 | } 120 | 121 | fixed3 hardMix(fixed3 a, fixed3 b) 122 | { 123 | return vividLight(a, b) < 0.5 ? 0.0 : 1.0; 124 | } 125 | -------------------------------------------------------------------------------- /Shaders/Blending.cginc.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 94d982810e8f9fb45bbe8fe795f6e3f3 3 | ShaderImporter: 4 | externalObjects: {} 5 | defaultTextures: [] 6 | nonModifiableTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Shaders/Sprites.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bfac7d26d22e0874ea94562e1f08f86d 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Shaders/Sprites/Add.shader: -------------------------------------------------------------------------------- 1 | Shader "Zigurous/Blending/Sprites/Add" 2 | { 3 | Properties 4 | { 5 | _Color ("Main Color", Color) = (1,1,1,1) 6 | _MainTex ("Main Texture", 2D) = "white" {} 7 | 8 | _BlendColor ("Blend Color", Color) = (1,1,1,1) 9 | _BlendTex ("Blend Texture", 2D) = "white" {} 10 | } 11 | 12 | SubShader 13 | { 14 | Tags 15 | { 16 | "RenderType"="Transparent" 17 | "Queue"="Transparent" 18 | } 19 | 20 | Blend SrcAlpha OneMinusSrcAlpha 21 | ZWrite off 22 | Cull off 23 | 24 | Pass 25 | { 26 | 27 | CGPROGRAM 28 | 29 | #include "UnityCG.cginc" 30 | #include "../Blending.cginc" 31 | 32 | #pragma vertex vert 33 | #pragma fragment frag 34 | 35 | sampler2D _MainTex; 36 | sampler2D _BlendTex; 37 | 38 | float4 _MainTex_ST; 39 | float4 _BlendTex_ST; 40 | 41 | fixed4 _Color; 42 | fixed4 _BlendColor; 43 | 44 | struct appdata 45 | { 46 | float4 vertex : POSITION; 47 | float2 uv_MainTex : TEXCOORD0; 48 | float2 uv_BlendTex : TEXCOORD1; 49 | fixed4 color : COLOR; 50 | }; 51 | 52 | struct v2f 53 | { 54 | float4 position : SV_POSITION; 55 | float2 uv_MainTex : TEXCOORD0; 56 | float2 uv_BlendTex : TEXCOORD1; 57 | fixed4 color : COLOR; 58 | }; 59 | 60 | v2f vert(appdata v) 61 | { 62 | v2f o; 63 | o.position = UnityObjectToClipPos(v.vertex); 64 | o.uv_MainTex = TRANSFORM_TEX(v.uv_MainTex, _MainTex); 65 | o.uv_BlendTex = TRANSFORM_TEX(v.uv_BlendTex, _BlendTex); 66 | o.color = v.color; 67 | return o; 68 | } 69 | 70 | fixed4 frag(v2f i) : SV_TARGET 71 | { 72 | fixed4 a = tex2D(_MainTex, i.uv_MainTex) * _Color; 73 | fixed4 b = tex2D(_BlendTex, i.uv_BlendTex) * _BlendColor; 74 | 75 | return fixed4(lerp(a, add(a, b), _BlendColor.a), a.a) * i.color; 76 | } 77 | 78 | ENDCG 79 | } 80 | 81 | } 82 | 83 | } 84 | -------------------------------------------------------------------------------- /Shaders/Sprites/Add.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: dc75e67aba5234445888c2f9b11d16e8 3 | ShaderImporter: 4 | externalObjects: {} 5 | defaultTextures: [] 6 | nonModifiableTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Shaders/Sprites/Average.shader: -------------------------------------------------------------------------------- 1 | Shader "Zigurous/Blending/Sprites/Average" 2 | { 3 | Properties 4 | { 5 | _Color ("Main Color", Color) = (1,1,1,1) 6 | _MainTex ("Main Texture", 2D) = "white" {} 7 | 8 | _BlendColor ("Blend Color", Color) = (1,1,1,1) 9 | _BlendTex ("Blend Texture", 2D) = "white" {} 10 | } 11 | 12 | SubShader 13 | { 14 | Tags 15 | { 16 | "RenderType"="Transparent" 17 | "Queue"="Transparent" 18 | } 19 | 20 | Blend SrcAlpha OneMinusSrcAlpha 21 | ZWrite off 22 | Cull off 23 | 24 | Pass 25 | { 26 | 27 | CGPROGRAM 28 | 29 | #include "UnityCG.cginc" 30 | #include "../Blending.cginc" 31 | 32 | #pragma vertex vert 33 | #pragma fragment frag 34 | 35 | sampler2D _MainTex; 36 | sampler2D _BlendTex; 37 | 38 | float4 _MainTex_ST; 39 | float4 _BlendTex_ST; 40 | 41 | fixed4 _Color; 42 | fixed4 _BlendColor; 43 | 44 | struct appdata 45 | { 46 | float4 vertex : POSITION; 47 | float2 uv_MainTex : TEXCOORD0; 48 | float2 uv_BlendTex : TEXCOORD1; 49 | fixed4 color : COLOR; 50 | }; 51 | 52 | struct v2f 53 | { 54 | float4 position : SV_POSITION; 55 | float2 uv_MainTex : TEXCOORD0; 56 | float2 uv_BlendTex : TEXCOORD1; 57 | fixed4 color : COLOR; 58 | }; 59 | 60 | v2f vert(appdata v) 61 | { 62 | v2f o; 63 | o.position = UnityObjectToClipPos(v.vertex); 64 | o.uv_MainTex = TRANSFORM_TEX(v.uv_MainTex, _MainTex); 65 | o.uv_BlendTex = TRANSFORM_TEX(v.uv_BlendTex, _BlendTex); 66 | o.color = v.color; 67 | return o; 68 | } 69 | 70 | fixed4 frag(v2f i) : SV_TARGET 71 | { 72 | fixed4 a = tex2D(_MainTex, i.uv_MainTex) * _Color; 73 | fixed4 b = tex2D(_BlendTex, i.uv_BlendTex) * _BlendColor; 74 | 75 | return fixed4(lerp(a, average(a, b), _BlendColor.a), a.a) * i.color; 76 | } 77 | 78 | ENDCG 79 | } 80 | 81 | } 82 | 83 | } 84 | -------------------------------------------------------------------------------- /Shaders/Sprites/Average.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a3f425c7549ca7241b26e0fa0579aa21 3 | ShaderImporter: 4 | externalObjects: {} 5 | defaultTextures: [] 6 | nonModifiableTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Shaders/Sprites/ColorBurn.shader: -------------------------------------------------------------------------------- 1 | Shader "Zigurous/Blending/Sprites/Color Burn" 2 | { 3 | Properties 4 | { 5 | _Color ("Main Color", Color) = (1,1,1,1) 6 | _MainTex ("Main Texture", 2D) = "white" {} 7 | 8 | _BlendColor ("Blend Color", Color) = (1,1,1,1) 9 | _BlendTex ("Blend Texture", 2D) = "white" {} 10 | } 11 | 12 | SubShader 13 | { 14 | Tags 15 | { 16 | "RenderType"="Transparent" 17 | "Queue"="Transparent" 18 | } 19 | 20 | Blend SrcAlpha OneMinusSrcAlpha 21 | ZWrite off 22 | Cull off 23 | 24 | Pass 25 | { 26 | 27 | CGPROGRAM 28 | 29 | #include "UnityCG.cginc" 30 | #include "../Blending.cginc" 31 | 32 | #pragma vertex vert 33 | #pragma fragment frag 34 | 35 | sampler2D _MainTex; 36 | sampler2D _BlendTex; 37 | 38 | float4 _MainTex_ST; 39 | float4 _BlendTex_ST; 40 | 41 | fixed4 _Color; 42 | fixed4 _BlendColor; 43 | 44 | struct appdata 45 | { 46 | float4 vertex : POSITION; 47 | float2 uv_MainTex : TEXCOORD0; 48 | float2 uv_BlendTex : TEXCOORD1; 49 | fixed4 color : COLOR; 50 | }; 51 | 52 | struct v2f 53 | { 54 | float4 position : SV_POSITION; 55 | float2 uv_MainTex : TEXCOORD0; 56 | float2 uv_BlendTex : TEXCOORD1; 57 | fixed4 color : COLOR; 58 | }; 59 | 60 | v2f vert(appdata v) 61 | { 62 | v2f o; 63 | o.position = UnityObjectToClipPos(v.vertex); 64 | o.uv_MainTex = TRANSFORM_TEX(v.uv_MainTex, _MainTex); 65 | o.uv_BlendTex = TRANSFORM_TEX(v.uv_BlendTex, _BlendTex); 66 | o.color = v.color; 67 | return o; 68 | } 69 | 70 | fixed4 frag(v2f i) : SV_TARGET 71 | { 72 | fixed4 a = tex2D(_MainTex, i.uv_MainTex) * _Color; 73 | fixed4 b = tex2D(_BlendTex, i.uv_BlendTex) * _BlendColor; 74 | 75 | return fixed4(lerp(a, colorBurn(a, b), _BlendColor.a), a.a) * i.color; 76 | } 77 | 78 | ENDCG 79 | } 80 | 81 | } 82 | 83 | } 84 | -------------------------------------------------------------------------------- /Shaders/Sprites/ColorBurn.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2fe4241d652058844b8f328b41c9fc57 3 | ShaderImporter: 4 | externalObjects: {} 5 | defaultTextures: [] 6 | nonModifiableTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Shaders/Sprites/ColorDodge.shader: -------------------------------------------------------------------------------- 1 | Shader "Zigurous/Blending/Sprites/Color Dodge" 2 | { 3 | Properties 4 | { 5 | _Color ("Main Color", Color) = (1,1,1,1) 6 | _MainTex ("Main Texture", 2D) = "white" {} 7 | 8 | _BlendColor ("Blend Color", Color) = (1,1,1,1) 9 | _BlendTex ("Blend Texture", 2D) = "white" {} 10 | } 11 | 12 | SubShader 13 | { 14 | Tags 15 | { 16 | "RenderType"="Transparent" 17 | "Queue"="Transparent" 18 | } 19 | 20 | Blend SrcAlpha OneMinusSrcAlpha 21 | ZWrite off 22 | Cull off 23 | 24 | Pass 25 | { 26 | 27 | CGPROGRAM 28 | 29 | #include "UnityCG.cginc" 30 | #include "../Blending.cginc" 31 | 32 | #pragma vertex vert 33 | #pragma fragment frag 34 | 35 | sampler2D _MainTex; 36 | sampler2D _BlendTex; 37 | 38 | float4 _MainTex_ST; 39 | float4 _BlendTex_ST; 40 | 41 | fixed4 _Color; 42 | fixed4 _BlendColor; 43 | 44 | struct appdata 45 | { 46 | float4 vertex : POSITION; 47 | float2 uv_MainTex : TEXCOORD0; 48 | float2 uv_BlendTex : TEXCOORD1; 49 | fixed4 color : COLOR; 50 | }; 51 | 52 | struct v2f 53 | { 54 | float4 position : SV_POSITION; 55 | float2 uv_MainTex : TEXCOORD0; 56 | float2 uv_BlendTex : TEXCOORD1; 57 | fixed4 color : COLOR; 58 | }; 59 | 60 | v2f vert(appdata v) 61 | { 62 | v2f o; 63 | o.position = UnityObjectToClipPos(v.vertex); 64 | o.uv_MainTex = TRANSFORM_TEX(v.uv_MainTex, _MainTex); 65 | o.uv_BlendTex = TRANSFORM_TEX(v.uv_BlendTex, _BlendTex); 66 | o.color = v.color; 67 | return o; 68 | } 69 | 70 | fixed4 frag(v2f i) : SV_TARGET 71 | { 72 | fixed4 a = tex2D(_MainTex, i.uv_MainTex) * _Color; 73 | fixed4 b = tex2D(_BlendTex, i.uv_BlendTex) * _BlendColor; 74 | 75 | return fixed4(lerp(a, colorDodge(a, b), _BlendColor.a), a.a) * i.color; 76 | } 77 | 78 | ENDCG 79 | } 80 | 81 | } 82 | 83 | } 84 | -------------------------------------------------------------------------------- /Shaders/Sprites/ColorDodge.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0e4836a2d6e4f164ba3b4381311b3849 3 | ShaderImporter: 4 | externalObjects: {} 5 | defaultTextures: [] 6 | nonModifiableTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Shaders/Sprites/Darken.shader: -------------------------------------------------------------------------------- 1 | Shader "Zigurous/Blending/Sprites/Darken" 2 | { 3 | Properties 4 | { 5 | _Color ("Main Color", Color) = (1,1,1,1) 6 | _MainTex ("Main Texture", 2D) = "white" {} 7 | 8 | _BlendColor ("Blend Color", Color) = (1,1,1,1) 9 | _BlendTex ("Blend Texture", 2D) = "white" {} 10 | } 11 | 12 | SubShader 13 | { 14 | Tags 15 | { 16 | "RenderType"="Transparent" 17 | "Queue"="Transparent" 18 | } 19 | 20 | Blend SrcAlpha OneMinusSrcAlpha 21 | ZWrite off 22 | Cull off 23 | 24 | Pass 25 | { 26 | 27 | CGPROGRAM 28 | 29 | #include "UnityCG.cginc" 30 | #include "../Blending.cginc" 31 | 32 | #pragma vertex vert 33 | #pragma fragment frag 34 | 35 | sampler2D _MainTex; 36 | sampler2D _BlendTex; 37 | 38 | float4 _MainTex_ST; 39 | float4 _BlendTex_ST; 40 | 41 | fixed4 _Color; 42 | fixed4 _BlendColor; 43 | 44 | struct appdata 45 | { 46 | float4 vertex : POSITION; 47 | float2 uv_MainTex : TEXCOORD0; 48 | float2 uv_BlendTex : TEXCOORD1; 49 | fixed4 color : COLOR; 50 | }; 51 | 52 | struct v2f 53 | { 54 | float4 position : SV_POSITION; 55 | float2 uv_MainTex : TEXCOORD0; 56 | float2 uv_BlendTex : TEXCOORD1; 57 | fixed4 color : COLOR; 58 | }; 59 | 60 | v2f vert(appdata v) 61 | { 62 | v2f o; 63 | o.position = UnityObjectToClipPos(v.vertex); 64 | o.uv_MainTex = TRANSFORM_TEX(v.uv_MainTex, _MainTex); 65 | o.uv_BlendTex = TRANSFORM_TEX(v.uv_BlendTex, _BlendTex); 66 | o.color = v.color; 67 | return o; 68 | } 69 | 70 | fixed4 frag(v2f i) : SV_TARGET 71 | { 72 | fixed4 a = tex2D(_MainTex, i.uv_MainTex) * _Color; 73 | fixed4 b = tex2D(_BlendTex, i.uv_BlendTex) * _BlendColor; 74 | 75 | return fixed4(lerp(a, darken(a, b), _BlendColor.a), a.a) * i.color; 76 | } 77 | 78 | ENDCG 79 | } 80 | 81 | } 82 | 83 | } 84 | -------------------------------------------------------------------------------- /Shaders/Sprites/Darken.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 13034ac56e135e847913cd7153348202 3 | ShaderImporter: 4 | externalObjects: {} 5 | defaultTextures: [] 6 | nonModifiableTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Shaders/Sprites/Difference.shader: -------------------------------------------------------------------------------- 1 | Shader "Zigurous/Blending/Sprites/Difference" 2 | { 3 | Properties 4 | { 5 | _Color ("Main Color", Color) = (1,1,1,1) 6 | _MainTex ("Main Texture", 2D) = "white" {} 7 | 8 | _BlendColor ("Blend Color", Color) = (1,1,1,1) 9 | _BlendTex ("Blend Texture", 2D) = "white" {} 10 | } 11 | 12 | SubShader 13 | { 14 | Tags 15 | { 16 | "RenderType"="Transparent" 17 | "Queue"="Transparent" 18 | } 19 | 20 | Blend SrcAlpha OneMinusSrcAlpha 21 | ZWrite off 22 | Cull off 23 | 24 | Pass 25 | { 26 | 27 | CGPROGRAM 28 | 29 | #include "UnityCG.cginc" 30 | #include "../Blending.cginc" 31 | 32 | #pragma vertex vert 33 | #pragma fragment frag 34 | 35 | sampler2D _MainTex; 36 | sampler2D _BlendTex; 37 | 38 | float4 _MainTex_ST; 39 | float4 _BlendTex_ST; 40 | 41 | fixed4 _Color; 42 | fixed4 _BlendColor; 43 | 44 | struct appdata 45 | { 46 | float4 vertex : POSITION; 47 | float2 uv_MainTex : TEXCOORD0; 48 | float2 uv_BlendTex : TEXCOORD1; 49 | fixed4 color : COLOR; 50 | }; 51 | 52 | struct v2f 53 | { 54 | float4 position : SV_POSITION; 55 | float2 uv_MainTex : TEXCOORD0; 56 | float2 uv_BlendTex : TEXCOORD1; 57 | fixed4 color : COLOR; 58 | }; 59 | 60 | v2f vert(appdata v) 61 | { 62 | v2f o; 63 | o.position = UnityObjectToClipPos(v.vertex); 64 | o.uv_MainTex = TRANSFORM_TEX(v.uv_MainTex, _MainTex); 65 | o.uv_BlendTex = TRANSFORM_TEX(v.uv_BlendTex, _BlendTex); 66 | o.color = v.color; 67 | return o; 68 | } 69 | 70 | fixed4 frag(v2f i) : SV_TARGET 71 | { 72 | fixed4 a = tex2D(_MainTex, i.uv_MainTex) * _Color; 73 | fixed4 b = tex2D(_BlendTex, i.uv_BlendTex) * _BlendColor; 74 | 75 | return fixed4(lerp(a, difference(a, b), _BlendColor.a), a.a) * i.color; 76 | } 77 | 78 | ENDCG 79 | } 80 | 81 | } 82 | 83 | } 84 | -------------------------------------------------------------------------------- /Shaders/Sprites/Difference.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f99bedbae6c80784fa509f3320d70bab 3 | ShaderImporter: 4 | externalObjects: {} 5 | defaultTextures: [] 6 | nonModifiableTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Shaders/Sprites/Exclusion.shader: -------------------------------------------------------------------------------- 1 | Shader "Zigurous/Blending/Sprites/Exclusion" 2 | { 3 | Properties 4 | { 5 | _Color ("Main Color", Color) = (1,1,1,1) 6 | _MainTex ("Main Texture", 2D) = "white" {} 7 | 8 | _BlendColor ("Blend Color", Color) = (1,1,1,1) 9 | _BlendTex ("Blend Texture", 2D) = "white" {} 10 | } 11 | 12 | SubShader 13 | { 14 | Tags 15 | { 16 | "RenderType"="Transparent" 17 | "Queue"="Transparent" 18 | } 19 | 20 | Blend SrcAlpha OneMinusSrcAlpha 21 | ZWrite off 22 | Cull off 23 | 24 | Pass 25 | { 26 | 27 | CGPROGRAM 28 | 29 | #include "UnityCG.cginc" 30 | #include "../Blending.cginc" 31 | 32 | #pragma vertex vert 33 | #pragma fragment frag 34 | 35 | sampler2D _MainTex; 36 | sampler2D _BlendTex; 37 | 38 | float4 _MainTex_ST; 39 | float4 _BlendTex_ST; 40 | 41 | fixed4 _Color; 42 | fixed4 _BlendColor; 43 | 44 | struct appdata 45 | { 46 | float4 vertex : POSITION; 47 | float2 uv_MainTex : TEXCOORD0; 48 | float2 uv_BlendTex : TEXCOORD1; 49 | fixed4 color : COLOR; 50 | }; 51 | 52 | struct v2f 53 | { 54 | float4 position : SV_POSITION; 55 | float2 uv_MainTex : TEXCOORD0; 56 | float2 uv_BlendTex : TEXCOORD1; 57 | fixed4 color : COLOR; 58 | }; 59 | 60 | v2f vert(appdata v) 61 | { 62 | v2f o; 63 | o.position = UnityObjectToClipPos(v.vertex); 64 | o.uv_MainTex = TRANSFORM_TEX(v.uv_MainTex, _MainTex); 65 | o.uv_BlendTex = TRANSFORM_TEX(v.uv_BlendTex, _BlendTex); 66 | o.color = v.color; 67 | return o; 68 | } 69 | 70 | fixed4 frag(v2f i) : SV_TARGET 71 | { 72 | fixed4 a = tex2D(_MainTex, i.uv_MainTex) * _Color; 73 | fixed4 b = tex2D(_BlendTex, i.uv_BlendTex) * _BlendColor; 74 | 75 | return fixed4(lerp(a, exclusion(a, b), _BlendColor.a), a.a) * i.color; 76 | } 77 | 78 | ENDCG 79 | } 80 | 81 | } 82 | 83 | } 84 | -------------------------------------------------------------------------------- /Shaders/Sprites/Exclusion.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0ae86d5ee2fd81b41b95ecc5a40caddd 3 | ShaderImporter: 4 | externalObjects: {} 5 | defaultTextures: [] 6 | nonModifiableTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Shaders/Sprites/Glow.shader: -------------------------------------------------------------------------------- 1 | Shader "Zigurous/Blending/Sprites/Glow" 2 | { 3 | Properties 4 | { 5 | _Color ("Main Color", Color) = (1,1,1,1) 6 | _MainTex ("Main Texture", 2D) = "white" {} 7 | 8 | _BlendColor ("Blend Color", Color) = (1,1,1,1) 9 | _BlendTex ("Blend Texture", 2D) = "white" {} 10 | } 11 | 12 | SubShader 13 | { 14 | Tags 15 | { 16 | "RenderType"="Transparent" 17 | "Queue"="Transparent" 18 | } 19 | 20 | Blend SrcAlpha OneMinusSrcAlpha 21 | ZWrite off 22 | Cull off 23 | 24 | Pass 25 | { 26 | 27 | CGPROGRAM 28 | 29 | #include "UnityCG.cginc" 30 | #include "../Blending.cginc" 31 | 32 | #pragma vertex vert 33 | #pragma fragment frag 34 | 35 | sampler2D _MainTex; 36 | sampler2D _BlendTex; 37 | 38 | float4 _MainTex_ST; 39 | float4 _BlendTex_ST; 40 | 41 | fixed4 _Color; 42 | fixed4 _BlendColor; 43 | 44 | struct appdata 45 | { 46 | float4 vertex : POSITION; 47 | float2 uv_MainTex : TEXCOORD0; 48 | float2 uv_BlendTex : TEXCOORD1; 49 | fixed4 color : COLOR; 50 | }; 51 | 52 | struct v2f 53 | { 54 | float4 position : SV_POSITION; 55 | float2 uv_MainTex : TEXCOORD0; 56 | float2 uv_BlendTex : TEXCOORD1; 57 | fixed4 color : COLOR; 58 | }; 59 | 60 | v2f vert(appdata v) 61 | { 62 | v2f o; 63 | o.position = UnityObjectToClipPos(v.vertex); 64 | o.uv_MainTex = TRANSFORM_TEX(v.uv_MainTex, _MainTex); 65 | o.uv_BlendTex = TRANSFORM_TEX(v.uv_BlendTex, _BlendTex); 66 | o.color = v.color; 67 | return o; 68 | } 69 | 70 | fixed4 frag(v2f i) : SV_TARGET 71 | { 72 | fixed4 a = tex2D(_MainTex, i.uv_MainTex) * _Color; 73 | fixed4 b = tex2D(_BlendTex, i.uv_BlendTex) * _BlendColor; 74 | 75 | return fixed4(lerp(a, glow(a, b), _BlendColor.a), a.a) * i.color; 76 | } 77 | 78 | ENDCG 79 | } 80 | 81 | } 82 | 83 | } 84 | -------------------------------------------------------------------------------- /Shaders/Sprites/Glow.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3836cd4278a69394783bc3de70f614dc 3 | ShaderImporter: 4 | externalObjects: {} 5 | defaultTextures: [] 6 | nonModifiableTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Shaders/Sprites/HardLight.shader: -------------------------------------------------------------------------------- 1 | Shader "Zigurous/Blending/Sprites/Hard Light" 2 | { 3 | Properties 4 | { 5 | _Color ("Main Color", Color) = (1,1,1,1) 6 | _MainTex ("Main Texture", 2D) = "white" {} 7 | 8 | _BlendColor ("Blend Color", Color) = (1,1,1,1) 9 | _BlendTex ("Blend Texture", 2D) = "white" {} 10 | } 11 | 12 | SubShader 13 | { 14 | Tags 15 | { 16 | "RenderType"="Transparent" 17 | "Queue"="Transparent" 18 | } 19 | 20 | Blend SrcAlpha OneMinusSrcAlpha 21 | ZWrite off 22 | Cull off 23 | 24 | Pass 25 | { 26 | 27 | CGPROGRAM 28 | 29 | #include "UnityCG.cginc" 30 | #include "../Blending.cginc" 31 | 32 | #pragma vertex vert 33 | #pragma fragment frag 34 | 35 | sampler2D _MainTex; 36 | sampler2D _BlendTex; 37 | 38 | float4 _MainTex_ST; 39 | float4 _BlendTex_ST; 40 | 41 | fixed4 _Color; 42 | fixed4 _BlendColor; 43 | 44 | struct appdata 45 | { 46 | float4 vertex : POSITION; 47 | float2 uv_MainTex : TEXCOORD0; 48 | float2 uv_BlendTex : TEXCOORD1; 49 | fixed4 color : COLOR; 50 | }; 51 | 52 | struct v2f 53 | { 54 | float4 position : SV_POSITION; 55 | float2 uv_MainTex : TEXCOORD0; 56 | float2 uv_BlendTex : TEXCOORD1; 57 | fixed4 color : COLOR; 58 | }; 59 | 60 | v2f vert(appdata v) 61 | { 62 | v2f o; 63 | o.position = UnityObjectToClipPos(v.vertex); 64 | o.uv_MainTex = TRANSFORM_TEX(v.uv_MainTex, _MainTex); 65 | o.uv_BlendTex = TRANSFORM_TEX(v.uv_BlendTex, _BlendTex); 66 | o.color = v.color; 67 | return o; 68 | } 69 | 70 | fixed4 frag(v2f i) : SV_TARGET 71 | { 72 | fixed4 a = tex2D(_MainTex, i.uv_MainTex) * _Color; 73 | fixed4 b = tex2D(_BlendTex, i.uv_BlendTex) * _BlendColor; 74 | 75 | return fixed4(lerp(a, hardLight(a, b), _BlendColor.a), a.a) * i.color; 76 | } 77 | 78 | ENDCG 79 | } 80 | 81 | } 82 | 83 | } 84 | -------------------------------------------------------------------------------- /Shaders/Sprites/HardLight.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2fbcb62bbb9b6074fb062eb22e2d8b95 3 | ShaderImporter: 4 | externalObjects: {} 5 | defaultTextures: [] 6 | nonModifiableTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Shaders/Sprites/HardMix.shader: -------------------------------------------------------------------------------- 1 | Shader "Zigurous/Blending/Sprites/Hard Mix" 2 | { 3 | Properties 4 | { 5 | _Color ("Main Color", Color) = (1,1,1,1) 6 | _MainTex ("Main Texture", 2D) = "white" {} 7 | 8 | _BlendColor ("Blend Color", Color) = (1,1,1,1) 9 | _BlendTex ("Blend Texture", 2D) = "white" {} 10 | } 11 | 12 | SubShader 13 | { 14 | Tags 15 | { 16 | "RenderType"="Transparent" 17 | "Queue"="Transparent" 18 | } 19 | 20 | Blend SrcAlpha OneMinusSrcAlpha 21 | ZWrite off 22 | Cull off 23 | 24 | Pass 25 | { 26 | 27 | CGPROGRAM 28 | 29 | #include "UnityCG.cginc" 30 | #include "../Blending.cginc" 31 | 32 | #pragma vertex vert 33 | #pragma fragment frag 34 | 35 | sampler2D _MainTex; 36 | sampler2D _BlendTex; 37 | 38 | float4 _MainTex_ST; 39 | float4 _BlendTex_ST; 40 | 41 | fixed4 _Color; 42 | fixed4 _BlendColor; 43 | 44 | struct appdata 45 | { 46 | float4 vertex : POSITION; 47 | float2 uv_MainTex : TEXCOORD0; 48 | float2 uv_BlendTex : TEXCOORD1; 49 | fixed4 color : COLOR; 50 | }; 51 | 52 | struct v2f 53 | { 54 | float4 position : SV_POSITION; 55 | float2 uv_MainTex : TEXCOORD0; 56 | float2 uv_BlendTex : TEXCOORD1; 57 | fixed4 color : COLOR; 58 | }; 59 | 60 | v2f vert(appdata v) 61 | { 62 | v2f o; 63 | o.position = UnityObjectToClipPos(v.vertex); 64 | o.uv_MainTex = TRANSFORM_TEX(v.uv_MainTex, _MainTex); 65 | o.uv_BlendTex = TRANSFORM_TEX(v.uv_BlendTex, _BlendTex); 66 | o.color = v.color; 67 | return o; 68 | } 69 | 70 | fixed4 frag(v2f i) : SV_TARGET 71 | { 72 | fixed4 a = tex2D(_MainTex, i.uv_MainTex) * _Color; 73 | fixed4 b = tex2D(_BlendTex, i.uv_BlendTex) * _BlendColor; 74 | 75 | return fixed4(lerp(a, hardMix(a, b), _BlendColor.a), a.a) * i.color; 76 | } 77 | 78 | ENDCG 79 | } 80 | 81 | } 82 | 83 | } 84 | -------------------------------------------------------------------------------- /Shaders/Sprites/HardMix.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7a5ebede8efbe984e8c069b261a6284f 3 | ShaderImporter: 4 | externalObjects: {} 5 | defaultTextures: [] 6 | nonModifiableTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Shaders/Sprites/Lighten.shader: -------------------------------------------------------------------------------- 1 | Shader "Zigurous/Blending/Sprites/Lighten" 2 | { 3 | Properties 4 | { 5 | _Color ("Main Color", Color) = (1,1,1,1) 6 | _MainTex ("Main Texture", 2D) = "white" {} 7 | 8 | _BlendColor ("Blend Color", Color) = (1,1,1,1) 9 | _BlendTex ("Blend Texture", 2D) = "white" {} 10 | } 11 | 12 | SubShader 13 | { 14 | Tags 15 | { 16 | "RenderType"="Transparent" 17 | "Queue"="Transparent" 18 | } 19 | 20 | Blend SrcAlpha OneMinusSrcAlpha 21 | ZWrite off 22 | Cull off 23 | 24 | Pass 25 | { 26 | 27 | CGPROGRAM 28 | 29 | #include "UnityCG.cginc" 30 | #include "../Blending.cginc" 31 | 32 | #pragma vertex vert 33 | #pragma fragment frag 34 | 35 | sampler2D _MainTex; 36 | sampler2D _BlendTex; 37 | 38 | float4 _MainTex_ST; 39 | float4 _BlendTex_ST; 40 | 41 | fixed4 _Color; 42 | fixed4 _BlendColor; 43 | 44 | struct appdata 45 | { 46 | float4 vertex : POSITION; 47 | float2 uv_MainTex : TEXCOORD0; 48 | float2 uv_BlendTex : TEXCOORD1; 49 | fixed4 color : COLOR; 50 | }; 51 | 52 | struct v2f 53 | { 54 | float4 position : SV_POSITION; 55 | float2 uv_MainTex : TEXCOORD0; 56 | float2 uv_BlendTex : TEXCOORD1; 57 | fixed4 color : COLOR; 58 | }; 59 | 60 | v2f vert(appdata v) 61 | { 62 | v2f o; 63 | o.position = UnityObjectToClipPos(v.vertex); 64 | o.uv_MainTex = TRANSFORM_TEX(v.uv_MainTex, _MainTex); 65 | o.uv_BlendTex = TRANSFORM_TEX(v.uv_BlendTex, _BlendTex); 66 | o.color = v.color; 67 | return o; 68 | } 69 | 70 | fixed4 frag(v2f i) : SV_TARGET 71 | { 72 | fixed4 a = tex2D(_MainTex, i.uv_MainTex) * _Color; 73 | fixed4 b = tex2D(_BlendTex, i.uv_BlendTex) * _BlendColor; 74 | 75 | return fixed4(lerp(a, lighten(a, b), _BlendColor.a), a.a) * i.color; 76 | } 77 | 78 | ENDCG 79 | } 80 | 81 | } 82 | 83 | } 84 | -------------------------------------------------------------------------------- /Shaders/Sprites/Lighten.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 597802bffbe46c9478b0dc36609bc51a 3 | ShaderImporter: 4 | externalObjects: {} 5 | defaultTextures: [] 6 | nonModifiableTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Shaders/Sprites/LinearBurn.shader: -------------------------------------------------------------------------------- 1 | Shader "Zigurous/Blending/Sprites/Linear Burn" 2 | { 3 | Properties 4 | { 5 | _Color ("Main Color", Color) = (1,1,1,1) 6 | _MainTex ("Main Texture", 2D) = "white" {} 7 | 8 | _BlendColor ("Blend Color", Color) = (1,1,1,1) 9 | _BlendTex ("Blend Texture", 2D) = "white" {} 10 | } 11 | 12 | SubShader 13 | { 14 | Tags 15 | { 16 | "RenderType"="Transparent" 17 | "Queue"="Transparent" 18 | } 19 | 20 | Blend SrcAlpha OneMinusSrcAlpha 21 | ZWrite off 22 | Cull off 23 | 24 | Pass 25 | { 26 | 27 | CGPROGRAM 28 | 29 | #include "UnityCG.cginc" 30 | #include "../Blending.cginc" 31 | 32 | #pragma vertex vert 33 | #pragma fragment frag 34 | 35 | sampler2D _MainTex; 36 | sampler2D _BlendTex; 37 | 38 | float4 _MainTex_ST; 39 | float4 _BlendTex_ST; 40 | 41 | fixed4 _Color; 42 | fixed4 _BlendColor; 43 | 44 | struct appdata 45 | { 46 | float4 vertex : POSITION; 47 | float2 uv_MainTex : TEXCOORD0; 48 | float2 uv_BlendTex : TEXCOORD1; 49 | fixed4 color : COLOR; 50 | }; 51 | 52 | struct v2f 53 | { 54 | float4 position : SV_POSITION; 55 | float2 uv_MainTex : TEXCOORD0; 56 | float2 uv_BlendTex : TEXCOORD1; 57 | fixed4 color : COLOR; 58 | }; 59 | 60 | v2f vert(appdata v) 61 | { 62 | v2f o; 63 | o.position = UnityObjectToClipPos(v.vertex); 64 | o.uv_MainTex = TRANSFORM_TEX(v.uv_MainTex, _MainTex); 65 | o.uv_BlendTex = TRANSFORM_TEX(v.uv_BlendTex, _BlendTex); 66 | o.color = v.color; 67 | return o; 68 | } 69 | 70 | fixed4 frag(v2f i) : SV_TARGET 71 | { 72 | fixed4 a = tex2D(_MainTex, i.uv_MainTex) * _Color; 73 | fixed4 b = tex2D(_BlendTex, i.uv_BlendTex) * _BlendColor; 74 | 75 | return fixed4(lerp(a, linearBurn(a, b), _BlendColor.a), a.a) * i.color; 76 | } 77 | 78 | ENDCG 79 | } 80 | 81 | } 82 | 83 | } 84 | -------------------------------------------------------------------------------- /Shaders/Sprites/LinearBurn.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c0a3f9672cd6ee04f8aa9fcd87d0380d 3 | ShaderImporter: 4 | externalObjects: {} 5 | defaultTextures: [] 6 | nonModifiableTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Shaders/Sprites/LinearDodge.shader: -------------------------------------------------------------------------------- 1 | Shader "Zigurous/Blending/Sprites/Linear Dodge" 2 | { 3 | Properties 4 | { 5 | _Color ("Main Color", Color) = (1,1,1,1) 6 | _MainTex ("Main Texture", 2D) = "white" {} 7 | 8 | _BlendColor ("Blend Color", Color) = (1,1,1,1) 9 | _BlendTex ("Blend Texture", 2D) = "white" {} 10 | } 11 | 12 | SubShader 13 | { 14 | Tags 15 | { 16 | "RenderType"="Transparent" 17 | "Queue"="Transparent" 18 | } 19 | 20 | Blend SrcAlpha OneMinusSrcAlpha 21 | ZWrite off 22 | Cull off 23 | 24 | Pass 25 | { 26 | 27 | CGPROGRAM 28 | 29 | #include "UnityCG.cginc" 30 | #include "../Blending.cginc" 31 | 32 | #pragma vertex vert 33 | #pragma fragment frag 34 | 35 | sampler2D _MainTex; 36 | sampler2D _BlendTex; 37 | 38 | float4 _MainTex_ST; 39 | float4 _BlendTex_ST; 40 | 41 | fixed4 _Color; 42 | fixed4 _BlendColor; 43 | 44 | struct appdata 45 | { 46 | float4 vertex : POSITION; 47 | float2 uv_MainTex : TEXCOORD0; 48 | float2 uv_BlendTex : TEXCOORD1; 49 | fixed4 color : COLOR; 50 | }; 51 | 52 | struct v2f 53 | { 54 | float4 position : SV_POSITION; 55 | float2 uv_MainTex : TEXCOORD0; 56 | float2 uv_BlendTex : TEXCOORD1; 57 | fixed4 color : COLOR; 58 | }; 59 | 60 | v2f vert(appdata v) 61 | { 62 | v2f o; 63 | o.position = UnityObjectToClipPos(v.vertex); 64 | o.uv_MainTex = TRANSFORM_TEX(v.uv_MainTex, _MainTex); 65 | o.uv_BlendTex = TRANSFORM_TEX(v.uv_BlendTex, _BlendTex); 66 | o.color = v.color; 67 | return o; 68 | } 69 | 70 | fixed4 frag(v2f i) : SV_TARGET 71 | { 72 | fixed4 a = tex2D(_MainTex, i.uv_MainTex) * _Color; 73 | fixed4 b = tex2D(_BlendTex, i.uv_BlendTex) * _BlendColor; 74 | 75 | return fixed4(lerp(a, linearDodge(a, b), _BlendColor.a), a.a) * i.color; 76 | } 77 | 78 | ENDCG 79 | } 80 | 81 | } 82 | 83 | } 84 | -------------------------------------------------------------------------------- /Shaders/Sprites/LinearDodge.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2b0c478c45aa27842b8a4662dd75d6b7 3 | ShaderImporter: 4 | externalObjects: {} 5 | defaultTextures: [] 6 | nonModifiableTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Shaders/Sprites/LinearLight.shader: -------------------------------------------------------------------------------- 1 | Shader "Zigurous/Blending/Sprites/Linear Light" 2 | { 3 | Properties 4 | { 5 | _Color ("Main Color", Color) = (1,1,1,1) 6 | _MainTex ("Main Texture", 2D) = "white" {} 7 | 8 | _BlendColor ("Blend Color", Color) = (1,1,1,1) 9 | _BlendTex ("Blend Texture", 2D) = "white" {} 10 | } 11 | 12 | SubShader 13 | { 14 | Tags 15 | { 16 | "RenderType"="Transparent" 17 | "Queue"="Transparent" 18 | } 19 | 20 | Blend SrcAlpha OneMinusSrcAlpha 21 | ZWrite off 22 | Cull off 23 | 24 | Pass 25 | { 26 | 27 | CGPROGRAM 28 | 29 | #include "UnityCG.cginc" 30 | #include "../Blending.cginc" 31 | 32 | #pragma vertex vert 33 | #pragma fragment frag 34 | 35 | sampler2D _MainTex; 36 | sampler2D _BlendTex; 37 | 38 | float4 _MainTex_ST; 39 | float4 _BlendTex_ST; 40 | 41 | fixed4 _Color; 42 | fixed4 _BlendColor; 43 | 44 | struct appdata 45 | { 46 | float4 vertex : POSITION; 47 | float2 uv_MainTex : TEXCOORD0; 48 | float2 uv_BlendTex : TEXCOORD1; 49 | fixed4 color : COLOR; 50 | }; 51 | 52 | struct v2f 53 | { 54 | float4 position : SV_POSITION; 55 | float2 uv_MainTex : TEXCOORD0; 56 | float2 uv_BlendTex : TEXCOORD1; 57 | fixed4 color : COLOR; 58 | }; 59 | 60 | v2f vert(appdata v) 61 | { 62 | v2f o; 63 | o.position = UnityObjectToClipPos(v.vertex); 64 | o.uv_MainTex = TRANSFORM_TEX(v.uv_MainTex, _MainTex); 65 | o.uv_BlendTex = TRANSFORM_TEX(v.uv_BlendTex, _BlendTex); 66 | o.color = v.color; 67 | return o; 68 | } 69 | 70 | fixed4 frag(v2f i) : SV_TARGET 71 | { 72 | fixed4 a = tex2D(_MainTex, i.uv_MainTex) * _Color; 73 | fixed4 b = tex2D(_BlendTex, i.uv_BlendTex) * _BlendColor; 74 | 75 | return fixed4(lerp(a, linearLight(a, b), _BlendColor.a), a.a) * i.color; 76 | } 77 | 78 | ENDCG 79 | } 80 | 81 | } 82 | 83 | } 84 | -------------------------------------------------------------------------------- /Shaders/Sprites/LinearLight.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cc56faa2856249c40878dee34c7f360e 3 | ShaderImporter: 4 | externalObjects: {} 5 | defaultTextures: [] 6 | nonModifiableTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Shaders/Sprites/Multiply.shader: -------------------------------------------------------------------------------- 1 | Shader "Zigurous/Blending/Sprites/Multiply" 2 | { 3 | Properties 4 | { 5 | _Color ("Main Color", Color) = (1,1,1,1) 6 | _MainTex ("Main Texture", 2D) = "white" {} 7 | 8 | _BlendColor ("Blend Color", Color) = (1,1,1,1) 9 | _BlendTex ("Blend Texture", 2D) = "white" {} 10 | } 11 | 12 | SubShader 13 | { 14 | Tags 15 | { 16 | "RenderType"="Transparent" 17 | "Queue"="Transparent" 18 | } 19 | 20 | Blend SrcAlpha OneMinusSrcAlpha 21 | ZWrite off 22 | Cull off 23 | 24 | Pass 25 | { 26 | 27 | CGPROGRAM 28 | 29 | #include "UnityCG.cginc" 30 | #include "../Blending.cginc" 31 | 32 | #pragma vertex vert 33 | #pragma fragment frag 34 | 35 | sampler2D _MainTex; 36 | sampler2D _BlendTex; 37 | 38 | float4 _MainTex_ST; 39 | float4 _BlendTex_ST; 40 | 41 | fixed4 _Color; 42 | fixed4 _BlendColor; 43 | 44 | struct appdata 45 | { 46 | float4 vertex : POSITION; 47 | float2 uv_MainTex : TEXCOORD0; 48 | float2 uv_BlendTex : TEXCOORD1; 49 | fixed4 color : COLOR; 50 | }; 51 | 52 | struct v2f 53 | { 54 | float4 position : SV_POSITION; 55 | float2 uv_MainTex : TEXCOORD0; 56 | float2 uv_BlendTex : TEXCOORD1; 57 | fixed4 color : COLOR; 58 | }; 59 | 60 | v2f vert(appdata v) 61 | { 62 | v2f o; 63 | o.position = UnityObjectToClipPos(v.vertex); 64 | o.uv_MainTex = TRANSFORM_TEX(v.uv_MainTex, _MainTex); 65 | o.uv_BlendTex = TRANSFORM_TEX(v.uv_BlendTex, _BlendTex); 66 | o.color = v.color; 67 | return o; 68 | } 69 | 70 | fixed4 frag(v2f i) : SV_TARGET 71 | { 72 | fixed4 a = tex2D(_MainTex, i.uv_MainTex) * _Color; 73 | fixed4 b = tex2D(_BlendTex, i.uv_BlendTex) * _BlendColor; 74 | 75 | return fixed4(lerp(a, multiply(a, b), _BlendColor.a), a.a) * i.color; 76 | } 77 | 78 | ENDCG 79 | } 80 | 81 | } 82 | 83 | } 84 | -------------------------------------------------------------------------------- /Shaders/Sprites/Multiply.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7a6c26aa458996c4792fa267ce2f3718 3 | ShaderImporter: 4 | externalObjects: {} 5 | defaultTextures: [] 6 | nonModifiableTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Shaders/Sprites/Negation.shader: -------------------------------------------------------------------------------- 1 | Shader "Zigurous/Blending/Sprites/Negation" 2 | { 3 | Properties 4 | { 5 | _Color ("Main Color", Color) = (1,1,1,1) 6 | _MainTex ("Main Texture", 2D) = "white" {} 7 | 8 | _BlendColor ("Blend Color", Color) = (1,1,1,1) 9 | _BlendTex ("Blend Texture", 2D) = "white" {} 10 | } 11 | 12 | SubShader 13 | { 14 | Tags 15 | { 16 | "RenderType"="Transparent" 17 | "Queue"="Transparent" 18 | } 19 | 20 | Blend SrcAlpha OneMinusSrcAlpha 21 | ZWrite off 22 | Cull off 23 | 24 | Pass 25 | { 26 | 27 | CGPROGRAM 28 | 29 | #include "UnityCG.cginc" 30 | #include "../Blending.cginc" 31 | 32 | #pragma vertex vert 33 | #pragma fragment frag 34 | 35 | sampler2D _MainTex; 36 | sampler2D _BlendTex; 37 | 38 | float4 _MainTex_ST; 39 | float4 _BlendTex_ST; 40 | 41 | fixed4 _Color; 42 | fixed4 _BlendColor; 43 | 44 | struct appdata 45 | { 46 | float4 vertex : POSITION; 47 | float2 uv_MainTex : TEXCOORD0; 48 | float2 uv_BlendTex : TEXCOORD1; 49 | fixed4 color : COLOR; 50 | }; 51 | 52 | struct v2f 53 | { 54 | float4 position : SV_POSITION; 55 | float2 uv_MainTex : TEXCOORD0; 56 | float2 uv_BlendTex : TEXCOORD1; 57 | fixed4 color : COLOR; 58 | }; 59 | 60 | v2f vert(appdata v) 61 | { 62 | v2f o; 63 | o.position = UnityObjectToClipPos(v.vertex); 64 | o.uv_MainTex = TRANSFORM_TEX(v.uv_MainTex, _MainTex); 65 | o.uv_BlendTex = TRANSFORM_TEX(v.uv_BlendTex, _BlendTex); 66 | o.color = v.color; 67 | return o; 68 | } 69 | 70 | fixed4 frag(v2f i) : SV_TARGET 71 | { 72 | fixed4 a = tex2D(_MainTex, i.uv_MainTex) * _Color; 73 | fixed4 b = tex2D(_BlendTex, i.uv_BlendTex) * _BlendColor; 74 | 75 | return fixed4(lerp(a, negation(a, b), _BlendColor.a), a.a) * i.color; 76 | } 77 | 78 | ENDCG 79 | } 80 | 81 | } 82 | 83 | } 84 | -------------------------------------------------------------------------------- /Shaders/Sprites/Negation.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 15811bbbded4d5e41b20752dd86c952f 3 | ShaderImporter: 4 | externalObjects: {} 5 | defaultTextures: [] 6 | nonModifiableTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Shaders/Sprites/Overlay.shader: -------------------------------------------------------------------------------- 1 | Shader "Zigurous/Blending/Sprites/Overlay" 2 | { 3 | Properties 4 | { 5 | _Color ("Main Color", Color) = (1,1,1,1) 6 | _MainTex ("Main Texture", 2D) = "white" {} 7 | 8 | _BlendColor ("Blend Color", Color) = (1,1,1,1) 9 | _BlendTex ("Blend Texture", 2D) = "white" {} 10 | } 11 | 12 | SubShader 13 | { 14 | Tags 15 | { 16 | "RenderType"="Transparent" 17 | "Queue"="Transparent" 18 | } 19 | 20 | Blend SrcAlpha OneMinusSrcAlpha 21 | ZWrite off 22 | Cull off 23 | 24 | Pass 25 | { 26 | 27 | CGPROGRAM 28 | 29 | #include "UnityCG.cginc" 30 | #include "../Blending.cginc" 31 | 32 | #pragma vertex vert 33 | #pragma fragment frag 34 | 35 | sampler2D _MainTex; 36 | sampler2D _BlendTex; 37 | 38 | float4 _MainTex_ST; 39 | float4 _BlendTex_ST; 40 | 41 | fixed4 _Color; 42 | fixed4 _BlendColor; 43 | 44 | struct appdata 45 | { 46 | float4 vertex : POSITION; 47 | float2 uv_MainTex : TEXCOORD0; 48 | float2 uv_BlendTex : TEXCOORD1; 49 | fixed4 color : COLOR; 50 | }; 51 | 52 | struct v2f 53 | { 54 | float4 position : SV_POSITION; 55 | float2 uv_MainTex : TEXCOORD0; 56 | float2 uv_BlendTex : TEXCOORD1; 57 | fixed4 color : COLOR; 58 | }; 59 | 60 | v2f vert(appdata v) 61 | { 62 | v2f o; 63 | o.position = UnityObjectToClipPos(v.vertex); 64 | o.uv_MainTex = TRANSFORM_TEX(v.uv_MainTex, _MainTex); 65 | o.uv_BlendTex = TRANSFORM_TEX(v.uv_BlendTex, _BlendTex); 66 | o.color = v.color; 67 | return o; 68 | } 69 | 70 | fixed4 frag(v2f i) : SV_TARGET 71 | { 72 | fixed4 a = tex2D(_MainTex, i.uv_MainTex) * _Color; 73 | fixed4 b = tex2D(_BlendTex, i.uv_BlendTex) * _BlendColor; 74 | 75 | return fixed4(lerp(a, overlay(a, b), _BlendColor.a), a.a) * i.color; 76 | } 77 | 78 | ENDCG 79 | } 80 | 81 | } 82 | 83 | } 84 | -------------------------------------------------------------------------------- /Shaders/Sprites/Overlay.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a95b58cb54133a84bab160260a2a78a7 3 | ShaderImporter: 4 | externalObjects: {} 5 | defaultTextures: [] 6 | nonModifiableTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Shaders/Sprites/Phoenix.shader: -------------------------------------------------------------------------------- 1 | Shader "Zigurous/Blending/Sprites/Phoenix" 2 | { 3 | Properties 4 | { 5 | _Color ("Main Color", Color) = (1,1,1,1) 6 | _MainTex ("Main Texture", 2D) = "white" {} 7 | 8 | _BlendColor ("Blend Color", Color) = (1,1,1,1) 9 | _BlendTex ("Blend Texture", 2D) = "white" {} 10 | } 11 | 12 | SubShader 13 | { 14 | Tags 15 | { 16 | "RenderType"="Transparent" 17 | "Queue"="Transparent" 18 | } 19 | 20 | Blend SrcAlpha OneMinusSrcAlpha 21 | ZWrite off 22 | Cull off 23 | 24 | Pass 25 | { 26 | 27 | CGPROGRAM 28 | 29 | #include "UnityCG.cginc" 30 | #include "../Blending.cginc" 31 | 32 | #pragma vertex vert 33 | #pragma fragment frag 34 | 35 | sampler2D _MainTex; 36 | sampler2D _BlendTex; 37 | 38 | float4 _MainTex_ST; 39 | float4 _BlendTex_ST; 40 | 41 | fixed4 _Color; 42 | fixed4 _BlendColor; 43 | 44 | struct appdata 45 | { 46 | float4 vertex : POSITION; 47 | float2 uv_MainTex : TEXCOORD0; 48 | float2 uv_BlendTex : TEXCOORD1; 49 | fixed4 color : COLOR; 50 | }; 51 | 52 | struct v2f 53 | { 54 | float4 position : SV_POSITION; 55 | float2 uv_MainTex : TEXCOORD0; 56 | float2 uv_BlendTex : TEXCOORD1; 57 | fixed4 color : COLOR; 58 | }; 59 | 60 | v2f vert(appdata v) 61 | { 62 | v2f o; 63 | o.position = UnityObjectToClipPos(v.vertex); 64 | o.uv_MainTex = TRANSFORM_TEX(v.uv_MainTex, _MainTex); 65 | o.uv_BlendTex = TRANSFORM_TEX(v.uv_BlendTex, _BlendTex); 66 | o.color = v.color; 67 | return o; 68 | } 69 | 70 | fixed4 frag(v2f i) : SV_TARGET 71 | { 72 | fixed4 a = tex2D(_MainTex, i.uv_MainTex) * _Color; 73 | fixed4 b = tex2D(_BlendTex, i.uv_BlendTex) * _BlendColor; 74 | 75 | return fixed4(lerp(a, phoenix(a, b), _BlendColor.a), a.a) * i.color; 76 | } 77 | 78 | ENDCG 79 | } 80 | 81 | } 82 | 83 | } 84 | -------------------------------------------------------------------------------- /Shaders/Sprites/Phoenix.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 452df767f7608a94990f9db295142ccb 3 | ShaderImporter: 4 | externalObjects: {} 5 | defaultTextures: [] 6 | nonModifiableTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Shaders/Sprites/PinLight.shader: -------------------------------------------------------------------------------- 1 | Shader "Zigurous/Blending/Sprites/Pin Light" 2 | { 3 | Properties 4 | { 5 | _Color ("Main Color", Color) = (1,1,1,1) 6 | _MainTex ("Main Texture", 2D) = "white" {} 7 | 8 | _BlendColor ("Blend Color", Color) = (1,1,1,1) 9 | _BlendTex ("Blend Texture", 2D) = "white" {} 10 | } 11 | 12 | SubShader 13 | { 14 | Tags 15 | { 16 | "RenderType"="Transparent" 17 | "Queue"="Transparent" 18 | } 19 | 20 | Blend SrcAlpha OneMinusSrcAlpha 21 | ZWrite off 22 | Cull off 23 | 24 | Pass 25 | { 26 | 27 | CGPROGRAM 28 | 29 | #include "UnityCG.cginc" 30 | #include "../Blending.cginc" 31 | 32 | #pragma vertex vert 33 | #pragma fragment frag 34 | 35 | sampler2D _MainTex; 36 | sampler2D _BlendTex; 37 | 38 | float4 _MainTex_ST; 39 | float4 _BlendTex_ST; 40 | 41 | fixed4 _Color; 42 | fixed4 _BlendColor; 43 | 44 | struct appdata 45 | { 46 | float4 vertex : POSITION; 47 | float2 uv_MainTex : TEXCOORD0; 48 | float2 uv_BlendTex : TEXCOORD1; 49 | fixed4 color : COLOR; 50 | }; 51 | 52 | struct v2f 53 | { 54 | float4 position : SV_POSITION; 55 | float2 uv_MainTex : TEXCOORD0; 56 | float2 uv_BlendTex : TEXCOORD1; 57 | fixed4 color : COLOR; 58 | }; 59 | 60 | v2f vert(appdata v) 61 | { 62 | v2f o; 63 | o.position = UnityObjectToClipPos(v.vertex); 64 | o.uv_MainTex = TRANSFORM_TEX(v.uv_MainTex, _MainTex); 65 | o.uv_BlendTex = TRANSFORM_TEX(v.uv_BlendTex, _BlendTex); 66 | o.color = v.color; 67 | return o; 68 | } 69 | 70 | fixed4 frag(v2f i) : SV_TARGET 71 | { 72 | fixed4 a = tex2D(_MainTex, i.uv_MainTex) * _Color; 73 | fixed4 b = tex2D(_BlendTex, i.uv_BlendTex) * _BlendColor; 74 | 75 | return fixed4(lerp(a, pinLight(a, b), _BlendColor.a), a.a) * i.color; 76 | } 77 | 78 | ENDCG 79 | } 80 | 81 | } 82 | 83 | } 84 | -------------------------------------------------------------------------------- /Shaders/Sprites/PinLight.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cc571e6aa066602448d9e70a46739c27 3 | ShaderImporter: 4 | externalObjects: {} 5 | defaultTextures: [] 6 | nonModifiableTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Shaders/Sprites/Reflect.shader: -------------------------------------------------------------------------------- 1 | Shader "Zigurous/Blending/Sprites/Reflect" 2 | { 3 | Properties 4 | { 5 | _Color ("Main Color", Color) = (1,1,1,1) 6 | _MainTex ("Main Texture", 2D) = "white" {} 7 | 8 | _BlendColor ("Blend Color", Color) = (1,1,1,1) 9 | _BlendTex ("Blend Texture", 2D) = "white" {} 10 | } 11 | 12 | SubShader 13 | { 14 | Tags 15 | { 16 | "RenderType"="Transparent" 17 | "Queue"="Transparent" 18 | } 19 | 20 | Blend SrcAlpha OneMinusSrcAlpha 21 | ZWrite off 22 | Cull off 23 | 24 | Pass 25 | { 26 | 27 | CGPROGRAM 28 | 29 | #include "UnityCG.cginc" 30 | #include "../Blending.cginc" 31 | 32 | #pragma vertex vert 33 | #pragma fragment frag 34 | 35 | sampler2D _MainTex; 36 | sampler2D _BlendTex; 37 | 38 | float4 _MainTex_ST; 39 | float4 _BlendTex_ST; 40 | 41 | fixed4 _Color; 42 | fixed4 _BlendColor; 43 | 44 | struct appdata 45 | { 46 | float4 vertex : POSITION; 47 | float2 uv_MainTex : TEXCOORD0; 48 | float2 uv_BlendTex : TEXCOORD1; 49 | fixed4 color : COLOR; 50 | }; 51 | 52 | struct v2f 53 | { 54 | float4 position : SV_POSITION; 55 | float2 uv_MainTex : TEXCOORD0; 56 | float2 uv_BlendTex : TEXCOORD1; 57 | fixed4 color : COLOR; 58 | }; 59 | 60 | v2f vert(appdata v) 61 | { 62 | v2f o; 63 | o.position = UnityObjectToClipPos(v.vertex); 64 | o.uv_MainTex = TRANSFORM_TEX(v.uv_MainTex, _MainTex); 65 | o.uv_BlendTex = TRANSFORM_TEX(v.uv_BlendTex, _BlendTex); 66 | o.color = v.color; 67 | return o; 68 | } 69 | 70 | fixed4 frag(v2f i) : SV_TARGET 71 | { 72 | fixed4 a = tex2D(_MainTex, i.uv_MainTex) * _Color; 73 | fixed4 b = tex2D(_BlendTex, i.uv_BlendTex) * _BlendColor; 74 | 75 | return fixed4(lerp(a, reflect(a, b), _BlendColor.a), a.a) * i.color; 76 | } 77 | 78 | ENDCG 79 | } 80 | 81 | } 82 | 83 | } 84 | -------------------------------------------------------------------------------- /Shaders/Sprites/Reflect.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9810ec735feb3aa4f8716ed7a9c854e3 3 | ShaderImporter: 4 | externalObjects: {} 5 | defaultTextures: [] 6 | nonModifiableTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Shaders/Sprites/Screen.shader: -------------------------------------------------------------------------------- 1 | Shader "Zigurous/Blending/Sprites/Screen" 2 | { 3 | Properties 4 | { 5 | _Color ("Main Color", Color) = (1,1,1,1) 6 | _MainTex ("Main Texture", 2D) = "white" {} 7 | 8 | _BlendColor ("Blend Color", Color) = (1,1,1,1) 9 | _BlendTex ("Blend Texture", 2D) = "white" {} 10 | } 11 | 12 | SubShader 13 | { 14 | Tags 15 | { 16 | "RenderType"="Transparent" 17 | "Queue"="Transparent" 18 | } 19 | 20 | Blend SrcAlpha OneMinusSrcAlpha 21 | ZWrite off 22 | Cull off 23 | 24 | Pass 25 | { 26 | 27 | CGPROGRAM 28 | 29 | #include "UnityCG.cginc" 30 | #include "../Blending.cginc" 31 | 32 | #pragma vertex vert 33 | #pragma fragment frag 34 | 35 | sampler2D _MainTex; 36 | sampler2D _BlendTex; 37 | 38 | float4 _MainTex_ST; 39 | float4 _BlendTex_ST; 40 | 41 | fixed4 _Color; 42 | fixed4 _BlendColor; 43 | 44 | struct appdata 45 | { 46 | float4 vertex : POSITION; 47 | float2 uv_MainTex : TEXCOORD0; 48 | float2 uv_BlendTex : TEXCOORD1; 49 | fixed4 color : COLOR; 50 | }; 51 | 52 | struct v2f 53 | { 54 | float4 position : SV_POSITION; 55 | float2 uv_MainTex : TEXCOORD0; 56 | float2 uv_BlendTex : TEXCOORD1; 57 | fixed4 color : COLOR; 58 | }; 59 | 60 | v2f vert(appdata v) 61 | { 62 | v2f o; 63 | o.position = UnityObjectToClipPos(v.vertex); 64 | o.uv_MainTex = TRANSFORM_TEX(v.uv_MainTex, _MainTex); 65 | o.uv_BlendTex = TRANSFORM_TEX(v.uv_BlendTex, _BlendTex); 66 | o.color = v.color; 67 | return o; 68 | } 69 | 70 | fixed4 frag(v2f i) : SV_TARGET 71 | { 72 | fixed4 a = tex2D(_MainTex, i.uv_MainTex) * _Color; 73 | fixed4 b = tex2D(_BlendTex, i.uv_BlendTex) * _BlendColor; 74 | 75 | return fixed4(lerp(a, screen(a, b), _BlendColor.a), a.a) * i.color; 76 | } 77 | 78 | ENDCG 79 | } 80 | 81 | } 82 | 83 | } 84 | -------------------------------------------------------------------------------- /Shaders/Sprites/Screen.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 400f14b0ed65e3442aa9db1f18a2be82 3 | ShaderImporter: 4 | externalObjects: {} 5 | defaultTextures: [] 6 | nonModifiableTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Shaders/Sprites/SoftLight.shader: -------------------------------------------------------------------------------- 1 | Shader "Zigurous/Blending/Sprites/Soft Light" 2 | { 3 | Properties 4 | { 5 | _Color ("Main Color", Color) = (1,1,1,1) 6 | _MainTex ("Main Texture", 2D) = "white" {} 7 | 8 | _BlendColor ("Blend Color", Color) = (1,1,1,1) 9 | _BlendTex ("Blend Texture", 2D) = "white" {} 10 | } 11 | 12 | SubShader 13 | { 14 | Tags 15 | { 16 | "RenderType"="Transparent" 17 | "Queue"="Transparent" 18 | } 19 | 20 | Blend SrcAlpha OneMinusSrcAlpha 21 | ZWrite off 22 | Cull off 23 | 24 | Pass 25 | { 26 | 27 | CGPROGRAM 28 | 29 | #include "UnityCG.cginc" 30 | #include "../Blending.cginc" 31 | 32 | #pragma vertex vert 33 | #pragma fragment frag 34 | 35 | sampler2D _MainTex; 36 | sampler2D _BlendTex; 37 | 38 | float4 _MainTex_ST; 39 | float4 _BlendTex_ST; 40 | 41 | fixed4 _Color; 42 | fixed4 _BlendColor; 43 | 44 | struct appdata 45 | { 46 | float4 vertex : POSITION; 47 | float2 uv_MainTex : TEXCOORD0; 48 | float2 uv_BlendTex : TEXCOORD1; 49 | fixed4 color : COLOR; 50 | }; 51 | 52 | struct v2f 53 | { 54 | float4 position : SV_POSITION; 55 | float2 uv_MainTex : TEXCOORD0; 56 | float2 uv_BlendTex : TEXCOORD1; 57 | fixed4 color : COLOR; 58 | }; 59 | 60 | v2f vert(appdata v) 61 | { 62 | v2f o; 63 | o.position = UnityObjectToClipPos(v.vertex); 64 | o.uv_MainTex = TRANSFORM_TEX(v.uv_MainTex, _MainTex); 65 | o.uv_BlendTex = TRANSFORM_TEX(v.uv_BlendTex, _BlendTex); 66 | o.color = v.color; 67 | return o; 68 | } 69 | 70 | fixed4 frag(v2f i) : SV_TARGET 71 | { 72 | fixed4 a = tex2D(_MainTex, i.uv_MainTex) * _Color; 73 | fixed4 b = tex2D(_BlendTex, i.uv_BlendTex) * _BlendColor; 74 | 75 | return fixed4(lerp(a, softLight(a, b), _BlendColor.a), a.a) * i.color; 76 | } 77 | 78 | ENDCG 79 | } 80 | 81 | } 82 | 83 | } 84 | -------------------------------------------------------------------------------- /Shaders/Sprites/SoftLight.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f1629f72769e7ed49b77b65ad71385b1 3 | ShaderImporter: 4 | externalObjects: {} 5 | defaultTextures: [] 6 | nonModifiableTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Shaders/Sprites/Subtract.shader: -------------------------------------------------------------------------------- 1 | Shader "Zigurous/Blending/Sprites/Subtract" 2 | { 3 | Properties 4 | { 5 | _Color ("Main Color", Color) = (1,1,1,1) 6 | _MainTex ("Main Texture", 2D) = "white" {} 7 | 8 | _BlendColor ("Blend Color", Color) = (1,1,1,1) 9 | _BlendTex ("Blend Texture", 2D) = "white" {} 10 | } 11 | 12 | SubShader 13 | { 14 | Tags 15 | { 16 | "RenderType"="Transparent" 17 | "Queue"="Transparent" 18 | } 19 | 20 | Blend SrcAlpha OneMinusSrcAlpha 21 | ZWrite off 22 | Cull off 23 | 24 | Pass 25 | { 26 | 27 | CGPROGRAM 28 | 29 | #include "UnityCG.cginc" 30 | #include "../Blending.cginc" 31 | 32 | #pragma vertex vert 33 | #pragma fragment frag 34 | 35 | sampler2D _MainTex; 36 | sampler2D _BlendTex; 37 | 38 | float4 _MainTex_ST; 39 | float4 _BlendTex_ST; 40 | 41 | fixed4 _Color; 42 | fixed4 _BlendColor; 43 | 44 | struct appdata 45 | { 46 | float4 vertex : POSITION; 47 | float2 uv_MainTex : TEXCOORD0; 48 | float2 uv_BlendTex : TEXCOORD1; 49 | fixed4 color : COLOR; 50 | }; 51 | 52 | struct v2f 53 | { 54 | float4 position : SV_POSITION; 55 | float2 uv_MainTex : TEXCOORD0; 56 | float2 uv_BlendTex : TEXCOORD1; 57 | fixed4 color : COLOR; 58 | }; 59 | 60 | v2f vert(appdata v) 61 | { 62 | v2f o; 63 | o.position = UnityObjectToClipPos(v.vertex); 64 | o.uv_MainTex = TRANSFORM_TEX(v.uv_MainTex, _MainTex); 65 | o.uv_BlendTex = TRANSFORM_TEX(v.uv_BlendTex, _BlendTex); 66 | o.color = v.color; 67 | return o; 68 | } 69 | 70 | fixed4 frag(v2f i) : SV_TARGET 71 | { 72 | fixed4 a = tex2D(_MainTex, i.uv_MainTex) * _Color; 73 | fixed4 b = tex2D(_BlendTex, i.uv_BlendTex) * _BlendColor; 74 | 75 | return fixed4(lerp(a, subtract(a, b), _BlendColor.a), a.a) * i.color; 76 | } 77 | 78 | ENDCG 79 | } 80 | 81 | } 82 | 83 | } 84 | -------------------------------------------------------------------------------- /Shaders/Sprites/Subtract.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7fc7c617cf7a3e24d849c254da5f1785 3 | ShaderImporter: 4 | externalObjects: {} 5 | defaultTextures: [] 6 | nonModifiableTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Shaders/Sprites/VividLight.shader: -------------------------------------------------------------------------------- 1 | Shader "Zigurous/Blending/Sprites/Vivid Light" 2 | { 3 | Properties 4 | { 5 | _Color ("Main Color", Color) = (1,1,1,1) 6 | _MainTex ("Main Texture", 2D) = "white" {} 7 | 8 | _BlendColor ("Blend Color", Color) = (1,1,1,1) 9 | _BlendTex ("Blend Texture", 2D) = "white" {} 10 | } 11 | 12 | SubShader 13 | { 14 | Tags 15 | { 16 | "RenderType"="Transparent" 17 | "Queue"="Transparent" 18 | } 19 | 20 | Blend SrcAlpha OneMinusSrcAlpha 21 | ZWrite off 22 | Cull off 23 | 24 | Pass 25 | { 26 | 27 | CGPROGRAM 28 | 29 | #include "UnityCG.cginc" 30 | #include "../Blending.cginc" 31 | 32 | #pragma vertex vert 33 | #pragma fragment frag 34 | 35 | sampler2D _MainTex; 36 | sampler2D _BlendTex; 37 | 38 | float4 _MainTex_ST; 39 | float4 _BlendTex_ST; 40 | 41 | fixed4 _Color; 42 | fixed4 _BlendColor; 43 | 44 | struct appdata 45 | { 46 | float4 vertex : POSITION; 47 | float2 uv_MainTex : TEXCOORD0; 48 | float2 uv_BlendTex : TEXCOORD1; 49 | fixed4 color : COLOR; 50 | }; 51 | 52 | struct v2f 53 | { 54 | float4 position : SV_POSITION; 55 | float2 uv_MainTex : TEXCOORD0; 56 | float2 uv_BlendTex : TEXCOORD1; 57 | fixed4 color : COLOR; 58 | }; 59 | 60 | v2f vert(appdata v) 61 | { 62 | v2f o; 63 | o.position = UnityObjectToClipPos(v.vertex); 64 | o.uv_MainTex = TRANSFORM_TEX(v.uv_MainTex, _MainTex); 65 | o.uv_BlendTex = TRANSFORM_TEX(v.uv_BlendTex, _BlendTex); 66 | o.color = v.color; 67 | return o; 68 | } 69 | 70 | fixed4 frag(v2f i) : SV_TARGET 71 | { 72 | fixed4 a = tex2D(_MainTex, i.uv_MainTex) * _Color; 73 | fixed4 b = tex2D(_BlendTex, i.uv_BlendTex) * _BlendColor; 74 | 75 | return fixed4(lerp(a, vividLight(a, b), _BlendColor.a), a.a) * i.color; 76 | } 77 | 78 | ENDCG 79 | } 80 | 81 | } 82 | 83 | } 84 | -------------------------------------------------------------------------------- /Shaders/Sprites/VividLight.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d5d9ffeb07d16af4aa6b4a7ddb03787c 3 | ShaderImporter: 4 | externalObjects: {} 5 | defaultTextures: [] 6 | nonModifiableTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Shaders/Surface.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 32b9ce4116d58f44da81c94406b08143 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Shaders/Surface/Add.shader: -------------------------------------------------------------------------------- 1 | Shader "Zigurous/Blending/Surface/Add" 2 | { 3 | Properties 4 | { 5 | _MainColor ("Main Color", Color) = (1,1,1,1) 6 | _MainTex ("Main Texture", 2D) = "white" {} 7 | 8 | _BlendColor ("Blend Color", Color) = (1,1,1,1) 9 | _BlendTex ("Blend Texture", 2D) = "white" {} 10 | 11 | _Glossiness ("Smoothness", Range(0, 1)) = 0.5 12 | _Metallic ("Metallic", Range(0, 1)) = 0 13 | } 14 | 15 | SubShader 16 | { 17 | Tags { "RenderType"="Opaque" } 18 | LOD 200 19 | 20 | CGPROGRAM 21 | 22 | #include "../Blending.cginc" 23 | 24 | #pragma surface surf Standard fullforwardshadows 25 | #pragma target 3.0 26 | 27 | sampler2D _MainTex; 28 | sampler2D _BlendTex; 29 | 30 | struct Input 31 | { 32 | float2 uv_MainTex; 33 | float2 uv_BlendTex; 34 | }; 35 | 36 | fixed4 _MainColor; 37 | fixed4 _BlendColor; 38 | 39 | half _Glossiness; 40 | half _Metallic; 41 | 42 | void surf(Input IN, inout SurfaceOutputStandard o) 43 | { 44 | fixed4 a = lerp(_MainColor, tex2D(_MainTex, IN.uv_MainTex) * _MainColor, _MainColor.a); 45 | fixed4 b = tex2D(_BlendTex, IN.uv_BlendTex) * _BlendColor; 46 | fixed3 c = lerp(a, add(a, b), _BlendColor.a); 47 | 48 | o.Albedo = c.rgb; 49 | o.Metallic = _Metallic; 50 | o.Smoothness = _Glossiness; 51 | } 52 | 53 | ENDCG 54 | } 55 | 56 | FallBack "Diffuse" 57 | } 58 | -------------------------------------------------------------------------------- /Shaders/Surface/Add.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b6a18948c7807d543a24b2ef9ac58a86 3 | ShaderImporter: 4 | externalObjects: {} 5 | defaultTextures: [] 6 | nonModifiableTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Shaders/Surface/Average.shader: -------------------------------------------------------------------------------- 1 | Shader "Zigurous/Blending/Surface/Average" 2 | { 3 | Properties 4 | { 5 | _MainColor ("Main Color", Color) = (1,1,1,1) 6 | _MainTex ("Main Texture", 2D) = "white" {} 7 | 8 | _BlendColor ("Blend Color", Color) = (1,1,1,1) 9 | _BlendTex ("Blend Texture", 2D) = "white" {} 10 | 11 | _Glossiness ("Smoothness", Range(0, 1)) = 0.5 12 | _Metallic ("Metallic", Range(0, 1)) = 0 13 | } 14 | 15 | SubShader 16 | { 17 | Tags { "RenderType"="Opaque" } 18 | LOD 200 19 | 20 | CGPROGRAM 21 | 22 | #include "../Blending.cginc" 23 | 24 | #pragma surface surf Standard fullforwardshadows 25 | #pragma target 3.0 26 | 27 | sampler2D _MainTex; 28 | sampler2D _BlendTex; 29 | 30 | struct Input 31 | { 32 | float2 uv_MainTex; 33 | float2 uv_BlendTex; 34 | }; 35 | 36 | fixed4 _MainColor; 37 | fixed4 _BlendColor; 38 | 39 | half _Glossiness; 40 | half _Metallic; 41 | 42 | void surf(Input IN, inout SurfaceOutputStandard o) 43 | { 44 | fixed4 a = lerp(_MainColor, tex2D(_MainTex, IN.uv_MainTex) * _MainColor, _MainColor.a); 45 | fixed4 b = tex2D(_BlendTex, IN.uv_BlendTex) * _BlendColor; 46 | fixed3 c = lerp(a, average(a, b), _BlendColor.a); 47 | 48 | o.Albedo = c.rgb; 49 | o.Metallic = _Metallic; 50 | o.Smoothness = _Glossiness; 51 | } 52 | 53 | ENDCG 54 | } 55 | 56 | FallBack "Diffuse" 57 | } 58 | -------------------------------------------------------------------------------- /Shaders/Surface/Average.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d7b8ac0eaa256ed4dbc095d9869dd7f2 3 | ShaderImporter: 4 | externalObjects: {} 5 | defaultTextures: [] 6 | nonModifiableTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Shaders/Surface/ColorBurn.shader: -------------------------------------------------------------------------------- 1 | Shader "Zigurous/Blending/Surface/Color Burn" 2 | { 3 | Properties 4 | { 5 | _MainColor ("Main Color", Color) = (1,1,1,1) 6 | _MainTex ("Main Texture", 2D) = "white" {} 7 | 8 | _BlendColor ("Blend Color", Color) = (1,1,1,1) 9 | _BlendTex ("Blend Texture", 2D) = "white" {} 10 | 11 | _Glossiness ("Smoothness", Range(0, 1)) = 0.5 12 | _Metallic ("Metallic", Range(0, 1)) = 0 13 | } 14 | 15 | SubShader 16 | { 17 | Tags { "RenderType"="Opaque" } 18 | LOD 200 19 | 20 | CGPROGRAM 21 | 22 | #include "../Blending.cginc" 23 | 24 | #pragma surface surf Standard fullforwardshadows 25 | #pragma target 3.0 26 | 27 | sampler2D _MainTex; 28 | sampler2D _BlendTex; 29 | 30 | struct Input 31 | { 32 | float2 uv_MainTex; 33 | float2 uv_BlendTex; 34 | }; 35 | 36 | fixed4 _MainColor; 37 | fixed4 _BlendColor; 38 | 39 | half _Glossiness; 40 | half _Metallic; 41 | 42 | void surf(Input IN, inout SurfaceOutputStandard o) 43 | { 44 | fixed4 a = lerp(_MainColor, tex2D(_MainTex, IN.uv_MainTex) * _MainColor, _MainColor.a); 45 | fixed4 b = tex2D(_BlendTex, IN.uv_BlendTex) * _BlendColor; 46 | fixed3 c = lerp(a, colorBurn(a, b), _BlendColor.a); 47 | 48 | o.Albedo = c.rgb; 49 | o.Metallic = _Metallic; 50 | o.Smoothness = _Glossiness; 51 | } 52 | 53 | ENDCG 54 | } 55 | 56 | FallBack "Diffuse" 57 | } 58 | -------------------------------------------------------------------------------- /Shaders/Surface/ColorBurn.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 75e5ab76cad0d0045827de19c69672ed 3 | ShaderImporter: 4 | externalObjects: {} 5 | defaultTextures: [] 6 | nonModifiableTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Shaders/Surface/ColorDodge.shader: -------------------------------------------------------------------------------- 1 | Shader "Zigurous/Blending/Surface/Color Dodge" 2 | { 3 | Properties 4 | { 5 | _MainColor ("Main Color", Color) = (1,1,1,1) 6 | _MainTex ("Main Texture", 2D) = "white" {} 7 | 8 | _BlendColor ("Blend Color", Color) = (1,1,1,1) 9 | _BlendTex ("Blend Texture", 2D) = "white" {} 10 | 11 | _Glossiness ("Smoothness", Range(0, 1)) = 0.5 12 | _Metallic ("Metallic", Range(0, 1)) = 0 13 | } 14 | 15 | SubShader 16 | { 17 | Tags { "RenderType"="Opaque" } 18 | LOD 200 19 | 20 | CGPROGRAM 21 | 22 | #include "../Blending.cginc" 23 | 24 | #pragma surface surf Standard fullforwardshadows 25 | #pragma target 3.0 26 | 27 | sampler2D _MainTex; 28 | sampler2D _BlendTex; 29 | 30 | struct Input 31 | { 32 | float2 uv_MainTex; 33 | float2 uv_BlendTex; 34 | }; 35 | 36 | fixed4 _MainColor; 37 | fixed4 _BlendColor; 38 | 39 | half _Glossiness; 40 | half _Metallic; 41 | 42 | void surf(Input IN, inout SurfaceOutputStandard o) 43 | { 44 | fixed4 a = lerp(_MainColor, tex2D(_MainTex, IN.uv_MainTex) * _MainColor, _MainColor.a); 45 | fixed4 b = tex2D(_BlendTex, IN.uv_BlendTex) * _BlendColor; 46 | fixed3 c = lerp(a, colorDodge(a, b), _BlendColor.a); 47 | 48 | o.Albedo = c.rgb; 49 | o.Metallic = _Metallic; 50 | o.Smoothness = _Glossiness; 51 | } 52 | 53 | ENDCG 54 | } 55 | 56 | FallBack "Diffuse" 57 | } 58 | -------------------------------------------------------------------------------- /Shaders/Surface/ColorDodge.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f2a1b95c72ed03a4db076fd22c784f4d 3 | ShaderImporter: 4 | externalObjects: {} 5 | defaultTextures: [] 6 | nonModifiableTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Shaders/Surface/Darken.shader: -------------------------------------------------------------------------------- 1 | Shader "Zigurous/Blending/Surface/Darken" 2 | { 3 | Properties 4 | { 5 | _MainColor ("Main Color", Color) = (1,1,1,1) 6 | _MainTex ("Main Texture", 2D) = "white" {} 7 | 8 | _BlendColor ("Blend Color", Color) = (1,1,1,1) 9 | _BlendTex ("Blend Texture", 2D) = "white" {} 10 | 11 | _Glossiness ("Smoothness", Range(0, 1)) = 0.5 12 | _Metallic ("Metallic", Range(0, 1)) = 0 13 | } 14 | 15 | SubShader 16 | { 17 | Tags { "RenderType"="Opaque" } 18 | LOD 200 19 | 20 | CGPROGRAM 21 | 22 | #include "../Blending.cginc" 23 | 24 | #pragma surface surf Standard fullforwardshadows 25 | #pragma target 3.0 26 | 27 | sampler2D _MainTex; 28 | sampler2D _BlendTex; 29 | 30 | struct Input 31 | { 32 | float2 uv_MainTex; 33 | float2 uv_BlendTex; 34 | }; 35 | 36 | fixed4 _MainColor; 37 | fixed4 _BlendColor; 38 | 39 | half _Glossiness; 40 | half _Metallic; 41 | 42 | void surf(Input IN, inout SurfaceOutputStandard o) 43 | { 44 | fixed4 a = lerp(_MainColor, tex2D(_MainTex, IN.uv_MainTex) * _MainColor, _MainColor.a); 45 | fixed4 b = tex2D(_BlendTex, IN.uv_BlendTex) * _BlendColor; 46 | fixed3 c = lerp(a, darken(a, b), _BlendColor.a); 47 | 48 | o.Albedo = c.rgb; 49 | o.Metallic = _Metallic; 50 | o.Smoothness = _Glossiness; 51 | } 52 | 53 | ENDCG 54 | } 55 | 56 | FallBack "Diffuse" 57 | } 58 | -------------------------------------------------------------------------------- /Shaders/Surface/Darken.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 358511bbed0173446b38e9eb0364d79d 3 | ShaderImporter: 4 | externalObjects: {} 5 | defaultTextures: [] 6 | nonModifiableTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Shaders/Surface/Difference.shader: -------------------------------------------------------------------------------- 1 | Shader "Zigurous/Blending/Surface/Difference" 2 | { 3 | Properties 4 | { 5 | _MainColor ("Main Color", Color) = (1,1,1,1) 6 | _MainTex ("Main Texture", 2D) = "white" {} 7 | 8 | _BlendColor ("Blend Color", Color) = (1,1,1,1) 9 | _BlendTex ("Blend Texture", 2D) = "white" {} 10 | 11 | _Glossiness ("Smoothness", Range(0, 1)) = 0.5 12 | _Metallic ("Metallic", Range(0, 1)) = 0 13 | } 14 | 15 | SubShader 16 | { 17 | Tags { "RenderType"="Opaque" } 18 | LOD 200 19 | 20 | CGPROGRAM 21 | 22 | #include "../Blending.cginc" 23 | 24 | #pragma surface surf Standard fullforwardshadows 25 | #pragma target 3.0 26 | 27 | sampler2D _MainTex; 28 | sampler2D _BlendTex; 29 | 30 | struct Input 31 | { 32 | float2 uv_MainTex; 33 | float2 uv_BlendTex; 34 | }; 35 | 36 | fixed4 _MainColor; 37 | fixed4 _BlendColor; 38 | 39 | half _Glossiness; 40 | half _Metallic; 41 | 42 | void surf(Input IN, inout SurfaceOutputStandard o) 43 | { 44 | fixed4 a = lerp(_MainColor, tex2D(_MainTex, IN.uv_MainTex) * _MainColor, _MainColor.a); 45 | fixed4 b = tex2D(_BlendTex, IN.uv_BlendTex) * _BlendColor; 46 | fixed3 c = lerp(a, difference(a, b), _BlendColor.a); 47 | 48 | o.Albedo = c.rgb; 49 | o.Metallic = _Metallic; 50 | o.Smoothness = _Glossiness; 51 | } 52 | 53 | ENDCG 54 | } 55 | 56 | FallBack "Diffuse" 57 | } 58 | -------------------------------------------------------------------------------- /Shaders/Surface/Difference.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e2af02b8a750ec24fa6b99e659a04f1d 3 | ShaderImporter: 4 | externalObjects: {} 5 | defaultTextures: [] 6 | nonModifiableTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Shaders/Surface/Exclusion.shader: -------------------------------------------------------------------------------- 1 | Shader "Zigurous/Blending/Surface/Exclusion" 2 | { 3 | Properties 4 | { 5 | _MainColor ("Main Color", Color) = (1,1,1,1) 6 | _MainTex ("Main Texture", 2D) = "white" {} 7 | 8 | _BlendColor ("Blend Color", Color) = (1,1,1,1) 9 | _BlendTex ("Blend Texture", 2D) = "white" {} 10 | 11 | _Glossiness ("Smoothness", Range(0, 1)) = 0.5 12 | _Metallic ("Metallic", Range(0, 1)) = 0 13 | } 14 | 15 | SubShader 16 | { 17 | Tags { "RenderType"="Opaque" } 18 | LOD 200 19 | 20 | CGPROGRAM 21 | 22 | #include "../Blending.cginc" 23 | 24 | #pragma surface surf Standard fullforwardshadows 25 | #pragma target 3.0 26 | 27 | sampler2D _MainTex; 28 | sampler2D _BlendTex; 29 | 30 | struct Input 31 | { 32 | float2 uv_MainTex; 33 | float2 uv_BlendTex; 34 | }; 35 | 36 | fixed4 _MainColor; 37 | fixed4 _BlendColor; 38 | 39 | half _Glossiness; 40 | half _Metallic; 41 | 42 | void surf(Input IN, inout SurfaceOutputStandard o) 43 | { 44 | fixed4 a = lerp(_MainColor, tex2D(_MainTex, IN.uv_MainTex) * _MainColor, _MainColor.a); 45 | fixed4 b = tex2D(_BlendTex, IN.uv_BlendTex) * _BlendColor; 46 | fixed3 c = lerp(a, exclusion(a, b), _BlendColor.a); 47 | 48 | o.Albedo = c.rgb; 49 | o.Metallic = _Metallic; 50 | o.Smoothness = _Glossiness; 51 | } 52 | 53 | ENDCG 54 | } 55 | 56 | FallBack "Diffuse" 57 | } 58 | -------------------------------------------------------------------------------- /Shaders/Surface/Exclusion.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4ffcd98e667895d44ac8f5b9bbbb656e 3 | ShaderImporter: 4 | externalObjects: {} 5 | defaultTextures: [] 6 | nonModifiableTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Shaders/Surface/Glow.shader: -------------------------------------------------------------------------------- 1 | Shader "Zigurous/Blending/Surface/Glow" 2 | { 3 | Properties 4 | { 5 | _MainColor ("Main Color", Color) = (1,1,1,1) 6 | _MainTex ("Main Texture", 2D) = "white" {} 7 | 8 | _BlendColor ("Blend Color", Color) = (1,1,1,1) 9 | _BlendTex ("Blend Texture", 2D) = "white" {} 10 | 11 | _Glossiness ("Smoothness", Range(0, 1)) = 0.5 12 | _Metallic ("Metallic", Range(0, 1)) = 0 13 | } 14 | 15 | SubShader 16 | { 17 | Tags { "RenderType"="Opaque" } 18 | LOD 200 19 | 20 | CGPROGRAM 21 | 22 | #include "../Blending.cginc" 23 | 24 | #pragma surface surf Standard fullforwardshadows 25 | #pragma target 3.0 26 | 27 | sampler2D _MainTex; 28 | sampler2D _BlendTex; 29 | 30 | struct Input 31 | { 32 | float2 uv_MainTex; 33 | float2 uv_BlendTex; 34 | }; 35 | 36 | fixed4 _MainColor; 37 | fixed4 _BlendColor; 38 | 39 | half _Glossiness; 40 | half _Metallic; 41 | 42 | void surf(Input IN, inout SurfaceOutputStandard o) 43 | { 44 | fixed4 a = lerp(_MainColor, tex2D(_MainTex, IN.uv_MainTex) * _MainColor, _MainColor.a); 45 | fixed4 b = tex2D(_BlendTex, IN.uv_BlendTex) * _BlendColor; 46 | fixed3 c = lerp(a, glow(a, b), _BlendColor.a); 47 | 48 | o.Albedo = c.rgb; 49 | o.Metallic = _Metallic; 50 | o.Smoothness = _Glossiness; 51 | } 52 | 53 | ENDCG 54 | } 55 | 56 | FallBack "Diffuse" 57 | } 58 | -------------------------------------------------------------------------------- /Shaders/Surface/Glow.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 268d28d17da56d84fa72bec6c2d9cda5 3 | ShaderImporter: 4 | externalObjects: {} 5 | defaultTextures: [] 6 | nonModifiableTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Shaders/Surface/HardLight.shader: -------------------------------------------------------------------------------- 1 | Shader "Zigurous/Blending/Surface/Hard Light" 2 | { 3 | Properties 4 | { 5 | _MainColor ("Main Color", Color) = (1,1,1,1) 6 | _MainTex ("Main Texture", 2D) = "white" {} 7 | 8 | _BlendColor ("Blend Color", Color) = (1,1,1,1) 9 | _BlendTex ("Blend Texture", 2D) = "white" {} 10 | 11 | _Glossiness ("Smoothness", Range(0, 1)) = 0.5 12 | _Metallic ("Metallic", Range(0, 1)) = 0 13 | } 14 | 15 | SubShader 16 | { 17 | Tags { "RenderType"="Opaque" } 18 | LOD 200 19 | 20 | CGPROGRAM 21 | 22 | #include "../Blending.cginc" 23 | 24 | #pragma surface surf Standard fullforwardshadows 25 | #pragma target 3.0 26 | 27 | sampler2D _MainTex; 28 | sampler2D _BlendTex; 29 | 30 | struct Input 31 | { 32 | float2 uv_MainTex; 33 | float2 uv_BlendTex; 34 | }; 35 | 36 | fixed4 _MainColor; 37 | fixed4 _BlendColor; 38 | 39 | half _Glossiness; 40 | half _Metallic; 41 | 42 | void surf(Input IN, inout SurfaceOutputStandard o) 43 | { 44 | fixed4 a = lerp(_MainColor, tex2D(_MainTex, IN.uv_MainTex) * _MainColor, _MainColor.a); 45 | fixed4 b = tex2D(_BlendTex, IN.uv_BlendTex) * _BlendColor; 46 | fixed3 c = lerp(a, hardLight(a, b), _BlendColor.a); 47 | 48 | o.Albedo = c.rgb; 49 | o.Metallic = _Metallic; 50 | o.Smoothness = _Glossiness; 51 | } 52 | 53 | ENDCG 54 | } 55 | 56 | FallBack "Diffuse" 57 | } 58 | -------------------------------------------------------------------------------- /Shaders/Surface/HardLight.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7568328b18c89b547b2e05288dbd451a 3 | ShaderImporter: 4 | externalObjects: {} 5 | defaultTextures: [] 6 | nonModifiableTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Shaders/Surface/HardMix.shader: -------------------------------------------------------------------------------- 1 | Shader "Zigurous/Blending/Surface/Hard Mix" 2 | { 3 | Properties 4 | { 5 | _MainColor ("Main Color", Color) = (1,1,1,1) 6 | _MainTex ("Main Texture", 2D) = "white" {} 7 | 8 | _BlendColor ("Blend Color", Color) = (1,1,1,1) 9 | _BlendTex ("Blend Texture", 2D) = "white" {} 10 | 11 | _Glossiness ("Smoothness", Range(0, 1)) = 0.5 12 | _Metallic ("Metallic", Range(0, 1)) = 0 13 | } 14 | 15 | SubShader 16 | { 17 | Tags { "RenderType"="Opaque" } 18 | LOD 200 19 | 20 | CGPROGRAM 21 | 22 | #include "../Blending.cginc" 23 | 24 | #pragma surface surf Standard fullforwardshadows 25 | #pragma target 3.0 26 | 27 | sampler2D _MainTex; 28 | sampler2D _BlendTex; 29 | 30 | struct Input 31 | { 32 | float2 uv_MainTex; 33 | float2 uv_BlendTex; 34 | }; 35 | 36 | fixed4 _MainColor; 37 | fixed4 _BlendColor; 38 | 39 | half _Glossiness; 40 | half _Metallic; 41 | 42 | void surf(Input IN, inout SurfaceOutputStandard o) 43 | { 44 | fixed4 a = lerp(_MainColor, tex2D(_MainTex, IN.uv_MainTex) * _MainColor, _MainColor.a); 45 | fixed4 b = tex2D(_BlendTex, IN.uv_BlendTex) * _BlendColor; 46 | fixed3 c = lerp(a, hardMix(a, b), _BlendColor.a); 47 | 48 | o.Albedo = c.rgb; 49 | o.Metallic = _Metallic; 50 | o.Smoothness = _Glossiness; 51 | } 52 | 53 | ENDCG 54 | } 55 | 56 | FallBack "Diffuse" 57 | } 58 | -------------------------------------------------------------------------------- /Shaders/Surface/HardMix.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7e4641fe36a516e44ac5b0a574c01a01 3 | ShaderImporter: 4 | externalObjects: {} 5 | defaultTextures: [] 6 | nonModifiableTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Shaders/Surface/Lighten.shader: -------------------------------------------------------------------------------- 1 | Shader "Zigurous/Blending/Surface/Lighten" 2 | { 3 | Properties 4 | { 5 | _MainColor ("Main Color", Color) = (1,1,1,1) 6 | _MainTex ("Main Texture", 2D) = "white" {} 7 | 8 | _BlendColor ("Blend Color", Color) = (1,1,1,1) 9 | _BlendTex ("Blend Texture", 2D) = "white" {} 10 | 11 | _Glossiness ("Smoothness", Range(0, 1)) = 0.5 12 | _Metallic ("Metallic", Range(0, 1)) = 0 13 | } 14 | 15 | SubShader 16 | { 17 | Tags { "RenderType"="Opaque" } 18 | LOD 200 19 | 20 | CGPROGRAM 21 | 22 | #include "../Blending.cginc" 23 | 24 | #pragma surface surf Standard fullforwardshadows 25 | #pragma target 3.0 26 | 27 | sampler2D _MainTex; 28 | sampler2D _BlendTex; 29 | 30 | struct Input 31 | { 32 | float2 uv_MainTex; 33 | float2 uv_BlendTex; 34 | }; 35 | 36 | fixed4 _MainColor; 37 | fixed4 _BlendColor; 38 | 39 | half _Glossiness; 40 | half _Metallic; 41 | 42 | void surf(Input IN, inout SurfaceOutputStandard o) 43 | { 44 | fixed4 a = lerp(_MainColor, tex2D(_MainTex, IN.uv_MainTex) * _MainColor, _MainColor.a); 45 | fixed4 b = tex2D(_BlendTex, IN.uv_BlendTex) * _BlendColor; 46 | fixed3 c = lerp(a, lighten(a, b), _BlendColor.a); 47 | 48 | o.Albedo = c.rgb; 49 | o.Metallic = _Metallic; 50 | o.Smoothness = _Glossiness; 51 | } 52 | 53 | ENDCG 54 | } 55 | 56 | FallBack "Diffuse" 57 | } 58 | -------------------------------------------------------------------------------- /Shaders/Surface/Lighten.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b1d281b362283ac4e838e4620e549d0f 3 | ShaderImporter: 4 | externalObjects: {} 5 | defaultTextures: [] 6 | nonModifiableTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Shaders/Surface/LinearBurn.shader: -------------------------------------------------------------------------------- 1 | Shader "Zigurous/Blending/Surface/Linear Burn" 2 | { 3 | Properties 4 | { 5 | _MainColor ("Main Color", Color) = (1,1,1,1) 6 | _MainTex ("Main Texture", 2D) = "white" {} 7 | 8 | _BlendColor ("Blend Color", Color) = (1,1,1,1) 9 | _BlendTex ("Blend Texture", 2D) = "white" {} 10 | 11 | _Glossiness ("Smoothness", Range(0, 1)) = 0.5 12 | _Metallic ("Metallic", Range(0, 1)) = 0 13 | } 14 | 15 | SubShader 16 | { 17 | Tags { "RenderType"="Opaque" } 18 | LOD 200 19 | 20 | CGPROGRAM 21 | 22 | #include "../Blending.cginc" 23 | 24 | #pragma surface surf Standard fullforwardshadows 25 | #pragma target 3.0 26 | 27 | sampler2D _MainTex; 28 | sampler2D _BlendTex; 29 | 30 | struct Input 31 | { 32 | float2 uv_MainTex; 33 | float2 uv_BlendTex; 34 | }; 35 | 36 | fixed4 _MainColor; 37 | fixed4 _BlendColor; 38 | 39 | half _Glossiness; 40 | half _Metallic; 41 | 42 | void surf(Input IN, inout SurfaceOutputStandard o) 43 | { 44 | fixed4 a = lerp(_MainColor, tex2D(_MainTex, IN.uv_MainTex) * _MainColor, _MainColor.a); 45 | fixed4 b = tex2D(_BlendTex, IN.uv_BlendTex) * _BlendColor; 46 | fixed3 c = lerp(a, linearBurn(a, b), _BlendColor.a); 47 | 48 | o.Albedo = c.rgb; 49 | o.Metallic = _Metallic; 50 | o.Smoothness = _Glossiness; 51 | } 52 | 53 | ENDCG 54 | } 55 | 56 | FallBack "Diffuse" 57 | } 58 | -------------------------------------------------------------------------------- /Shaders/Surface/LinearBurn.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0f26595e0e0d7954ea28d1b32cf5815a 3 | ShaderImporter: 4 | externalObjects: {} 5 | defaultTextures: [] 6 | nonModifiableTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Shaders/Surface/LinearDodge.shader: -------------------------------------------------------------------------------- 1 | Shader "Zigurous/Blending/Surface/Linear Dodge" 2 | { 3 | Properties 4 | { 5 | _MainColor ("Main Color", Color) = (1,1,1,1) 6 | _MainTex ("Main Texture", 2D) = "white" {} 7 | 8 | _BlendColor ("Blend Color", Color) = (1,1,1,1) 9 | _BlendTex ("Blend Texture", 2D) = "white" {} 10 | 11 | _Glossiness ("Smoothness", Range(0, 1)) = 0.5 12 | _Metallic ("Metallic", Range(0, 1)) = 0 13 | } 14 | 15 | SubShader 16 | { 17 | Tags { "RenderType"="Opaque" } 18 | LOD 200 19 | 20 | CGPROGRAM 21 | 22 | #include "../Blending.cginc" 23 | 24 | #pragma surface surf Standard fullforwardshadows 25 | #pragma target 3.0 26 | 27 | sampler2D _MainTex; 28 | sampler2D _BlendTex; 29 | 30 | struct Input 31 | { 32 | float2 uv_MainTex; 33 | float2 uv_BlendTex; 34 | }; 35 | 36 | fixed4 _MainColor; 37 | fixed4 _BlendColor; 38 | 39 | half _Glossiness; 40 | half _Metallic; 41 | 42 | void surf(Input IN, inout SurfaceOutputStandard o) 43 | { 44 | fixed4 a = lerp(_MainColor, tex2D(_MainTex, IN.uv_MainTex) * _MainColor, _MainColor.a); 45 | fixed4 b = tex2D(_BlendTex, IN.uv_BlendTex) * _BlendColor; 46 | fixed3 c = lerp(a, linearDodge(a, b), _BlendColor.a); 47 | 48 | o.Albedo = c.rgb; 49 | o.Metallic = _Metallic; 50 | o.Smoothness = _Glossiness; 51 | } 52 | 53 | ENDCG 54 | } 55 | 56 | FallBack "Diffuse" 57 | } 58 | -------------------------------------------------------------------------------- /Shaders/Surface/LinearDodge.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d135d7f2dc22e5c41923012774ca8dfb 3 | ShaderImporter: 4 | externalObjects: {} 5 | defaultTextures: [] 6 | nonModifiableTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Shaders/Surface/LinearLight.shader: -------------------------------------------------------------------------------- 1 | Shader "Zigurous/Blending/Surface/Linear Light" 2 | { 3 | Properties 4 | { 5 | _MainColor ("Main Color", Color) = (1,1,1,1) 6 | _MainTex ("Main Texture", 2D) = "white" {} 7 | 8 | _BlendColor ("Blend Color", Color) = (1,1,1,1) 9 | _BlendTex ("Blend Texture", 2D) = "white" {} 10 | 11 | _Glossiness ("Smoothness", Range(0, 1)) = 0.5 12 | _Metallic ("Metallic", Range(0, 1)) = 0 13 | } 14 | 15 | SubShader 16 | { 17 | Tags { "RenderType"="Opaque" } 18 | LOD 200 19 | 20 | CGPROGRAM 21 | 22 | #include "../Blending.cginc" 23 | 24 | #pragma surface surf Standard fullforwardshadows 25 | #pragma target 3.0 26 | 27 | sampler2D _MainTex; 28 | sampler2D _BlendTex; 29 | 30 | struct Input 31 | { 32 | float2 uv_MainTex; 33 | float2 uv_BlendTex; 34 | }; 35 | 36 | fixed4 _MainColor; 37 | fixed4 _BlendColor; 38 | 39 | half _Glossiness; 40 | half _Metallic; 41 | 42 | void surf(Input IN, inout SurfaceOutputStandard o) 43 | { 44 | fixed4 a = lerp(_MainColor, tex2D(_MainTex, IN.uv_MainTex) * _MainColor, _MainColor.a); 45 | fixed4 b = tex2D(_BlendTex, IN.uv_BlendTex) * _BlendColor; 46 | fixed3 c = lerp(a, linearLight(a, b), _BlendColor.a); 47 | 48 | o.Albedo = c.rgb; 49 | o.Metallic = _Metallic; 50 | o.Smoothness = _Glossiness; 51 | } 52 | 53 | ENDCG 54 | } 55 | 56 | FallBack "Diffuse" 57 | } 58 | -------------------------------------------------------------------------------- /Shaders/Surface/LinearLight.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 142e621384c622a4b8f57dce31bb680c 3 | ShaderImporter: 4 | externalObjects: {} 5 | defaultTextures: [] 6 | nonModifiableTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Shaders/Surface/Multiply.shader: -------------------------------------------------------------------------------- 1 | Shader "Zigurous/Blending/Surface/Multiply" 2 | { 3 | Properties 4 | { 5 | _MainColor ("Main Color", Color) = (1,1,1,1) 6 | _MainTex ("Main Texture", 2D) = "white" {} 7 | 8 | _BlendColor ("Blend Color", Color) = (1,1,1,1) 9 | _BlendTex ("Blend Texture", 2D) = "white" {} 10 | 11 | _Glossiness ("Smoothness", Range(0, 1)) = 0.5 12 | _Metallic ("Metallic", Range(0, 1)) = 0 13 | } 14 | 15 | SubShader 16 | { 17 | Tags { "RenderType"="Opaque" } 18 | LOD 200 19 | 20 | CGPROGRAM 21 | 22 | #include "../Blending.cginc" 23 | 24 | #pragma surface surf Standard fullforwardshadows 25 | #pragma target 3.0 26 | 27 | sampler2D _MainTex; 28 | sampler2D _BlendTex; 29 | 30 | struct Input 31 | { 32 | float2 uv_MainTex; 33 | float2 uv_BlendTex; 34 | }; 35 | 36 | fixed4 _MainColor; 37 | fixed4 _BlendColor; 38 | 39 | half _Glossiness; 40 | half _Metallic; 41 | 42 | void surf(Input IN, inout SurfaceOutputStandard o) 43 | { 44 | fixed4 a = lerp(_MainColor, tex2D(_MainTex, IN.uv_MainTex) * _MainColor, _MainColor.a); 45 | fixed4 b = tex2D(_BlendTex, IN.uv_BlendTex) * _BlendColor; 46 | fixed3 c = lerp(a, multiply(a, b), _BlendColor.a); 47 | 48 | o.Albedo = c.rgb; 49 | o.Metallic = _Metallic; 50 | o.Smoothness = _Glossiness; 51 | } 52 | 53 | ENDCG 54 | } 55 | 56 | FallBack "Diffuse" 57 | } 58 | -------------------------------------------------------------------------------- /Shaders/Surface/Multiply.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5bd7644c2e54b314d91d44748ab05809 3 | ShaderImporter: 4 | externalObjects: {} 5 | defaultTextures: [] 6 | nonModifiableTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Shaders/Surface/Negation.shader: -------------------------------------------------------------------------------- 1 | Shader "Zigurous/Blending/Surface/Negation" 2 | { 3 | Properties 4 | { 5 | _MainColor ("Main Color", Color) = (1,1,1,1) 6 | _MainTex ("Main Texture", 2D) = "white" {} 7 | 8 | _BlendColor ("Blend Color", Color) = (1,1,1,1) 9 | _BlendTex ("Blend Texture", 2D) = "white" {} 10 | 11 | _Glossiness ("Smoothness", Range(0, 1)) = 0.5 12 | _Metallic ("Metallic", Range(0, 1)) = 0 13 | } 14 | 15 | SubShader 16 | { 17 | Tags { "RenderType"="Opaque" } 18 | LOD 200 19 | 20 | CGPROGRAM 21 | 22 | #include "../Blending.cginc" 23 | 24 | #pragma surface surf Standard fullforwardshadows 25 | #pragma target 3.0 26 | 27 | sampler2D _MainTex; 28 | sampler2D _BlendTex; 29 | 30 | struct Input 31 | { 32 | float2 uv_MainTex; 33 | float2 uv_BlendTex; 34 | }; 35 | 36 | fixed4 _MainColor; 37 | fixed4 _BlendColor; 38 | 39 | half _Glossiness; 40 | half _Metallic; 41 | 42 | void surf(Input IN, inout SurfaceOutputStandard o) 43 | { 44 | fixed4 a = lerp(_MainColor, tex2D(_MainTex, IN.uv_MainTex) * _MainColor, _MainColor.a); 45 | fixed4 b = tex2D(_BlendTex, IN.uv_BlendTex) * _BlendColor; 46 | fixed3 c = lerp(a, negation(a, b), _BlendColor.a); 47 | 48 | o.Albedo = c.rgb; 49 | o.Metallic = _Metallic; 50 | o.Smoothness = _Glossiness; 51 | } 52 | 53 | ENDCG 54 | } 55 | 56 | FallBack "Diffuse" 57 | } 58 | -------------------------------------------------------------------------------- /Shaders/Surface/Negation.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5121b734b9b59fc46a0eda02f3dc7094 3 | ShaderImporter: 4 | externalObjects: {} 5 | defaultTextures: [] 6 | nonModifiableTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Shaders/Surface/Overlay.shader: -------------------------------------------------------------------------------- 1 | Shader "Zigurous/Blending/Surface/Overlay" 2 | { 3 | Properties 4 | { 5 | _MainColor ("Main Color", Color) = (1,1,1,1) 6 | _MainTex ("Main Texture", 2D) = "white" {} 7 | 8 | _BlendColor ("Blend Color", Color) = (1,1,1,1) 9 | _BlendTex ("Blend Texture", 2D) = "white" {} 10 | 11 | _Glossiness ("Smoothness", Range(0, 1)) = 0.5 12 | _Metallic ("Metallic", Range(0, 1)) = 0 13 | } 14 | 15 | SubShader 16 | { 17 | Tags { "RenderType"="Opaque" } 18 | LOD 200 19 | 20 | CGPROGRAM 21 | 22 | #include "../Blending.cginc" 23 | 24 | #pragma surface surf Standard fullforwardshadows 25 | #pragma target 3.0 26 | 27 | sampler2D _MainTex; 28 | sampler2D _BlendTex; 29 | 30 | struct Input 31 | { 32 | float2 uv_MainTex; 33 | float2 uv_BlendTex; 34 | }; 35 | 36 | fixed4 _MainColor; 37 | fixed4 _BlendColor; 38 | 39 | half _Glossiness; 40 | half _Metallic; 41 | 42 | void surf(Input IN, inout SurfaceOutputStandard o) 43 | { 44 | fixed4 a = lerp(_MainColor, tex2D(_MainTex, IN.uv_MainTex) * _MainColor, _MainColor.a); 45 | fixed4 b = tex2D(_BlendTex, IN.uv_BlendTex) * _BlendColor; 46 | fixed3 c = lerp(a, overlay(a, b), _BlendColor.a); 47 | 48 | o.Albedo = c.rgb; 49 | o.Metallic = _Metallic; 50 | o.Smoothness = _Glossiness; 51 | } 52 | 53 | ENDCG 54 | } 55 | 56 | FallBack "Diffuse" 57 | } 58 | -------------------------------------------------------------------------------- /Shaders/Surface/Overlay.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ae548bbed10a9df48a8bc30c264614c9 3 | ShaderImporter: 4 | externalObjects: {} 5 | defaultTextures: [] 6 | nonModifiableTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Shaders/Surface/Phoenix.shader: -------------------------------------------------------------------------------- 1 | Shader "Zigurous/Blending/Surface/Phoenix" 2 | { 3 | Properties 4 | { 5 | _MainColor ("Main Color", Color) = (1,1,1,1) 6 | _MainTex ("Main Texture", 2D) = "white" {} 7 | 8 | _BlendColor ("Blend Color", Color) = (1,1,1,1) 9 | _BlendTex ("Blend Texture", 2D) = "white" {} 10 | 11 | _Glossiness ("Smoothness", Range(0, 1)) = 0.5 12 | _Metallic ("Metallic", Range(0, 1)) = 0 13 | } 14 | 15 | SubShader 16 | { 17 | Tags { "RenderType"="Opaque" } 18 | LOD 200 19 | 20 | CGPROGRAM 21 | 22 | #include "../Blending.cginc" 23 | 24 | #pragma surface surf Standard fullforwardshadows 25 | #pragma target 3.0 26 | 27 | sampler2D _MainTex; 28 | sampler2D _BlendTex; 29 | 30 | struct Input 31 | { 32 | float2 uv_MainTex; 33 | float2 uv_BlendTex; 34 | }; 35 | 36 | fixed4 _MainColor; 37 | fixed4 _BlendColor; 38 | 39 | half _Glossiness; 40 | half _Metallic; 41 | 42 | void surf(Input IN, inout SurfaceOutputStandard o) 43 | { 44 | fixed4 a = lerp(_MainColor, tex2D(_MainTex, IN.uv_MainTex) * _MainColor, _MainColor.a); 45 | fixed4 b = tex2D(_BlendTex, IN.uv_BlendTex) * _BlendColor; 46 | fixed3 c = lerp(a, phoenix(a, b), _BlendColor.a); 47 | 48 | o.Albedo = c.rgb; 49 | o.Metallic = _Metallic; 50 | o.Smoothness = _Glossiness; 51 | } 52 | 53 | ENDCG 54 | } 55 | 56 | FallBack "Diffuse" 57 | } 58 | -------------------------------------------------------------------------------- /Shaders/Surface/Phoenix.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5a1ee6ec019139243a81b8ce75e079ba 3 | ShaderImporter: 4 | externalObjects: {} 5 | defaultTextures: [] 6 | nonModifiableTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Shaders/Surface/PinLight.shader: -------------------------------------------------------------------------------- 1 | Shader "Zigurous/Blending/Surface/Pin Light" 2 | { 3 | Properties 4 | { 5 | _MainColor ("Main Color", Color) = (1,1,1,1) 6 | _MainTex ("Main Texture", 2D) = "white" {} 7 | 8 | _BlendColor ("Blend Color", Color) = (1,1,1,1) 9 | _BlendTex ("Blend Texture", 2D) = "white" {} 10 | 11 | _Glossiness ("Smoothness", Range(0, 1)) = 0.5 12 | _Metallic ("Metallic", Range(0, 1)) = 0 13 | } 14 | 15 | SubShader 16 | { 17 | Tags { "RenderType"="Opaque" } 18 | LOD 200 19 | 20 | CGPROGRAM 21 | 22 | #include "../Blending.cginc" 23 | 24 | #pragma surface surf Standard fullforwardshadows 25 | #pragma target 3.0 26 | 27 | sampler2D _MainTex; 28 | sampler2D _BlendTex; 29 | 30 | struct Input 31 | { 32 | float2 uv_MainTex; 33 | float2 uv_BlendTex; 34 | }; 35 | 36 | fixed4 _MainColor; 37 | fixed4 _BlendColor; 38 | 39 | half _Glossiness; 40 | half _Metallic; 41 | 42 | void surf(Input IN, inout SurfaceOutputStandard o) 43 | { 44 | fixed4 a = lerp(_MainColor, tex2D(_MainTex, IN.uv_MainTex) * _MainColor, _MainColor.a); 45 | fixed4 b = tex2D(_BlendTex, IN.uv_BlendTex) * _BlendColor; 46 | fixed3 c = lerp(a, pinLight(a, b), _BlendColor.a); 47 | 48 | o.Albedo = c.rgb; 49 | o.Metallic = _Metallic; 50 | o.Smoothness = _Glossiness; 51 | } 52 | 53 | ENDCG 54 | } 55 | 56 | FallBack "Diffuse" 57 | } 58 | -------------------------------------------------------------------------------- /Shaders/Surface/PinLight.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b0626f4cc2c40fc4e99a307eb2d6c863 3 | ShaderImporter: 4 | externalObjects: {} 5 | defaultTextures: [] 6 | nonModifiableTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Shaders/Surface/Reflect.shader: -------------------------------------------------------------------------------- 1 | Shader "Zigurous/Blending/Surface/Reflect" 2 | { 3 | Properties 4 | { 5 | _MainColor ("Main Color", Color) = (1,1,1,1) 6 | _MainTex ("Main Texture", 2D) = "white" {} 7 | 8 | _BlendColor ("Blend Color", Color) = (1,1,1,1) 9 | _BlendTex ("Blend Texture", 2D) = "white" {} 10 | 11 | _Glossiness ("Smoothness", Range(0, 1)) = 0.5 12 | _Metallic ("Metallic", Range(0, 1)) = 0 13 | } 14 | 15 | SubShader 16 | { 17 | Tags { "RenderType"="Opaque" } 18 | LOD 200 19 | 20 | CGPROGRAM 21 | 22 | #include "../Blending.cginc" 23 | 24 | #pragma surface surf Standard fullforwardshadows 25 | #pragma target 3.0 26 | 27 | sampler2D _MainTex; 28 | sampler2D _BlendTex; 29 | 30 | struct Input 31 | { 32 | float2 uv_MainTex; 33 | float2 uv_BlendTex; 34 | }; 35 | 36 | fixed4 _MainColor; 37 | fixed4 _BlendColor; 38 | 39 | half _Glossiness; 40 | half _Metallic; 41 | 42 | void surf(Input IN, inout SurfaceOutputStandard o) 43 | { 44 | fixed4 a = lerp(_MainColor, tex2D(_MainTex, IN.uv_MainTex) * _MainColor, _MainColor.a); 45 | fixed4 b = tex2D(_BlendTex, IN.uv_BlendTex) * _BlendColor; 46 | fixed3 c = lerp(a, reflect(a, b), _BlendColor.a); 47 | 48 | o.Albedo = c.rgb; 49 | o.Metallic = _Metallic; 50 | o.Smoothness = _Glossiness; 51 | } 52 | 53 | ENDCG 54 | } 55 | 56 | FallBack "Diffuse" 57 | } 58 | -------------------------------------------------------------------------------- /Shaders/Surface/Reflect.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 583b19045ebbeb648b66a50b4a485992 3 | ShaderImporter: 4 | externalObjects: {} 5 | defaultTextures: [] 6 | nonModifiableTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Shaders/Surface/Screen.shader: -------------------------------------------------------------------------------- 1 | Shader "Zigurous/Blending/Surface/Screen" 2 | { 3 | Properties 4 | { 5 | _MainColor ("Main Color", Color) = (1,1,1,1) 6 | _MainTex ("Main Texture", 2D) = "white" {} 7 | 8 | _BlendColor ("Blend Color", Color) = (1,1,1,1) 9 | _BlendTex ("Blend Texture", 2D) = "white" {} 10 | 11 | _Glossiness ("Smoothness", Range(0, 1)) = 0.5 12 | _Metallic ("Metallic", Range(0, 1)) = 0 13 | } 14 | 15 | SubShader 16 | { 17 | Tags { "RenderType"="Opaque" } 18 | LOD 200 19 | 20 | CGPROGRAM 21 | 22 | #include "../Blending.cginc" 23 | 24 | #pragma surface surf Standard fullforwardshadows 25 | #pragma target 3.0 26 | 27 | sampler2D _MainTex; 28 | sampler2D _BlendTex; 29 | 30 | struct Input 31 | { 32 | float2 uv_MainTex; 33 | float2 uv_BlendTex; 34 | }; 35 | 36 | fixed4 _MainColor; 37 | fixed4 _BlendColor; 38 | 39 | half _Glossiness; 40 | half _Metallic; 41 | 42 | void surf(Input IN, inout SurfaceOutputStandard o) 43 | { 44 | fixed4 a = lerp(_MainColor, tex2D(_MainTex, IN.uv_MainTex) * _MainColor, _MainColor.a); 45 | fixed4 b = tex2D(_BlendTex, IN.uv_BlendTex) * _BlendColor; 46 | fixed3 c = lerp(a, screen(a, b), _BlendColor.a); 47 | 48 | o.Albedo = c.rgb; 49 | o.Metallic = _Metallic; 50 | o.Smoothness = _Glossiness; 51 | } 52 | 53 | ENDCG 54 | } 55 | 56 | FallBack "Diffuse" 57 | } 58 | -------------------------------------------------------------------------------- /Shaders/Surface/Screen.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: dffcb006e7d6c004e9f5c00b9cf79679 3 | ShaderImporter: 4 | externalObjects: {} 5 | defaultTextures: [] 6 | nonModifiableTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Shaders/Surface/SoftLight.shader: -------------------------------------------------------------------------------- 1 | Shader "Zigurous/Blending/Surface/Soft Light" 2 | { 3 | Properties 4 | { 5 | _MainColor ("Main Color", Color) = (1,1,1,1) 6 | _MainTex ("Main Texture", 2D) = "white" {} 7 | 8 | _BlendColor ("Blend Color", Color) = (1,1,1,1) 9 | _BlendTex ("Blend Texture", 2D) = "white" {} 10 | 11 | _Glossiness ("Smoothness", Range(0, 1)) = 0.5 12 | _Metallic ("Metallic", Range(0, 1)) = 0 13 | } 14 | 15 | SubShader 16 | { 17 | Tags { "RenderType"="Opaque" } 18 | LOD 200 19 | 20 | CGPROGRAM 21 | 22 | #include "../Blending.cginc" 23 | 24 | #pragma surface surf Standard fullforwardshadows 25 | #pragma target 3.0 26 | 27 | sampler2D _MainTex; 28 | sampler2D _BlendTex; 29 | 30 | struct Input 31 | { 32 | float2 uv_MainTex; 33 | float2 uv_BlendTex; 34 | }; 35 | 36 | fixed4 _MainColor; 37 | fixed4 _BlendColor; 38 | 39 | half _Glossiness; 40 | half _Metallic; 41 | 42 | void surf(Input IN, inout SurfaceOutputStandard o) 43 | { 44 | fixed4 a = lerp(_MainColor, tex2D(_MainTex, IN.uv_MainTex) * _MainColor, _MainColor.a); 45 | fixed4 b = tex2D(_BlendTex, IN.uv_BlendTex) * _BlendColor; 46 | fixed3 c = lerp(a, softLight(a, b), _BlendColor.a); 47 | 48 | o.Albedo = c.rgb; 49 | o.Metallic = _Metallic; 50 | o.Smoothness = _Glossiness; 51 | } 52 | 53 | ENDCG 54 | } 55 | 56 | FallBack "Diffuse" 57 | } 58 | -------------------------------------------------------------------------------- /Shaders/Surface/SoftLight.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 808b0ed9990cf284eaae1c8a15d3895f 3 | ShaderImporter: 4 | externalObjects: {} 5 | defaultTextures: [] 6 | nonModifiableTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Shaders/Surface/Subtract.shader: -------------------------------------------------------------------------------- 1 | Shader "Zigurous/Blending/Surface/Subtract" 2 | { 3 | Properties 4 | { 5 | _MainColor ("Main Color", Color) = (1,1,1,1) 6 | _MainTex ("Main Texture", 2D) = "white" {} 7 | 8 | _BlendColor ("Blend Color", Color) = (1,1,1,1) 9 | _BlendTex ("Blend Texture", 2D) = "white" {} 10 | 11 | _Glossiness ("Smoothness", Range(0, 1)) = 0.5 12 | _Metallic ("Metallic", Range(0, 1)) = 0 13 | } 14 | 15 | SubShader 16 | { 17 | Tags { "RenderType"="Opaque" } 18 | LOD 200 19 | 20 | CGPROGRAM 21 | 22 | #include "../Blending.cginc" 23 | 24 | #pragma surface surf Standard fullforwardshadows 25 | #pragma target 3.0 26 | 27 | sampler2D _MainTex; 28 | sampler2D _BlendTex; 29 | 30 | struct Input 31 | { 32 | float2 uv_MainTex; 33 | float2 uv_BlendTex; 34 | }; 35 | 36 | fixed4 _MainColor; 37 | fixed4 _BlendColor; 38 | 39 | half _Glossiness; 40 | half _Metallic; 41 | 42 | void surf(Input IN, inout SurfaceOutputStandard o) 43 | { 44 | fixed4 a = lerp(_MainColor, tex2D(_MainTex, IN.uv_MainTex) * _MainColor, _MainColor.a); 45 | fixed4 b = tex2D(_BlendTex, IN.uv_BlendTex) * _BlendColor; 46 | fixed3 c = lerp(a, subtract(a, b), _BlendColor.a); 47 | 48 | o.Albedo = c.rgb; 49 | o.Metallic = _Metallic; 50 | o.Smoothness = _Glossiness; 51 | } 52 | 53 | ENDCG 54 | } 55 | 56 | FallBack "Diffuse" 57 | } 58 | -------------------------------------------------------------------------------- /Shaders/Surface/Subtract.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 30a2de8cd88dcee48a3bd79e0e4cffeb 3 | ShaderImporter: 4 | externalObjects: {} 5 | defaultTextures: [] 6 | nonModifiableTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Shaders/Surface/VividLight.shader: -------------------------------------------------------------------------------- 1 | Shader "Zigurous/Blending/Surface/Vivid Light" 2 | { 3 | Properties 4 | { 5 | _MainColor ("Main Color", Color) = (1,1,1,1) 6 | _MainTex ("Main Texture", 2D) = "white" {} 7 | 8 | _BlendColor ("Blend Color", Color) = (1,1,1,1) 9 | _BlendTex ("Blend Texture", 2D) = "white" {} 10 | 11 | _Glossiness ("Smoothness", Range(0, 1)) = 0.5 12 | _Metallic ("Metallic", Range(0, 1)) = 0 13 | } 14 | 15 | SubShader 16 | { 17 | Tags { "RenderType"="Opaque" } 18 | LOD 200 19 | 20 | CGPROGRAM 21 | 22 | #include "../Blending.cginc" 23 | 24 | #pragma surface surf Standard fullforwardshadows 25 | #pragma target 3.0 26 | 27 | sampler2D _MainTex; 28 | sampler2D _BlendTex; 29 | 30 | struct Input 31 | { 32 | float2 uv_MainTex; 33 | float2 uv_BlendTex; 34 | }; 35 | 36 | fixed4 _MainColor; 37 | fixed4 _BlendColor; 38 | 39 | half _Glossiness; 40 | half _Metallic; 41 | 42 | void surf(Input IN, inout SurfaceOutputStandard o) 43 | { 44 | fixed4 a = lerp(_MainColor, tex2D(_MainTex, IN.uv_MainTex) * _MainColor, _MainColor.a); 45 | fixed4 b = tex2D(_BlendTex, IN.uv_BlendTex) * _BlendColor; 46 | fixed3 c = lerp(a, vividLight(a, b), _BlendColor.a); 47 | 48 | o.Albedo = c.rgb; 49 | o.Metallic = _Metallic; 50 | o.Smoothness = _Glossiness; 51 | } 52 | 53 | ENDCG 54 | } 55 | 56 | FallBack "Diffuse" 57 | } 58 | -------------------------------------------------------------------------------- /Shaders/Surface/VividLight.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d861dda3e75d2b84e86747c1e31e0e1c 3 | ShaderImporter: 4 | externalObjects: {} 5 | defaultTextures: [] 6 | nonModifiableTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "com.zigurous.shaders.blending", 3 | "version": "2.0.0", 4 | "displayName": "Blend Shaders", 5 | "description": "The Blend Shaders package contains over 20 shaders for blending textures and sprites in Unity (based on Photoshop's blend modes).\n\nSupported Modes:\n\u2022 Add\n\u2022 Average\n\u2022 Color Burn\n\u2022 Color Dodge\n\u2022 Darken\n\u2022 Difference\n\u2022 Exclusion\n\u2022 Glow\n\u2022 Hard Light\n\u2022 Hard Mix\n\u2022 Lighten\n\u2022 Linear Burn\n\u2022 Linear Dodge\n\u2022 Linear Light\n\u2022 Multiply\n\u2022 Negation\n\u2022 Overlay\n\u2022 Phoenix\n\u2022 Pin Light\n\u2022 Reflect\n\u2022 Screen\n\u2022 Soft Light\n\u2022 Subtract\n\u2022 Vivid Light", 6 | "unity": "2019.4", 7 | "repository": "https://github.com/zigurous/unity-blend-shaders", 8 | "keywords": [ 9 | "shaders", 10 | "blending", 11 | "textures", 12 | "sprites", 13 | "surface", 14 | "fragment", 15 | "photoshop" 16 | ], 17 | "publishConfig": { 18 | "registry": "https://npm.pkg.github.com/@zigurous" 19 | }, 20 | "author": { 21 | "name": "Zigurous", 22 | "email": "support@zigurous.com", 23 | "url": "https://zigurous.com" 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /package.json.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 86f5b06f8031b814fa4c173832def405 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | --------------------------------------------------------------------------------