Divergent/mods/Body Health System Realisti.../gamedata/shaders/r3/model_exohealth.ps.mohidden

50 lines
1.3 KiB
Plaintext
Raw Normal View History

2024-03-17 20:18:03 -04:00
#include "common.h"
uniform float4 m_actor_params;
uniform float4 m_affects;
struct v2p
{
float2 tc0: TEXCOORD0; // base
float3 tc1: TEXCOORD1; // environment
float4 c0: COLOR0; // sun.(fog*fog)
};
float get_noise(float2 co)
{
return (frac(sin(dot(co.xy ,float2(12.9898,78.233))) * 43758.5453))*0.5;
};
//////////////////////////////////////////////////////////////////////////////////////////
float4 main( v2p I ) : SV_Target
{
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
float problems = cos( ( frac( timers.z * 4 ) - 0.5 ) * 3.1416 )*2 - 0.8;
float AMPL = 0.3;
I.tc0.y -= ( m_affects.x > 0.15 && I.tc0.x > problems-AMPL && I.tc0.x < problems+AMPL) ? cos(4.71*(I.tc0.x-problems)/AMPL) * sin( frac(timers.z)*6.2831*90 ) * (m_affects.x/10) * (AMPL-abs(I.tc0.x-problems))/AMPL : 0;
float4 t_base = s_base.Sample ( smp_base, I.tc0);
float tmp = 1-m_actor_params.y;
tmp = clamp(tmp, 0, 0.5);
t_base.r +=tmp*t_base.a;
tmp = 0.5-abs(m_actor_params.y-0.5);
tmp = clamp(tmp, 0, 0.5);
t_base.g +=tmp*t_base.a;
// <20><><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
float noise = get_noise(I.tc0*timers.z) * m_affects.x * 2;
t_base.r += noise;
t_base.g += noise;
t_base.b += noise;
return float4 (t_base.r, t_base.g, t_base.b, 1);
}