5
* Created by döme on 28.07.2009.
6
* Copyright 2009 __MyCompanyName__. All rights reserved.
10
precision highp float;
12
uniform sampler2D tex0;
15
varying highp vec2 tx0;
16
varying highp vec4 epos;
20
vec3 NN = normalize(N);
21
// vec3 lightdir = normalize(epos.xyz); // point light centered at eye
22
vec3 lightdir = vec3(0.0,0.0,-1.0); // directional light
24
lowp vec4 tex0color = texture2D(tex0, tx0);
26
float diffuse = -dot(NN, lightdir)*(float(gl_FrontFacing)*2.0 - 1.0);
27
gl_FragColor = vec4(tex0color.rgb*(0.7*diffuse + 0.3), tex0color.a);