KlassischeKeplerKriege/game/renderer_polygon_3d/gameobjects.vert
2016-09-29 08:28:56 +02:00

26 lines
459 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*in_vertex.xyz;
vec3 p = (model*vec4(in_vertex, 1.0)).xyz;
lightvec = normalize(lightpos - p);
vertex = p.xyz;
normal = normalize((model*vec4(in_normal.xyz, 0.0)).xyz);
gl_Position = vec4(p, 1.0);
}
)raw_string"