Hi,
I’m looking for a shader that glows. I tried searching around but every shader if found didn’t work for me. What is should look like:
Is this possible? Or should use a Point light with a Halo ?
Hi,
I’m looking for a shader that glows. I tried searching around but every shader if found didn’t work for me. What is should look like:
Is this possible? Or should use a Point light with a Halo ?
Use a flare.
So i should add a flare to the point light?
You only need a point light if you want nearby objects to be affected by the light. For an overlaid glow like you have in your picture, a flare will work fine without a light.
Ah ok so i have to add the flare shader to the spot on the model?
No shaders involved. You need to add a Flare Component to a GameObject that is in the place you want.
Ah now i get it, so i add a lens flare to a sphere collider, this sphere collider is at the same place as the point where i want to have the red glow what’s the best flare i could use for the effect i want?
EDIT:
Adding lens flares to sphere colliders doesn’t work empty game object it is!
Lens Flares are blocked by colliders that are not on the flare’s ignore layers.
Finally had time to fix this problem! So i got the glow working now but i still have a little problem with it, i use this shader to fix the glow (Thx Martin Kraus for sharing this):
Shader "Custom/glow" {
Properties {
_Color ("Color", Color) = (1,1,1,1)
}
SubShader {
Tags { "RenderType"="Transparent" }
LOD 200
ZTest Always
Cull Off
CGPROGRAM
#pragma surface surf Lambert decal:add
float4 _Color;
struct Input {
float3 viewDir;
float3 worldNormal;
};
void surf (Input IN, inout SurfaceOutput o) {
o.Alpha = _Color.a * pow(abs(dot(normalize(IN.viewDir),
normalize(IN.worldNormal))),4.0);
o.Emission = _Color.rgb * o.Alpha;
}
ENDCG
}
FallBack "Diffuse"
}
I added this shader to 3 objects and their glowing nicely :). The objects glow through my humanoid model, i have 2 for the shoulders which looks very nice. But here comes the problem, I have one of the glow spots on the back of the humanoid model, but i don’t want that particular spot to glow through the whole model, only to glow the user is looking at the back of the model. Is this doable? Or is it easier to just turn off the glow and when the user rotates in view the glow turns on?