|
|
@@ -37,6 +37,7 @@ precision highp float; |
|
|
|
#endif |
|
|
|
|
|
|
|
uniform float in_Damage; |
|
|
|
uniform mat4 in_Model; |
|
|
|
|
|
|
|
varying vec4 pass_Eye; |
|
|
|
varying vec3 pass_TNormal; |
|
|
@@ -45,7 +46,7 @@ varying vec4 pass_Color; |
|
|
|
|
|
|
|
// FIXME: the light direction should be passed in the code |
|
|
|
vec3 in_LightDir = vec3(0.3, 0.3, 0.7); |
|
|
|
vec3 in_Light2_Pos = vec3(0.0, 100.0, 0.0); |
|
|
|
vec4 in_Light2_Pos = in_Model * vec4(0.0, 0.0, 0.0, 1.0); |
|
|
|
|
|
|
|
void main(void) |
|
|
|
{ |
|
|
@@ -81,7 +82,7 @@ void main(void) |
|
|
|
*/ |
|
|
|
|
|
|
|
//Light calculation for point light |
|
|
|
s = normalize(pass_TPos.xyz - in_Light2_Pos); |
|
|
|
s = normalize(pass_Eye.xyz - in_Light2_Pos.xyz); //(pass_TPos.xyz - in_Light2_Pos); |
|
|
|
v = normalize(-pass_Eye.xyz); |
|
|
|
r = reflect(-s, pass_TNormal); |
|
|
|
|
|
|
|