fixed many memory leaks

added working shadows, using basic shadow mapping
This commit is contained in:
erwin coumans
2013-06-30 23:19:14 -07:00
parent f2cc840c31
commit 6d6ef5d3dc
28 changed files with 581 additions and 226 deletions

View File

@@ -13,8 +13,7 @@ static const char* createShadowMapInstancingVertexShader= \
"layout (location = 6) in vec3 instance_scale;\n"
"\n"
"\n"
"uniform mat4 ModelViewMatrix;\n"
"uniform mat4 ProjectionMatrix;\n"
"uniform mat4 depthMVP;\n"
"\n"
"\n"
"vec4 quatMul ( in vec4 q1, in vec4 q2 )\n"
@@ -52,7 +51,7 @@ static const char* createShadowMapInstancingVertexShader= \
"{\n"
" vec4 q = instance_quaternion;\n"
" vec4 localcoord = quatRotate3( position.xyz*instance_scale,q);\n"
" vec4 vertexPos = ProjectionMatrix * ModelViewMatrix * vec4( (instance_position+localcoord).xyz,1);\n"
" vec4 vertexPos = depthMVP * vec4( (instance_position+localcoord).xyz,1);\n"
" gl_Position = vertexPos;\n"
"}\n"
"\n"