- Home /
Question by
smirlianos · Nov 08, 2013 at 07:47 PM ·
shaderlightouter
Shader: Rim outer & Inner
Hello,
I have this shader that adds a light rim around an object. I tried adding another one on the center of it but it doesn't work. Any help?
Shader "-smn-/GlowingBorder" {
Properties {
_ColorTint("ColorTint", Color) = (1,1,1,1)
_MainTex("Main Texture", 2D) = "white" {}
_BumpMap("Normal Map", 2D) = "bump" {}
_RimColorOuter("Rim Color", Color) = (1,1,1,1)
_RimColorInner("Rim Color", Color) = (1,1,1,1)
_RimPower("Rim Power", Range(0.0, 5.0)) = 3.0
}
SubShader {
Tags { "RenderType" = "Opaque" }
CGPROGRAM
#pragma surface surf Lambert
struct Input {
float4 color : COLOR;
float2 uv_MainTex;
float2 uv_BumpMap;
float3 viewDir;
};
float4 _ColorTint;
sampler2D _MainTex;
sampler2D _BumpMap;
float4 _RimColorOuter;
float4 _RimColorInner;
float _RimPower;
void surf (Input IN, inout SurfaceOutput o) {
IN.color = _ColorTint;
o.Albedo = tex2D(_MainTex, IN.uv_MainTex).rgb * IN.color;
o.Normal = UnpackNormal(tex2D(_BumpMap, IN.uv_BumpMap));
half rimOuter = 1.0 -saturate(dot(normalize(IN.viewDir), o.Normal));
half rimInner = saturate(dot(normalize(IN.viewDir), o.Normal));
o.Emission = _RimColorOuter.rgb * pow(rimOuter, _RimPower);
//o.Emission = _RimColorInner.rgb * pow(rimInner, _RimPower);
}
ENDCG
}
FallBack "Diffuse"
}
Any help??
Comment
Answer by areTeam · Jun 01, 2018 at 04:44 PM
thanks this idea i'm like this effect :)
P.S. you think somethink like this alt text
kepernyofelvetel-8.png
(317.3 kB)
kepernyofelvetel-9.png
(320.7 kB)
Your answer
Follow this Question
Related Questions
How to add rim light for mobile in my shader? 0 Answers
Rim Light shader problem 0 Answers
How to make projector/light shader "alpha enabled"? 2 Answers
Multiple Light Shader 'Light Box' Bug 0 Answers
Block/Obscure light without shadows 0 Answers