]> git.tdb.fi Git - libs/gl.git/commitdiff
Shader fixes in the forest pond demo
authorMikko Rasa <tdb@tdb.fi>
Thu, 6 Oct 2022 09:50:07 +0000 (12:50 +0300)
committerMikko Rasa <tdb@tdb.fi>
Thu, 6 Oct 2022 10:03:03 +0000 (13:03 +0300)
demos/forestpond/data/fluidsim_integrate.glsl
demos/forestpond/data/water.glsl

index da3e8c18721a065ed671078649e1bdbba18b1238..70ac923fd94ed9dfe6efb47ce7304640f53a1207 100644 (file)
@@ -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);
index 08ba393e3ee854ec36d153d4e3aa97f28978eff4..d200b6d76987112507a3a65b0683d606720fb985 100644 (file)
@@ -1,4 +1,5 @@
 import msp_interface;
+import lighting;
 
 uniform Tessellation
 {