-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathshader04a.geom
60 lines (47 loc) · 1.18 KB
/
shader04a.geom
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
/************************************************************************/
/* Graphics 317 coursework exercise 03 */
/* Author: Bernhard Kainz */
/* Nothing to be done in this file for this exercise */
/************************************************************************/
#version 150 compatibility
#extension GL_ARB_geometry_shader4 : enable
layout (max_vertices = 72) out;
const float pi = 3.14159265359;
////////////////
uniform vec4 ambientColor;
uniform vec4 diffuseColor;
uniform vec4 specularColor;
uniform float specularExponent;
uniform int level;
uniform float time;
in vertexData
{
vec3 pos;
vec3 normal;
vec4 color;
//Exerceise 4:
vec4 texCoords;
}vertices[];
out fragmentData
{
vec3 vpos;
vec3 normal;
vec4 color;
//Exerceise 4:
vec4 texCoords;
}frag;
void main()
{
int i;
for(i = 0; i < gl_in.length(); i++)
{
gl_Position = gl_in[i].gl_Position;
frag.vpos = vertices[i].pos;
frag.normal = vertices[i].normal;
frag.color = vertices[i].color;
//Exercise 4:
frag.texCoords = vertices[i].texCoords;
EmitVertex();
}
EndPrimitive();
}