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

@@ -11,6 +11,7 @@ static const char* instancingVertexShader= \
"layout (location = 6) in vec3 instance_scale;\n"
"uniform mat4 ModelViewMatrix;\n"
"uniform mat4 ProjectionMatrix;\n"
"uniform vec3 lightDirIn;\n"
"out Fragment\n"
"{\n"
" vec4 color;\n"
@@ -51,16 +52,13 @@ static const char* instancingVertexShader= \
"void main(void)\n"
"{\n"
" vec4 q = instance_quaternion;\n"
" ambient = vec3(0.3,.3,0.3);\n"
" \n"
" \n"
" vec4 local_normal = (quatRotate3( vertexnormal,q));\n"
" vec3 light_pos = vec3(-0.3,0.1,0.1);\n"
" normal = local_normal.xyz;//normalize(ModelViewMatrix * local_normal).xyz;\n"
" lightDir = normalize(light_pos);//gl_LightSource[0].position.xyz));\n"
"// lightDir = normalize(vec3(gl_LightSource[0].position));\n"
" \n"
" vec4 axis = vec4(1,1,1,0);\n"
" ambient = vec3(0.6,.6,0.6);\n"
" \n"
" vec4 worldNormal = (quatRotate3( vertexnormal,q));\n"
" normal = normalize(worldNormal).xyz;\n"
" \n"
" lightDir = lightDirIn;\n"
" \n"
" vec4 localcoord = quatRotate3( position.xyz*instance_scale,q);\n"
" vec4 vertexPos = ProjectionMatrix * ModelViewMatrix *(instance_position+localcoord);\n"
" gl_Position = vertexPos;\n"