CGI/exercise1/glsl/shader.vert

26 lines
547 B
GLSL
Raw Normal View History

2018-10-17 08:22:24 +00:00
// This source code is property of the Computer Graphics and Visualization
2018-09-06 12:35:43 +00:00
// chair of the TU Dresden. Do not distribute!
// Copyright (C) CGV TU Dresden - All Rights Reserved
#version 130
in vec4 in_position;
2018-10-17 08:55:20 +00:00
in vec4 in_color;
2018-09-06 12:35:43 +00:00
2018-10-17 11:00:47 +00:00
uniform mat4 view;
uniform mat4 proj;
2018-10-21 14:18:27 +00:00
uniform vec2 julia_positions[3];
2018-09-06 12:35:43 +00:00
out vec4 fragment_color;
2018-10-17 11:14:24 +00:00
out vec2 vertex_pos;
2018-10-21 14:18:27 +00:00
out vec2 julia_position;
2018-09-06 12:35:43 +00:00
2018-10-17 08:22:24 +00:00
void main()
2018-09-06 12:35:43 +00:00
{
2018-10-17 11:14:24 +00:00
vertex_pos = in_position.xy;
2018-10-17 11:00:47 +00:00
gl_Position = proj * view * in_position;
2018-10-17 08:55:20 +00:00
fragment_color = in_color;
2018-10-21 14:18:27 +00:00
2018-11-05 15:54:18 +00:00
julia_position = julia_positions[gl_VertexID % 3];
2018-09-06 12:35:43 +00:00
}