Ok guys, I'm working on a pseudo edge lighting effect and I need some help. I've got an arm sprite and a sprite that is just the edge light. I also have a stencil shader for the edge light. https://imgur.com/a/sIi5F4I The first question is, can you have a feathered sprite mask or stencil shader? Cause I as you can see in the picture, thee edge is too sharp to make a good lighting effect. The second is, is there a way make only the closest edges (of the edge light sprite) to the "light source" show up in the stencil? Thanks in advance! Edit: It could also work if I had a lit shader for the edge light and the opacity is dependent on the amount of light hitting it.
Anyone know a solution to this? I found this shader and it works, but the edge is to sharp. Any way to make the alpha based on the amount of light? Spoiler: LightToAlpha Code (CSharp): Shader "Custom/LightToAlpha" { Properties { _Color ("Color", Color) = (1,1,1,1) _MainTex ("Albedo (RGB)", 2D) = "white" {} _Glossiness ("Smoothness", Range(0,1)) = 0.5 _Metallic ("Metallic", Range(0,1)) = 0.0 _ALightThreshold("Light Threshold", float) = 0.0 _ALightContrast("Light Contrast", float) = 1.0 } SubShader { Tags { "RenderType"="Transparent" "Queue"="Transparent" } LOD 200 CGPROGRAM // Physically based Standard lighting model, and enable shadows on all light types #pragma surface surf Standard fullforwardshadows finalcolor:alphaLight alpha:fade // Use shader model 3.0 target, to get nicer looking lighting #pragma target 3.0 sampler2D _MainTex; struct Input { float2 uv_MainTex; }; half _Glossiness; half _Metallic; fixed4 _Color; half _ALightThreshold; half _ALightContrast; void surf (Input IN, inout SurfaceOutputStandard o) { // Albedo comes from a texture tinted by color fixed4 c = (fixed4)1.0f; o.Albedo = c.rgb; // Metallic and smoothness come from slider variables o.Metallic = _Metallic; o.Smoothness = _Glossiness; o.Alpha = c.a; } void alphaLight(Input IN, SurfaceOutputStandard o, inout fixed4 color) { fixed4 c = tex2D(_MainTex, IN.uv_MainTex) * _Color; color.a = 1.0f - saturate(c.a * saturate(dot(color.rgb, fixed3(1.0f, 1.0f, 1.0f) / 3.0f) - _ALightThreshold) * _ALightContrast); color.rgb = c.rgb; } ENDCG } FallBack "Diffuse" }