more information for the InfoWindow,

set correct values for cloth material,
enable specular map
This commit is contained in:
Anakin
2017-01-22 14:37:06 +01:00
parent 5f104e46f2
commit 91488c55b2
6 changed files with 82 additions and 40 deletions

View File

@@ -12,10 +12,12 @@ space - reset view
L - set light to current position
esc - close
using the X, Y, Z Button you can activate/deactivate the rotating directions
using the X, Y, Z buttons you can activate/deactivate the rotating directions.
tipp: do round movement to rotate the object in z-direction, when all directions are acitvated
textures marked with a '*' couldn't be open.
===============================================================
Credits:
ANDEWEGET

View File

@@ -12,6 +12,7 @@ uniform float materialShininess;
uniform vec3 materialSpecularColor;
uniform bool b_transparent;
uniform bool b_specular;
uniform bool b_light;
uniform struct Light {
@@ -34,8 +35,6 @@ void main()
vec4 surfaceColor = vec4(texture2D(texture, v_surfaceUV));
surfaceColor.rgb = pow(surfaceColor.rgb, vec3(2.2));
if(!b_transparent)
surfaceColor.a = 1.0f;
vec3 surfaceToLight;
float attenuation;
@@ -67,6 +66,8 @@ void main()
float specularCoefficient = 0.0;
if(diffuseCoefficient > 0.0)
specularCoefficient = pow(max(0.0, dot(surfaceToCamera, reflect(-surfaceToLight, normalWorld))), materialShininess);
if(b_specular)
materialSpecularColor = vec3(surfaceColor.a);
vec3 specular = specularCoefficient * materialSpecularColor * light.intensities;
// linear color before gamma correction)
@@ -74,6 +75,8 @@ void main()
// final color after gama correction
vec3 gamma = vec3(1.0/2.2);
if(!b_transparent)
surfaceColor.a = 1.0f;
gl_FragColor = vec4(pow(linearColor, gamma), surfaceColor.a);
}
else