-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathShaderLibrary.cs
47 lines (39 loc) · 981 Bytes
/
ShaderLibrary.cs
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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
/*
* Holding space for vertex and fragment GLSL shaders.
*
* These basic shaders create a global light.
*/
namespace openGltest
{
class ShaderLibrary
{
public static string VertexShader = @"
#version 130
in vec3 vertexPosition;
in vec3 vertexColor;
out vec3 color;
uniform mat4 projection_matrix;
uniform mat4 view_matrix;
uniform mat4 model_matrix;
void main(void)
{
color = vertexColor;
gl_Position = projection_matrix * view_matrix * model_matrix * vec4(vertexPosition, 1);
}
";
public static string FragmentShader = @"
#version 130
in vec3 color;
out vec4 fragment;
void main(void)
{
fragment = vec4(color, 1);
}
";
}
}