| 292 | } |
| 293 | |
| 294 | void pbr_renderer::run_shadow_pass(const view_data & view, const render_payload & scene) |
| 295 | { |
| 296 | shadow->update_cascades(view.viewMatrix, |
| 297 | view.nearClip, |
| 298 | view.farClip, |
| 299 | aspect_from_projection(view.projectionMatrix), |
| 300 | vfov_from_projection(view.projectionMatrix), |
| 301 | scene.sunlight->data.direction); |
| 302 | |
| 303 | shadow->pre_draw(); |
| 304 | |
| 305 | for (const render_component & r : scene.render_components) |
| 306 | { |
| 307 | if (r.material->material.get()->cast_shadows) |
| 308 | { |
| 309 | // const float4x4 modelMatrix = (r.world_transform->world_pose.matrix() * make_scaling_matrix(r.local_transform->local_scale)); |
| 310 | shadow->update_shadow_matrix(r.world_matrix); |
| 311 | r.mesh->draw(); |
| 312 | } |
| 313 | } |
| 314 | |
| 315 | shadow->post_draw(); |
| 316 | |
| 317 | gl_check_error(__FILE__, __LINE__); |
| 318 | } |
| 319 | |
| 320 | void pbr_renderer::run_forward_pass(std::vector<const render_component *> & render_queue, const view_data & view, const render_payload & scene) |
| 321 | { |
nothing calls this directly
no test coverage detected