From 82a37700e3ff8c1b9c43dbf00c05bd112bd58ec8 Mon Sep 17 00:00:00 2001 From: Adrian Kummerlaender Date: Sun, 24 Feb 2019 20:56:46 +0100 Subject: Play around with open boundaries --- src/shader/code/collide.glsl | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src/shader') diff --git a/src/shader/code/collide.glsl b/src/shader/code/collide.glsl index 0ddae7b..673a285 100644 --- a/src/shader/code/collide.glsl +++ b/src/shader/code/collide.glsl @@ -102,7 +102,7 @@ float equilibrium(float d, vec2 v, int i, int j) { /// Material number meaning (geometry is only changed by the interaction shader) bool isBulkFluidCell(int material) { - return material == 1 || material == 4; + return material == 1 || material == 4 || material == 5 || material == 6; } float getExternalMassInflux(int material) { @@ -126,8 +126,15 @@ void main() { const int material = getMaterial(x,y); if ( isBulkFluidCell(material) ) { - const float d = max(density(x,y), getExternalMassInflux(material)); - const vec2 v = velocity(x,y,d); + float d = max(density(x,y), getExternalMassInflux(material)); + vec2 v = velocity(x,y,d); + + if ( material == 5 ) { + v = vec2(0.1,0.0); + } + if ( material == 6 ) { + d = 1.0; + } setFluid(x,y,v); -- cgit v1.2.3