Hostility System

Implemented hostility system - entities can mark each other as friend or foe depending on changing conditions (currently only depends on local security level)
Added "friendly" target indicators in blue
This commit is contained in:
Reinier Vens 2021-05-11 04:45:42 +01:00
commit 1284149d47
39 changed files with 519 additions and 141 deletions

View file

@ -3,6 +3,7 @@ Properties {
_Color ("Color", Color) = (1,1,1,1)
_Depth ("Depth", Float) = 0.5
_Power("Power", Float) = 2
_Cutoff("Cutoff", Range(0,1)) = 1
}
Category {
@ -23,7 +24,8 @@ Category {
fixed4 _Color;
float _Depth;
float _Power;
half _Power;
half _Cutoff;
struct appdata_t {
float4 vertex : POSITION;
@ -57,7 +59,7 @@ Category {
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);
return _Depth * min(_Cutoff, powerPulse(dist,_Power)) * _Color * smoothstep(1, .95, dist);
}
ENDCG
}

View file

@ -117,8 +117,8 @@
float surface = tex2Dlod(_Surface, half4(uv, 0, 0)).r;
float dist = pos.y + surface - _GridFloorOffset;
float4 lightTint = tex2Dlod(_TintTexture, half4(uv, 0, dist/30));
float fillDensity = saturate(-pos.y * _GridFillDensity);
float4 lightTint = tex2Dlod(_TintTexture, half4(uv, 0, dist/30));
float fillDensity = saturate(-pos.y * _GridFillDensity);
if(dist < _SafetyDistance)
{