Hi I’m currently making a Hardlight Bridge (from Halo games) shader. Here is a quick clip of the current WIP version
What I would like to add is a glow effect around where objects touch the bridge. I have made a quick mockup in photoshop of what I mean here
Does anyone know how I can achieve this, This is my first time messing with shaders
In case it’s relavent, here is the code for the shader so far
Shader "Custom/Hardlight" {
Properties{
_MainTex("Texture", 2D) = "white" {}
_Alpha("Hardlight Opacity",Range(0,1)) = 0.4
_Speed("Speed",Range(0,10)) = 2
_Wobble("Wobble", Range(0,10)) = 2
_Colour("Colour", Color) = (0,0,0,0)
}
SubShader{
Tags{ "RenderType" = "Transparent" "Queue" = "Transparent" "ForceNoShadowCasting" = "True" }
CGPROGRAM
#pragma surface surf NoLighting noambient alpha
sampler2D _MainTex;
float4 _Colour;
half _Alpha;
half _Speed;
half _Wobble;
struct Input {
half2 uv_MainTex;
};
fixed4 LightingNoLighting(SurfaceOutput s, fixed3 lightDir, fixed atten)
{
fixed4 c;
c.rgb = s.Albedo;
c.a = s.Alpha;
return c;
}
void surf(Input IN, inout SurfaceOutput o)
{
o.Albedo = tex2D(_MainTex, IN.uv_MainTex + float2(0.01*(IN.uv_MainTex.y / 20 + _Time[1] * _Speed*0.5), 0.01*sin(_Speed*0.3 * _Time[1] * _Wobble)) ).r * _Colour * 0.65;
o.Albedo += tex2D(_MainTex, IN.uv_MainTex + float2(0.01*(IN.uv_MainTex.y / 20 + _Time[1] * _Speed), 0.01*cos(_Speed * _Time[1] * _Wobble))).b * _Colour;
o.Alpha = tex2D(_MainTex, IN.uv_MainTex + float2(0.01*(IN.uv_MainTex.y / 20 + _Time[1] * _Speed*0.5), 0.01*sin(_Speed*0.3 * _Time[1] * _Wobble))).r;
o.Alpha += tex2D(_MainTex, IN.uv_MainTex + float2(0.01*(IN.uv_MainTex.y / 20 + _Time[1] * _Speed), 0.01*cos(_Speed * _Time[1] * _Wobble))).b;
if (o.Alpha <= 0.2) {
o.Albedo = _Colour*1.8;
o.Alpha = 0.07;
}
o.Alpha *= _Alpha*2.5;
}
ENDCG
}
Fallback "Diffuse"
}
