KlassischeKeplerKriege/game/renderer_polygon_3d/gameobjects.vert
2016-09-29 04:24:14 +02:00

26 lines
414 B
GLSL

R"raw_string(
#version 120
attribute vec3 in_vertex;
attribute vec3 in_normal;
varying vec3 vertex;
varying vec3 normal;
varying vec3 lightvec;
uniform mat4 model;
uniform vec3 lightpos;
void main()
{
//vec3 p = position + scale*gl_Vertex.xyz;
vec3 p = (model*gl_Vertex).xyz;
lightvec = normalize(lightpos - p);
vertex = p.xyz;
normal = in_normal.xyz;
gl_Position = vec4(p, 1.0);
}
)raw_string"