shaders now compile and link correctly

- map still invisible
- frustum defined
- shaders fixed
- attrib-link to shaders fixed
- lookat now generates a frustum-projected look-at matrix
- smaller test-map for debug
This commit is contained in:
Stefan Dresselhaus
2014-01-03 17:46:41 +01:00
parent e5193fc7c5
commit 7d201cf216
6 changed files with 110 additions and 27 deletions

View File

@ -1,4 +1,4 @@
#version 140
#version 330
//color from earlier stages
smooth in vec4 fg_SmoothColor;

View File

@ -1,18 +1,20 @@
#version 140
#version 330
//constant projection matrix
uniform mat4 fg_ProjectionMatrix;
//vertex-data
in vec4 fg_Color;
in vec4 fg_Vertex;
in vec4 fg_Normal;
in vec3 fg_VertexIn;
in vec3 fg_Normal;
//output-data for later stages
smooth out vec4 fg_SmoothColor;
void main()
{
fg_SmoothColor = fg_Color;
//transform vec3 into vec4, setting w to 1
vec4 fg_Vertex = vec4(fg_VertexIn, 1.0);
fg_SmoothColor = fg_Color + 0.001* fg_Normal.xyzx;
gl_Position = fg_ProjectionMatrix * fg_Vertex;
}