Skip to content

Rendering: Skip shadow rendering for inactive particles - #118449

Merged
Repiteo merged 1 commit into
godotengine:masterfrom
Mingxi-Z:fix/cull-inactive-particles-shadow
Jun 18, 2026
Merged

Rendering: Skip shadow rendering for inactive particles#118449
Repiteo merged 1 commit into
godotengine:masterfrom
Mingxi-Z:fix/cull-inactive-particles-shadow

Conversation

@Mingxi-Z

Copy link
Copy Markdown
Contributor

This PR optimizes shadow rendering by skipping inactive particle systems during the culling phase in RendererSceneCull.

Currently, even if a particle system is inactive (not emitting and no particles remaining), it is still added to the shadow instance lists. This results in redundant drawIndexedPrimitives calls with the full particle amount as the instanceCount.

Fixes #116682

As shown in the attached GPU frame captures, the redundant draw call for inactive particles is eliminated (using MRP from #116682).

Before Fix, a shadow draw call is issued for the inactive particle system with instanceCount: 200
Before Fix

After Fix, the redundant draw call is skipped.
After Fix

@blueskythlikesclouds blueskythlikesclouds left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The same checks should also be added for cubemap omni light shadows and area shadows. You'll need to rebase on master for the latter.

@Mingxi-Z
Mingxi-Z force-pushed the fix/cull-inactive-particles-shadow branch from c93a0b3 to d55b20c Compare April 24, 2026 11:40

@blueskythlikesclouds blueskythlikesclouds left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works nicely.

@Repiteo Repiteo modified the milestones: 4.x, 4.8 Apr 25, 2026

@Calinou Calinou left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested locally, it works as expected. Code looks good to me.

Benchmark

MRP of #116682 with 100,000 particles:

Before After
707 FPS 4135 FPS
PC specifications
  • CPU: AMD Ryzen 9 9950X3D
  • GPU: NVIDIA GeForce RTX 5090
  • RAM: 64 GB (2×32 GB DDR5-6000 CL30)
  • SSD: Solidigm P44 Pro 2 TB
  • OS: Linux (Fedora 43)

@Repiteo
Repiteo merged commit 4924ab8 into godotengine:master Jun 18, 2026
20 checks passed
@Repiteo

Repiteo commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Thanks!

BendyLand pushed a commit to BendyLand/voltaire that referenced this pull request Aug 2, 2026
…-particles-shadow

Rendering: Skip shadow rendering for inactive particles
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Vulkan: Non-emitting GPUParticles3D cause draw call in "Shadow Render" pass

5 participants