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

47 lines
1.1 KiB
Plaintext
Raw Normal View History

2024-03-17 20:18:03 -04:00
#include "common.h"
struct v2p
{
float2 tc0: TEXCOORD0; // base
half3 tc1: TEXCOORD1; // environment
half4 c0: COLOR0; // sun.(fog*fog)
};
// Pixel
uniform float4 m_actor_params;
uniform float4 m_affects;
half get_noise(float2 co)
{
return (frac(sin(dot(co.xy ,float2(12.9898,78.233))) * 43758.5453))*0.5;
};
half4 main( v2p I ): COLOR
{
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
half problems = cos( ( frac( timers.z * 4 ) - 0.5 ) * 3.1416 )*2 - 0.8;
half 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;
half4 t_base = tex2D (s_base, I.tc0);
half 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>
half noise = get_noise(I.tc0*timers.z) * m_affects.x * 2;
t_base.r += noise;
t_base.g += noise;
t_base.b += noise;
return half4 (t_base.r, t_base.g, t_base.b, 1);
}