| 3414 | } |
| 3415 | |
| 3416 | void DrawShadowCache(const mat4& proj_view_matrix, const char* special) { |
| 3417 | Graphics* graphics = Graphics::Instance(); |
| 3418 | Shaders* shaders = Shaders::Instance(); |
| 3419 | |
| 3420 | GLState gl_state; |
| 3421 | gl_state.depth_test = true; |
| 3422 | gl_state.cull_face = true; |
| 3423 | gl_state.depth_write = true; |
| 3424 | gl_state.blend = false; |
| 3425 | |
| 3426 | graphics->setGLState(gl_state); |
| 3427 | |
| 3428 | const int kBufSize = 512; |
| 3429 | char shader_name[kBufSize]; |
| 3430 | FormatString(shader_name, kBufSize, "shadow%s", special); |
| 3431 | int shader_id = shaders->returnProgram(shader_name); |
| 3432 | shaders->setProgram(shader_id); |
| 3433 | shaders->SetUniformMat4("projection_view_mat", proj_view_matrix); |
| 3434 | int vert_attrib_id = shaders->returnShaderAttrib("vert", shader_id); |
| 3435 | |
| 3436 | shadow_cache_verts_vbo.Bind(); |
| 3437 | graphics->EnableVertexAttribArray(vert_attrib_id); |
| 3438 | glVertexAttribPointer(vert_attrib_id, 3, GL_FLOAT, false, 0, 0); |
| 3439 | shadow_cache_indices_vbo.Bind(); |
| 3440 | graphics->DrawElements(GL_TRIANGLES, shadow_cache_indices.size(), GL_UNSIGNED_INT, 0); |
| 3441 | graphics->ResetVertexAttribArrays(); |
| 3442 | } |
| 3443 | |
| 3444 | static bool UpdateShadowCache(SceneGraph* scenegraph) { |
| 3445 | Graphics* graphics = Graphics::Instance(); |
no test coverage detected