Aetheria/Assets/Shaders/Brushes/PowerBrush.shader
Reinier Vens 645fcf4b09 Sensor Ping
Added ping feature to sensors, pulsing a wave of revealing light into the level
Added IEventBehavior interface, used by sensors and weapons, for behaviors containing event subscriptions which need to be reset when EntityInstance is disposed
Implemented sensor impact for locked weapons (lock speed varies with sensor acquisition)
Added ping cooldown bar to HUD
Added spline curve implementations to AetheriaMath, applied better mapping to wormhole transition animation
Tweaked loadout generator to prefer larger items to a controllable degree (e.g. very important for cargo bays, less for shop inventory), shop inventory bans non-ship hulls and manages internal space more effectively
2021-03-21 01:55:25 +00:00

66 lines
1.2 KiB
Text

Shader "Brushes/Power Brush" {
Properties {
_Color ("Color", Color) = (1,1,1,1)
_Depth ("Depth", Float) = 0.5
_Power("Power", Float) = 2
}
Category {
Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" "PreviewType"="Plane" }
Blend One One
ColorMask RGB
Cull Off Lighting Off ZWrite Off
SubShader {
Pass {
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#pragma target 2.0
#include "UnityCG.cginc"
fixed4 _Color;
float _Depth;
float _Power;
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 _MainTex_ST;
v2f vert (appdata_t v)
{
v2f o;
o.vertex = UnityObjectToClipPos(v.vertex);
o.color = v.color;
o.texcoord = v.texcoord;
return o;
}
float powerPulse( float x, float power )
{
x = saturate(abs(x))-.001;
return pow((x + 1.0f) * (1.0f - x), power);
}
fixed4 frag (v2f i) : SV_Target
{
float dist = length(i.texcoord-float2(.5,.5))*2;
return _Depth * powerPulse(dist,_Power) * _Color * smoothstep(1, .95, dist);
}
ENDCG
}
}
}
}