NGL  6.5
The NCCA Graphics Library
DiffuseShaders.h
Go to the documentation of this file.
1 #ifndef DIFFUSESHADERS_H_
2 #define DIFFUSESHADERS_H_
3 // see below for the really cool c++ 11 version of this
4 #include <string>
5 
7 R"DELIM(
8  #version 150
9  out vec3 fragmentNormal;
10  in vec3 inVert;
11  in vec3 inNormal;
12  uniform mat4 MVP;
13  uniform mat3 normalMatrix;
14  void main()
15  {
16  fragmentNormal = (normalMatrix*inNormal);
17  gl_Position = MVP*vec4(inVert,1.0);
18  }
19 )DELIM";
20 
22 R"DELIM(
23  #version 150
24  in vec3 fragmentNormal;
25  out vec4 fragColour;
26  uniform vec4 Colour;
27  uniform vec3 lightPos;
28  uniform vec4 lightDiffuse;
29  void main ()
30  {
31  fragColour= vec4(0.);
32  vec3 N = normalize(fragmentNormal);
33  vec3 L = normalize(lightPos);
34  fragColour += Colour*lightDiffuse *dot(L, N);
35  }
36 )DELIM";
37 
38 
39 
40 #endif
41 
const std::string diffuseFragmentShader
GLsizei const GLchar *const * string
Definition: glew.h:1847
const std::string diffuseVertexShader
Definition: DiffuseShaders.h:6