MCPcopy Create free account
hub / github.com/ddiakopoulos/polymer / run_shadow_pass

Method run_shadow_pass

libraries/lib-engine/src/renderer-pbr.cpp:294–318  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

292}
293
294void 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
320void pbr_renderer::run_forward_pass(std::vector<const render_component *> & render_queue, const view_data & view, const render_payload & scene)
321{

Callers

nothing calls this directly

Calls 9

aspect_from_projectionFunction · 0.85
vfov_from_projectionFunction · 0.85
gl_check_errorFunction · 0.85
update_cascadesMethod · 0.80
update_shadow_matrixMethod · 0.80
pre_drawMethod · 0.45
getMethod · 0.45
drawMethod · 0.45
post_drawMethod · 0.45

Tested by

no test coverage detected