18
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-11-22 03:15:00 +01:00

Improved water shader

This commit is contained in:
2026-11-16 22:55:33 +01:00
parent b8815a2455
commit 9071d3f4d3
12 changed files with 512 additions and 5 deletions

View File

@@ -37,9 +37,18 @@ float move_factor = 0.0;
#include "light_common.glsl"
#include "apply_fog.glsl"
#include "tonemapping.glsl"
#include "water_surface.glsl"
void main()
{
// the realistic water (gfx.water.realistic, water_surface.glsl)
if (water_realistic())
{
vec2 flow = water_flow(f_coord);
water_surface(f_coord + flow, water_wave_normal(f_coord, flow, length(f_pos.xyz)), WATER_SPECULARITY, water_roughness());
return;
}
//wave distortion
move_factor += (param[2].z * time);
move_factor = mod(move_factor, 1.0);