1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-04 12:00:25 +00:00

Merge pull request #100302 from clayjohn/light2d-optimize

Optimize PointLight2D shadow rendering by reducing draw calls and RD state changes
This commit is contained in:
Rémi Verschelde
2024-12-17 22:59:54 +01:00
8 changed files with 224 additions and 82 deletions

View File

@@ -499,7 +499,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;
}