Skip to content

Add option to pre-compile particle materials at game load or scene load #10956

Open
@coldays

Description

@coldays

Describe the project you are working on

Ludum dare + other hobby projects

Describe the problem or limitation you are having in your project

When using particles in projects, the norm as stated in this godot issue is to display the particles at one frame at the start of the scene/game. Although I could not get this working for web export, which could be a skill issue, it would make it much easier for people to start using particles.

Describe the feature / enhancement and how it helps to overcome the problem or limitation

Add a option to the GPUParticles3D/2D to prewarm or precompile the particleshadermaterial or directly on the particleshadermaterial.

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

When the option is checked, all particlematerials will be compiled on start-up of the game, so the player won't experience a lag spike from shader compilation.

If this enhancement will not be used often, can it be worked around with a few lines of script?

As stated in this godot issue, this can be worked around with displaying particles for a frame at the start of the game

Is there a reason why this should be core and not an add-on in the asset library?

This is available in other game engines like Unity's prewarm particle system option

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions