KlassischeKeplerKriege/game/renderer_polygon_3d/gameobjects.vert
Andreas Ortmann 9c1ce0d935 refactoring.
2016-09-29 11:38:26 +02:00

25 lines
501 B
GLSL

R"raw_string(
#version 120
attribute vec3 in_vertex;
attribute vec3 in_normal;
varying vec3 vertex;
varying vec3 normal;
varying vec3 lightDirection;
uniform mat4 model;
uniform vec3 lightPosition;
void main()
{
// TODO: this becomes invalid when projection matrices are used
vec3 p = (model*vec4(in_vertex, 1.0)).xyz;
lightDirection = normalize(lightPosition - p);
vertex = p.xyz;
normal = normalize((model*vec4(in_normal.xyz, 0.0)).xyz);
gl_Position = vec4(p, 1.0);
}
)raw_string"