Added example demonstrating sf::VertexBuffer, sf::Shader and sf::Thread usage.

This commit is contained in:
binary1248 2017-10-24 18:58:55 +02:00 committed by Lukas Dürrenberger
parent fe1407b6b5
commit d032050ccf
7 changed files with 937 additions and 0 deletions

View file

@ -0,0 +1,11 @@
varying vec3 normal;
uniform float lightFactor;
void main()
{
vec3 lightPosition = vec3(-1.0, 1.0, 1.0);
vec3 eyePosition = vec3(0.0, 0.0, 1.0);
vec3 halfVector = normalize(lightPosition + eyePosition);
float intensity = lightFactor + (1.0 - lightFactor) * dot(normalize(normal), normalize(halfVector));
gl_FragColor = gl_Color * vec4(intensity, intensity, intensity, 1.0);
}