Skip to content

Frame drop when updating country distance field #7

Description

@OneBogdan01

Godot version

v4.1.1.stable

godot-cpp version

4.4

System information

Windows 10

Issue description

This is caused because of the brute force approach when generating a SDF for the countries. This incurs a frame drop when assigning a province to a new country. It is easier to notice when the camera is in movement. I confirmed that this is the case because of the subviewports and not any other logic.

The fix is implementing a JFA algorithm for doing this in a more efficient manner. This paper can be used to achieve just that.

Another approach could be to move this to a compute shaders, this might result in faster times, but it has to be tested.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions