2015-01-29 09:28:14 +08:00
|
|
|
attribute vec4 a_position;
|
|
|
|
attribute vec3 a_normal;
|
|
|
|
|
|
|
|
varying vec3 v_reflect;
|
|
|
|
|
|
|
|
void main(void)
|
|
|
|
{
|
|
|
|
gl_Position = CC_MVPMatrix * a_position;
|
|
|
|
|
|
|
|
// compute reflect
|
2016-09-12 09:45:34 +08:00
|
|
|
vec4 positionWorldViewSpace = CC_MVMatrix * a_position;
|
2015-04-14 14:20:31 +08:00
|
|
|
vec3 vEyeVertex = normalize(positionWorldViewSpace.xyz);
|
2015-01-29 09:28:14 +08:00
|
|
|
|
|
|
|
vec3 v_normalVector = CC_NormalMatrix * a_normal;
|
2015-04-14 14:20:31 +08:00
|
|
|
v_reflect = normalize(reflect(-vEyeVertex, v_normalVector));
|
2015-01-29 09:28:14 +08:00
|
|
|
}
|