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/shader/code/fragment.glsl | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/shader/code/fragment.glsl') diff --git a/src/shader/code/fragment.glsl b/src/shader/code/fragment.glsl index 37e18bd..a4121b8 100644 --- a/src/shader/code/fragment.glsl +++ b/src/shader/code/fragment.glsl @@ -1,5 +1,10 @@ static const std::string FRAGMENT_SHADER_CODE = R"( +#version 430 + +in vec3 color; +out vec4 FragColor; + void main() { - gl_FragColor = gl_Color; + FragColor = vec4(color.xyz, 0.0); } )"; -- cgit v1.2.3