1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-15 13:51:40 +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:
clayjohn
2024-12-11 23:32:19 -08:00
parent 38775731e8
commit 7c61252dd7
8 changed files with 224 additions and 82 deletions

View File

@@ -1636,7 +1636,7 @@ void RasterizerCanvasGLES3::light_set_use_shadow(RID p_rid, bool p_enable) {
cl->shadow.enabled = p_enable;
}
void RasterizerCanvasGLES3::light_update_shadow(RID p_rid, int p_shadow_index, const Transform2D &p_light_xform, int p_light_mask, float p_near, float p_far, LightOccluderInstance *p_occluders) {
void RasterizerCanvasGLES3::light_update_shadow(RID p_rid, int p_shadow_index, const Transform2D &p_light_xform, int p_light_mask, float p_near, float p_far, LightOccluderInstance *p_occluders, const Rect2 &p_light_rect) {
GLES3::Config *config = GLES3::Config::get_singleton();
CanvasLight *cl = canvas_light_owner.get_or_null(p_rid);