add a textured sphere8.obj test with obj loader

fix shaders, so that shadowed and non-shadowed are matching
fix registerGraphicsUnitSphereShape API (level of detail), support textured sphere too
add support for textured cube
add start for a Tutorial.cpp
This commit is contained in:
erwin coumans
2015-08-05 19:03:27 -07:00
parent 250068d5eb
commit a5669d2ffd
29 changed files with 2138 additions and 105 deletions

View File

@@ -23,13 +23,13 @@ out vec4 color;
void main(void)
{
vec4 texel = fragment.color*texture(Diffuse,vert.texcoord);//fragment.color;
vec4 texel = fragment.color*texture(Diffuse,vert.texcoord);
vec3 ct,cf;
float intensity,at,af;
intensity = clamp( dot( normalize(normal),lightDir ), 0,1 );
cf = ambient;
af = 1.0;
ct = texel.rgb;
@@ -43,14 +43,9 @@ void main(void)
float visibility = texture(shadowMap, vec3(ShadowCoord.xy,(ShadowCoord.z-bias)/ShadowCoord.w));
intensity*=2;
if (intensity>1)
intensity=1.f;
intensity = 0.7*intensity + 0.3*intensity*visibility;
visibility *= intensity;
if (visibility<0.6)
visibility=0.6f;
cf = intensity*(vec3(1.0,1.0,1.0)-ambient)+ambient;
color = vec4(ct * visibility, fragment.color.w);
color = vec4(ct * cf, fragment.color.w);
}