KlassischeKeplerKriege/game/renderer_polygon_3d/gameobjects.vert

27 lines
459 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()
{
2016-09-29 06:28:56 +00:00
//vec3 p = position + scale*in_vertex.xyz;
2016-09-29 02:24:14 +00:00
2016-09-29 06:28:56 +00:00
vec3 p = (model*vec4(in_vertex, 1.0)).xyz;
2016-09-29 02:24:14 +00:00
lightvec = normalize(lightpos - p);
vertex = p.xyz;
2016-09-29 06:28:56 +00:00
normal = normalize((model*vec4(in_normal.xyz, 0.0)).xyz);
2016-09-29 02:24:14 +00:00
gl_Position = vec4(p, 1.0);
}
)raw_string"