KlassischeKeplerKriege/game/renderer_polygon_3d/gameobjects.vert

27 lines
414 B
GLSL
Raw Normal View History

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