-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathblend.vert
31 lines (27 loc) · 857 Bytes
/
blend.vert
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#version 110
uniform float tilingFactor;
varying float ao;
varying vec4 normal;
varying vec3 L, E, H;
varying vec3 VaryingTexCoord[4];
attribute vec3 osg_texCoord1;
attribute vec3 osg_texCoord2;
attribute vec3 osg_texCoord3;
attribute vec3 osg_texCoord4;
attribute vec4 osg_Color;
void main()
{
normal.xyz = normalize( /*gl_NormalMatrix * */gl_Normal);
normal.w = gl_Vertex.z;
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
vec4 eyePosition = gl_ModelViewMatrix * gl_Vertex;
vec4 eyeLightPos = gl_LightSource[0].position;
L = normalize(eyeLightPos.xyz - eyePosition.xyz);
E = -normalize(eyePosition.xyz);
H = normalize(L + E);
VaryingTexCoord[0] = osg_texCoord1;
VaryingTexCoord[1] = osg_texCoord2;
VaryingTexCoord[2] = osg_texCoord3;
VaryingTexCoord[3] = osg_texCoord4;
ao=osg_Color.r;
}