Tucano  0.1
A library for rapid prototyping with modern OpenGL and GLSL
guishaders.hpp
Go to the documentation of this file.
1 
23 #ifndef __GUISHADERS__
24 #define __GUISHADERS__
25 
26 
27 namespace Tucano
28 {
29 
30 namespace GUI
31 {
32 
33 
35 const string gui_fragment_code = "\n"
36  "#version 430\n"
37  "in vec4 color;\n"
38  "in vec4 texcoords;\n"
39  "out vec4 out_Color;\n"
40  "uniform sampler2D shapetex;\n"
41  "void main(void)\n"
42  "{\n"
43  " vec4 tex = texture(shapetex, texcoords.xy).xyzw;\n"
44  " if (tex.w == 0.0)\n"
45  " discard;\n"
46  " out_Color = tex*color;\n"
47  "}\n";
48 
50 const string gui_vertex_code = "\n"
51  "#version 430\n"
52  "in vec4 in_Position;\n"
53  "in vec4 in_TexCoords;\n"
54  "out vec4 color;\n"
55  "out vec4 texcoords;\n"
56  "uniform mat4 modelMatrix;\n"
57  "uniform mat4 viewMatrix;\n"
58  "uniform mat4 projectionMatrix;\n"
59  "uniform vec4 in_Color;\n"
60  "void main(void)\n"
61  "{\n"
62  " vec4 v = projectionMatrix * viewMatrix * modelMatrix * in_Position;\n"
63  " gl_Position = v;\n"
64  " texcoords = in_TexCoords;\n"
65  " texcoords.y = 1.0 - texcoords.y;\n"
66  " color = in_Color;\n"
67  "}\n";
68 
69 }
70 }
71 #endif
const string gui_vertex_code
Default vertex shader for rendering gui elements.
Definition: guishaders.hpp:50
Definition: bufferobject.hpp:34
const string gui_fragment_code
Default fragment shader for rendering gui elments.
Definition: guishaders.hpp:35