aboutsummaryrefslogtreecommitdiff
path: root/src/main.cc
diff options
context:
space:
mode:
authorAdrian Kummerlaender2018-12-16 22:09:17 +0100
committerAdrian Kummerlaender2018-12-16 22:09:17 +0100
commitce334547f0f0560386ca8b97f354d83da68019a5 (patch)
tree2c4e148a7e8052779da70d9cf1767cea5c44926d /src/main.cc
parent52cbbff72bd5516b5f325d1c88e4fcd8ca67f989 (diff)
downloadcompustream-ce334547f0f0560386ca8b97f354d83da68019a5.tar
compustream-ce334547f0f0560386ca8b97f354d83da68019a5.tar.gz
compustream-ce334547f0f0560386ca8b97f354d83da68019a5.tar.bz2
compustream-ce334547f0f0560386ca8b97f354d83da68019a5.tar.lz
compustream-ce334547f0f0560386ca8b97f354d83da68019a5.tar.xz
compustream-ce334547f0f0560386ca8b97f354d83da68019a5.tar.zst
compustream-ce334547f0f0560386ca8b97f354d83da68019a5.zip
Generate fluid display using geometry shaders
This should provide much more flexibility. For our purpose it would be useful if the vertex shader was executed after the geometry shader (to apply the projection matrix) but alas this is not the case. Thus the MVP matrix is applied during geometry construction and the vertex shader only provides density extraction.
Diffstat (limited to 'src/main.cc')
-rw-r--r--src/main.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/main.cc b/src/main.cc
index 5ac18e1..20d7666 100644
--- a/src/main.cc
+++ b/src/main.cc
@@ -14,6 +14,7 @@
#include "shader/wrap/graphic_shader.h"
#include "shader/wrap/compute_shader.h"
+#include "shader/code/geometry.glsl"
#include "shader/code/vertex.glsl"
#include "shader/code/fragment.glsl"
@@ -72,7 +73,7 @@ int renderWindow() {
window.init([&]() {
scene_shader = std::make_unique<GraphicShader>(
- VERTEX_SHADER_CODE, FRAGMENT_SHADER_CODE);
+ VERTEX_SHADER_CODE, GEOMETRY_SHADER_CODE, FRAGMENT_SHADER_CODE);
lattice_a = std::make_unique<LatticeCellBuffer>(nX, nY);
lattice_b = std::make_unique<LatticeCellBuffer>(nX, nY);