From ce334547f0f0560386ca8b97f354d83da68019a5 Mon Sep 17 00:00:00 2001 From: Adrian Kummerlaender Date: Sun, 16 Dec 2018 22:09:17 +0100 Subject: 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. --- src/main.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/main.cc') 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( - VERTEX_SHADER_CODE, FRAGMENT_SHADER_CODE); + VERTEX_SHADER_CODE, GEOMETRY_SHADER_CODE, FRAGMENT_SHADER_CODE); lattice_a = std::make_unique(nX, nY); lattice_b = std::make_unique(nX, nY); -- cgit v1.2.3