Hi, I would like to know what is the best way to obtain a glow effect like the following image.
I need to achieve this effect for iOS, any input on how to do it, it’s appreciated.
Thanks.
Hi, I would like to know what is the best way to obtain a glow effect like the following image.
I need to achieve this effect for iOS, any input on how to do it, it’s appreciated.
Thanks.
A coarse approximation might be a semitransparent sphere with additive blending that adds no light when the surface normal is orthogonal to the view direction and more light otherwise. For the implementation a surface shader without lighting should do fine.
mobile bloom in angry ant does such, but not for every IOS device, I would suggest you only doing this effect ipad2, iphone4s, ipad3
I did a quick test to see whether my idea made any sense:
Shader "Custom/glow" {
Properties {
_Color ("Color", Color) = (1,1,1,1)
}
SubShader {
Tags { "Queue"="Transparent" }
LOD 200
ZTest Always
Cull Off
Blend One One
CGPROGRAM
#pragma surface surf Lambert
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"
}
Edit: Changed “RenderType” to “Queue” and changed decal blending to additive blending with “Blend One One”
Thanks a lot! I’m creating a lamp shader and this worked perfectly.
it’s an old thread, but does it work with unity free?
I know all glow features are Pro only and I am not really expert in shaders…