Divergent/mods/Screen Space Shaders/gamedata/shaders/r3/ssfx_water_waves.ps

29 lines
821 B
PostScript
Raw Normal View History

/**
* @ Version: SCREEN SPACE SHADERS - UPDATE 21
* @ Description: Water - Waves Animation
* @ Modified time: 2024-04-24 23:59
* @ Author: https://www.moddb.com/members/ascii1457
* @ Mod: https://www.moddb.com/mods/stalker-anomaly/addons/screen-space-shaders
*/
#include "common.h"
Texture2D water_waves;
uniform float4 wind_setup;
float4 main ( p_screen I ) : SV_Target
{
float Wind_Int = saturate(wind_setup.y * 0.001);
float TimeSpeed = clamp(0.67f * Wind_Int, 0.3f, 0.67f);
float4 Tc = 0;
Tc.xy = I.tc0.xy + wind_setup.xx * float2(0.065f, 0.445f) * TimeSpeed;
Tc.wz = I.tc0.xy - wind_setup.xx * float2(0.105f, 0.241f) * TimeSpeed;
float Wave_01 = water_waves.Sample(smp_linear, Tc.xy).r;
float Wave_02 = water_waves.Sample(smp_linear, Tc.zw).b;
return float4(max(Wave_01.xxx, Wave_02.xxx), 1);
}