Files
josh 290e4cb45d Add riverboat captain career and distinct ship classes
Add class-specific vessel geometry and sea motion, a guided helm qualification path, dockside sailing orders, and local excursions at all 24 ports.
2026-11-29 20:41:00 -05:00

25 lines
1.0 KiB
HLSL

#ifndef TYCOON_OCEAN_WAVES
#define TYCOON_OCEAN_WAVES
float _TycoonRiverWater;
float WaveAmplitude(float storm)
{
return lerp(lerp(.61, 1.95, storm * storm), lerp(.22, .44, storm), _TycoonRiverWater);
}
float3 OceanWave(float2 position, float time, float storm)
{
float2 windWave = lerp(float2(.052, .115), float2(.197, .235), _TycoonRiverWater);
float2 swellWave = lerp(float2(-.024, .054), float2(-.088, .13), _TycoonRiverWater);
float2 crossWave = lerp(float2(.217, -.136), float2(.40, -.31), _TycoonRiverWater);
float s1, c1, s2, c2, s3, c3;
sincos(dot(position, windWave) - time * lerp(.93, 1.55, _TycoonRiverWater), s1, c1);
sincos(dot(position, swellWave) - time * lerp(.75, 1.02, _TycoonRiverWater) + 1.3, s2, c2);
sincos(dot(position, crossWave) - time * lerp(1.64, 2.03, _TycoonRiverWater) + 2.9, s3, c3);
float2 gradient = .49 * windWave * c1 + .39 * swellWave * c2 + .12 * crossWave * c3;
return WaveAmplitude(storm) * float3(.49 * s1 + .39 * s2 + .12 * s3, gradient);
}
#endif