blob: 9f2692f2a4c0bd88d7faa7301c55cff3c311294e (
plain)
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
32
33
34
|
varying highp vec2 UV;
varying highp vec2 coords_mdl;
varying highp vec3 position_wrld;
varying highp vec3 normal_cmr;
varying highp vec3 eyeDirection_cmr;
varying highp vec3 lightDirection_cmr;
uniform highp vec3 lightPosition_wrld;
uniform highp vec3 color_mdl;
uniform highp float lightStrength;
uniform highp float ambientStrength;
uniform sampler2D textureSampler;
void main() {
//highp vec3 materialDiffuseColor = texture2D(textureSampler, UV).rgb;
//highp vec3 materialAmbientColor = vec3(ambientStrength, ambientStrength, ambientStrength) * materialDiffuseColor;
//highp vec3 materialSpecularColor = vec3(1.0, 1.0, 1.0);
//highp float distance = length(lightPosition_wrld - position_wrld);
//highp vec3 n = normalize(normal_cmr);
//highp vec3 l = normalize(lightDirection_cmr);
//highp float cosTheta = dot(n, l);
//if (cosTheta < 0.0) { cosTheta = 0.0; }
//if (cosTheta > 1.0) { cosTheta = 1.0; }
//highp vec3 E = normalize(eyeDirection_cmr);
//highp vec3 R = reflect(-l, n);
//highp float cosAlpha = dot(E, R);
//if (cosAlpha < 0.0) { cosAlpha = 0.0; }
//if (cosAlpha > 1.0) { cosAlpha = 1.0; }
//gl_FragColor.rgb = //color_mdl + color_mdl * vec3(cosTheta * cosTheta) / (distance * distance) + vec3(cosAlpha * cosAlpha * cosAlpha * cosAlpha * cosAlpha * cosAlpha * cosAlpha * cosAlpha) / (distance * distance);
// materialAmbientColor +
// materialDiffuseColor * lightStrength * (cosTheta * cosTheta) / distance +
// materialSpecularColor * lightStrength * (cosAlpha * cosAlpha * cosAlpha * cosAlpha * cosAlpha * cosAlpha * cosAlpha * cosAlpha * cosAlpha * cosAlpha) / distance;//(distance * distance);
//gl_FragColor.a = 1.0;
gl_FragColor = texture2D(textureSampler, UV);
}
|