more information for the InfoWindow,
set correct values for cloth material, enable specular map
This commit is contained in:
@@ -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
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user