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

@@ -17,13 +17,13 @@ static const char* useShadowMapInstancingFragmentShader= \
"out vec4 color;\n"
"void main(void)\n"
"{\n"
" vec4 texel = fragment.color*texture(Diffuse,vert.texcoord);//fragment.color;\n"
" vec4 texel = fragment.color*texture(Diffuse,vert.texcoord);\n"
" vec3 ct,cf;\n"
" float intensity,at,af;\n"
" \n"
" intensity = clamp( dot( normalize(normal),lightDir ), 0,1 );\n"
" \n"
" cf = ambient;\n"
" \n"
" af = 1.0;\n"
" \n"
" ct = texel.rgb;\n"
@@ -35,15 +35,10 @@ static const char* useShadowMapInstancingFragmentShader= \
" bias = clamp(bias, 0,0.01);\n"
" float visibility = texture(shadowMap, vec3(ShadowCoord.xy,(ShadowCoord.z-bias)/ShadowCoord.w));\n"
" \n"
" intensity*=2;\n"
" if (intensity>1)\n"
" intensity=1.f;\n"
" intensity = 0.7*intensity + 0.3*intensity*visibility;\n"
" \n"
" visibility *= intensity;\n"
" \n"
" if (visibility<0.6)\n"
" visibility=0.6f;\n"
" cf = intensity*(vec3(1.0,1.0,1.0)-ambient)+ambient;\n"
" \n"
" color = vec4(ct * visibility, fragment.color.w);\n"
" color = vec4(ct * cf, fragment.color.w);\n"
"}\n"
;