aboutsummaryrefslogtreecommitdiff
path: root/src/shader
diff options
context:
space:
mode:
authorAdrian Kummerlaender2019-02-25 21:29:03 +0100
committerAdrian Kummerlaender2019-02-25 21:29:03 +0100
commit9ed8efcc53f54dce8ec34279e47df851693854ec (patch)
treeae21515cc6c7ef64ad31e712ce3990ae8296ac0d /src/shader
parent26c1cf58f483e64d80703fe37c4bd3923d1ff5b7 (diff)
downloadcompustream-9ed8efcc53f54dce8ec34279e47df851693854ec.tar
compustream-9ed8efcc53f54dce8ec34279e47df851693854ec.tar.gz
compustream-9ed8efcc53f54dce8ec34279e47df851693854ec.tar.bz2
compustream-9ed8efcc53f54dce8ec34279e47df851693854ec.tar.lz
compustream-9ed8efcc53f54dce8ec34279e47df851693854ec.tar.xz
compustream-9ed8efcc53f54dce8ec34279e47df851693854ec.tar.zst
compustream-9ed8efcc53f54dce8ec34279e47df851693854ec.zip
Add cylinder and dampened inflow to open geometry
Diffstat (limited to 'src/shader')
-rw-r--r--src/shader/code/collide.glsl9
-rw-r--r--src/shader/code/vertex.glsl2
2 files changed, 6 insertions, 5 deletions
diff --git a/src/shader/code/collide.glsl b/src/shader/code/collide.glsl
index 4efd7fb..230f02e 100644
--- a/src/shader/code/collide.glsl
+++ b/src/shader/code/collide.glsl
@@ -7,10 +7,11 @@ layout (std430, binding=1) buffer bufferCollide { float collideCells[]; };
layout (std430, binding=2) buffer bufferStream { float streamCells[]; };
layout (std430, binding=3) buffer bufferFluid { float fluidCells[]; };
-/// LBM constants
-
uniform uint nX;
uniform uint nY;
+uniform uint iT;
+
+/// LBM constants
const uint q = 9;
const float weight[q] = float[](
@@ -19,7 +20,7 @@ const float weight[q] = float[](
1./36 , 1./9., 1./36.
);
-const float tau = 0.8;
+const float tau = 0.6;
const float omega = 1/tau;
/// Vector utilities
@@ -142,7 +143,7 @@ void main() {
if ( isBulkFluidCell(material) ) {
if ( isInflowCell(material) ) {
- v = vec2(0.1,0.0);
+ v = vec2(min(float(iT)*0.2/2000.0, 0.2), 0.0);
}
if ( isOutflowCell(material) ) {
d = 1.0;
diff --git a/src/shader/code/vertex.glsl b/src/shader/code/vertex.glsl
index e0ce9a8..67a5d80 100644
--- a/src/shader/code/vertex.glsl
+++ b/src/shader/code/vertex.glsl
@@ -10,7 +10,7 @@ out VS_OUT {
uniform uint nX;
uniform uint nY;
-const float displayAmplifier = 10.0;
+const float displayAmplifier = 4.0;
float unit(float x) {
return 1.0/(1.0+exp(-x));