Hi all
I’m trying to change the halo component appearance so that the gradient is a bit steeper toward the end, because I want it to be a halo around the edge of a sphere. Currently it’s too weak. I hope that makes sense.
My current idea is to change the shader behind the Halo component. In the Unity docs they say grab the built in shaders from http://unity3d.com/unity/download/archive/ and simply put the overriding shader in a Resources folder. And that’s it. But I do that and I make some changes to the shader (below) and nothing seems to happen. I can see that Unity is building the shader and coming up errors, but it doesn’t seem to be replacing the Halo component shader.
Any ideas? Thanks
file: Internal-Halo.shader
Shader "Hidden/Internal-Halo" {
SubShader {
Tags {“RenderType”=“Overlay”}
ZWrite off Cull off // NOTE: ‘Cull off’ is important as the halo meshes flip handedness each time… BUG: #1220
Fog { Color (0,0,0,0) }
Blend OneMinusDstColor One
AlphaTest Greater 0
ColorMask RGB
Pass {
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#include “UnityCG.cginc”
sampler2D _HaloFalloff;
struct appdata_t {
float4 vertex : POSITION;
fixed4 color : COLOR;
float2 texcoord : TEXCOORD0;
};
struct v2f {
float4 vertex : SV_POSITION;
fixed4 color : COLOR;
float2 texcoord : TEXCOORD0;
};
float4 _HaloFalloff_ST;
v2f vert (appdata_t v)
{
v2f o;
o.vertex = mul(UNITY_MATRIX_MVP, v.vertex);
o.color = half4(1,0,0,1); // Changed to constant value
o.texcoord = TRANSFORM_TEX(v.texcoord,_HaloFalloff);
return o;
}
fixed4 frag (v2f i) : SV_Target
{
half a = tex2D(_HaloFalloff, i.texcoord).a;
return half4 (half3(1,0,0) * a, a); // Changed to constant value
}
ENDCG
}
}
}
Also I don’t see an option to format for code, anyone know?