Shader Alpha/Transparency from LightReflection/Specular

Hi dear Devs,

Im trying to modify Shaders that works like the surface of water, but inverse in the case of lightReflections. But all my tries end up in a mess of Code without any results, with errors or 100% invisible materials.


If we take this ball for example, the shader should make it transparent where the light hits , based on the strength.
Where the light reflection is total white, the ball should be absolute invisible and only partly invisible around it.

It seemed easy, i take the o.Alpha = Specular and im done, but this didnt work out. The whole object was invisible.

Any Help is very welcome.

Specular data would not exist at that stage. Tho I can not confirm this particular feature will meet your needs, you might want to look into the Final Color Modifier. See the bottom of this page…Unity - Manual: Surface Shader examples

Hi, thanks for the reply,I just need this for confirmation;

It is not possible to make somthing like an inverted “specular only”-Shader ?

Shader "Lighting Only"
{
     Properties
     {
         _Color ("Main Color", Color) = (1,1,1,1)
         _MainTex ("Base (RGB)", 2D) = "white" {}
     }
     SubShader
     {
         Blend SrcAlpha One
         ZWrite Off
         Tags
         {
             Queue = Transparent
         }
         ColorMask RGB
         CGPROGRAM
         #pragma surface surf MyLight alpha finalcolor:mycolor
         sampler2D _MainTex;
         fixed4 _Color;
         struct Input
         {
             float2 uv_MainTex;
         };
         void surf(Input IN, inout SurfaceOutput o)
         {
             fixed4 tex = tex2D(_MainTex, IN.uv_MainTex) * _Color;
             o.Albedo = tex.rgb;
             o.Alpha = tex.a;
         }
         float lightPower;
         fixed4 LightingMyLight(SurfaceOutput s, half3 lightDir, fixed atten)
         {
             lightPower = 1 - saturate(dot(normalize(s.Normal), lightDir));
             return fixed4((s.Albedo * _LightColor0.rgb) * (lightPower * atten * 2), 1);
         }
 
         void mycolor(Input IN, SurfaceOutput o, inout fixed4 color)
         {
             color.a = o.Alpha * lightPower;
         }
         ENDCG
     }
     Fallback "VertexLit", 2
}

I took This one from

It does not give me the same Result as in the picture for 3d objects but ok, i only use 2d planes anyway.
The bigger Problem is that i need black and not like in the link red. But when i change the color or a Texture map it turns alpha.

In the end is all i want some kind of Shader that behave like fog of war to any close light (becomes transparent)