mirror of
https://github.com/godotengine/godot.git
synced 2025-10-19 16:03:29 +00:00
Optimize PointLight2D shadow rendering by reducing draw calls and RD state changes.
This dramatically reduces the CPU time spent on rendering shadows for PointLight2Ds
This commit is contained in:
parent
38775731e8
commit
7c61252dd7
8 changed files with 224 additions and 82 deletions
|
@ -498,7 +498,7 @@ void RendererViewport::_draw_viewport(Viewport *p_viewport) {
|
|||
while (light) {
|
||||
RENDER_TIMESTAMP("Render PointLight2D Shadow");
|
||||
|
||||
RSG::canvas_render->light_update_shadow(light->light_internal, shadow_count++, light->xform_cache.affine_inverse(), light->item_shadow_mask, light->radius_cache / 1000.0, light->radius_cache * 1.1, occluders);
|
||||
RSG::canvas_render->light_update_shadow(light->light_internal, shadow_count++, light->xform_cache.affine_inverse(), light->item_shadow_mask, light->radius_cache / 1000.0, light->radius_cache * 1.1, occluders, light->rect_cache);
|
||||
light = light->shadows_next_ptr;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue