This commit is contained in:
alexander.biryukov committed 2018-05-31 19:47:36 +05:00
1 parent c5b64370cc
commit 24fd919de3
4 files changed
+24 -849

No files matched your search

+2 -1
View File
@@ -6,11 +6,12 @@ uniform vec4 LightDirection;
varying vec2 texCoord;
varying vec3 fragNormal;
varying vec3 fragColor;
void main() {
vec4 color = texture2D(Texture, texCoord).rgba;
float intensity = dot(normalize(LightDirection.xyz), -normalize(fragNormal));
gl_FragColor = vec4(color.rgb * intensity*0.5 + vec3(0.5, 0.5, 0.5), color.a * Transparency);
gl_FragColor = vec4(color.rgb * fragColor.rgb * intensity + vec3(0.5, 0.5, 0.5), color.a * Transparency);
//gl_FragColor = vec4((fragNormal.rgb + vec3(1.0, 1.0, 1.0))*0.5, 1.0);
}