fixed many memory leaks
added working shadows, using basic shadow mapping
This commit is contained in:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user