Home | History | Annotate | Download | only in raw
      1 varying vec3 varWorldPos;
      2 varying vec3 varWorldNormal;
      3 varying vec2 varTex0;
      4 
      5 void main() {
      6 
      7    vec3 V = normalize(UNI_cameraPos.xyz - varWorldPos.xyz);
      8    vec3 worldNorm = normalize(varWorldNormal);
      9 
     10    vec3 light0Vec = normalize(UNI_lightPos_0.xyz - varWorldPos.xyz);
     11    float light0_Diffuse = clamp(dot(worldNorm, light0Vec), 0.0, 1.0);
     12 
     13    vec3 light1Vec = normalize(UNI_lightPos_1.xyz - varWorldPos.xyz);
     14    float light1_Diffuse = clamp(dot(worldNorm, light1Vec), 0.0, 1.0);
     15 
     16    vec2 t0 = varTex0.xy;
     17    lowp vec4 col = UNI_diffuse;
     18    col.xyz = col.xyz * (light0_Diffuse * UNI_lightColor_0.xyz +
     19                         light1_Diffuse * UNI_lightColor_1.xyz);
     20    gl_FragColor = col;
     21 }
     22 
     23