/* ██████╗░██╗░██████╗░██████╗░█████╗░██╗░░░░░██╗░░░██╗███████╗  ░██████╗██╗░░██╗░█████╗░██████╗░███████╗██████╗░ ██╔══██╗██║██╔════╝██╔════╝██╔══██╗██║░░░░░██║░░░██║██╔════╝  ██╔════╝██║░░██║██╔══██╗██╔══██╗██╔════╝██╔══██╗ ██║░░██║██║╚█████╗░╚█████╗░██║░░██║██║░░░░░╚██╗░██╔╝█████╗░░  ╚█████╗░███████║███████║██║░░██║█████╗░░██████╔╝ ██║░░██║██║░╚═══██╗░╚═══██╗██║░░██║██║░░░░░░╚████╔╝░██╔══╝░░  ░╚═══██╗██╔══██║██╔══██║██║░░██║██╔══╝░░██╔══██╗ ██████╔╝██║██████╔╝██████╔╝╚█████╔╝███████╗░░╚██╔╝░░███████╗  ██████╔╝██║░░██║██║░░██║██████╔╝███████╗██║░░██║ ╚═════╝░╚═╝╚═════╝░╚═════╝░░╚════╝░╚══════╝░░░╚═╝░░░╚══════╝  ╚═════╝░╚═╝░░╚═╝╚═╝░░╚═╝╚═════╝░╚══════╝╚═╝░░╚═╝ █▀▀▄ █──█   ▀▀█▀▀ █──█ █▀▀   ░█▀▀▄ █▀▀ ▀█─█▀ █▀▀ █── █▀▀█ █▀▀█ █▀▀ █▀▀█ █▀▀▄ █▄▄█   ─░█── █▀▀█ █▀▀   ░█─░█ █▀▀ ─█▄█─ █▀▀ █── █──█ █──█ █▀▀ █▄▄▀ ▀▀▀─ ▄▄▄█   ─░█── ▀──▀ ▀▀▀   ░█▄▄▀ ▀▀▀ ──▀── ▀▀▀ ▀▀▀ ▀▀▀▀ █▀▀▀ ▀▀▀ ▀─▀▀ ____________________________________________________________________________________________________________________________________________ ▄▀█ █▀ █▀ █▀▀ ▀█▀ ▀   █░█ █░░ ▀█▀ █ █▀▄▀█ ▄▀█ ▀█▀ █▀▀   ▄█ █▀█ ▄█▄   █▀ █░█ ▄▀█ █▀▄ █▀▀ █▀█ █▀ █▀█ ▄█ ▄█ ██▄ ░█░ ▄   █▄█ █▄▄ ░█░ █ █░▀░█ █▀█ ░█░ ██▄   ░█ █▄█ ░▀░   ▄█ █▀█ █▀█ █▄▀ ██▄ █▀▄ ▄█ ____________________________________________________________________________________________________________________________________________ License: The license is ATTRIBUTION 3.0 More license info here: https://creativecommons.org/licenses/by/3.0/ ____________________________________________________________________________________________________________________________________________ This shader has NOT been tested on any other PC configuration except the following: CPU: Intel Core i5-6400 GPU: NVidia GTX 750Ti RAM: 16GB Windows: 10 x64 DirectX: 11 ____________________________________________________________________________________________________________________________________________ */ Shader "Ultimate 10+ Shaders/Dissolve" { Properties { _Color ("Color", Color) = (1,1,1,1) _MainTex ("Albedo (RGB)", 2D) = "white" {} _NoiseTex ("Noise", 2D) = "white" {} _Cutoff ("Cut off", Range(0, 1)) = 0.25 _EdgeWidth ("Edge Width", Range(0, 1)) = 0.05 [HDR] _EdgeColor ("Edge Color", Color) = (1,1,1,1) [Enum(UnityEngine.Rendering.CullMode)] _Cull ("Cull", Float) = 2 } SubShader { Tags { "RenderType"="Geometry" "Queue"="Transparent" } LOD 200 Cull [_Cull] CGPROGRAM // Physically based Standard lighting model, and enable shadows on all light types #pragma surface surf Standard addshadow fullforwardshadows #ifndef SHADER_API_D3D11 #pragma target 3.0 #else #pragma target 4.0 #endif sampler2D _MainTex; sampler2D _NoiseTex; half _Cutoff; half _EdgeWidth; fixed4 _Color; fixed4 _EdgeColor; struct Input { float2 uv_MainTex; float2 uv_NoiseTex; }; // Add instancing support for this shader. You need to check 'Enable Instancing' on materials that use the shader. // See https://docs.unity3d.com/Manual/GPUInstancing.html for more information about instancing. // #pragma instancing_options assumeuniformscaling UNITY_INSTANCING_BUFFER_START(Props) // put more per-instance properties here UNITY_INSTANCING_BUFFER_END(Props) fixed4 noisePixel, pixel; half cutoff; void surf (Input IN, inout SurfaceOutputStandard o) { pixel = tex2D (_MainTex, IN.uv_MainTex) * _Color; o.Albedo = pixel.rgb; noisePixel = tex2D (_NoiseTex, IN.uv_NoiseTex); clip(noisePixel.r >= _Cutoff ? 1 : -1); o.Emission = noisePixel.r >= (_Cutoff * (_EdgeWidth + 1.0)) ? 0 : _EdgeColor; } ENDCG } FallBack "Diffuse" }