From: Mikko Rasa Date: Thu, 6 Oct 2022 09:50:07 +0000 (+0300) Subject: Shader fixes in the forest pond demo X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=24b76abad71996cb241b56ded239335fd26273cc;p=libs%2Fgl.git Shader fixes in the forest pond demo --- diff --git a/demos/forestpond/data/fluidsim_integrate.glsl b/demos/forestpond/data/fluidsim_integrate.glsl index da3e8c18..70ac923f 100644 --- a/demos/forestpond/data/fluidsim_integrate.glsl +++ b/demos/forestpond/data/fluidsim_integrate.glsl @@ -1,6 +1,12 @@ import fluidsim; #pragma MSP stage(compute) +float get_clamping(float depth, float v_right, float v_up, float v_left, float v_down) +{ + float total_out = max(v_right, 0.0)+max(v_up, 0.0)-min(v_left, 0.0)-min(v_down, 0.0); + return min(max_flow_fraction/max(total_out*delta_time, max_flow_fraction), depth/residual_depth); +} + void main() { ivec2 size = imageSize(surface_out); diff --git a/demos/forestpond/data/water.glsl b/demos/forestpond/data/water.glsl index 08ba393e..d200b6d7 100644 --- a/demos/forestpond/data/water.glsl +++ b/demos/forestpond/data/water.glsl @@ -1,4 +1,5 @@ import msp_interface; +import lighting; uniform Tessellation {