aboutsummaryrefslogtreecommitdiff
path: root/src/shader
diff options
context:
space:
mode:
authorAdrian Kummerlaender2019-02-24 20:56:46 +0100
committerAdrian Kummerlaender2019-02-24 20:56:50 +0100
commit82a37700e3ff8c1b9c43dbf00c05bd112bd58ec8 (patch)
tree077d87798cff1265f4640c64636b924700940d42 /src/shader
parent1f2b1cb037a202cafe25167c071a2615341dafdb (diff)
downloadcompustream-82a37700e3ff8c1b9c43dbf00c05bd112bd58ec8.tar
compustream-82a37700e3ff8c1b9c43dbf00c05bd112bd58ec8.tar.gz
compustream-82a37700e3ff8c1b9c43dbf00c05bd112bd58ec8.tar.bz2
compustream-82a37700e3ff8c1b9c43dbf00c05bd112bd58ec8.tar.lz
compustream-82a37700e3ff8c1b9c43dbf00c05bd112bd58ec8.tar.xz
compustream-82a37700e3ff8c1b9c43dbf00c05bd112bd58ec8.tar.zst
compustream-82a37700e3ff8c1b9c43dbf00c05bd112bd58ec8.zip
Play around with open boundaries
Diffstat (limited to 'src/shader')
-rw-r--r--src/shader/code/collide.glsl13
1 files changed, 10 insertions, 3 deletions
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);