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