Skip to content

Replace water inverse floodfill with scanline rasterization#753

Merged
louis-e merged 2 commits intomainfrom
scanline-water-rasterization
Feb 14, 2026
Merged

Replace water inverse floodfill with scanline rasterization#753
louis-e merged 2 commits intomainfrom
scanline-water-rasterization

Conversation

@louis-e
Copy link
Owner

@louis-e louis-e commented Feb 14, 2026

No description provided.

Copilot AI review requested due to automatic review settings February 14, 2026 18:46
@github-actions
Copy link

⏱️ Benchmark run finished in 0m 24s
🧠 Peak memory usage: 1097 MB

📈 Compared against baseline: 30s
🧮 Delta: -6s
🔢 Commit: 4f25a11

✅ This PR improves generation time.

📅 Last benchmark: 2026-02-14 18:50:14 UTC

You can retrigger the benchmark by commenting retrigger-benchmark.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR replaces the quadtree-based inverse floodfill algorithm for water area generation with a scanline rasterization approach. The change aims to dramatically improve performance for large or complex water bodies by reducing algorithmic complexity from O(A * V * P) to O(E * H + A), where A is the filled area, V is vertices per polygon, P is polygon count, E is total edges, and H is the height of the fill area.

Changes:

  • Replaced recursive quadtree inverse floodfill with scanline rasterization algorithm
  • Removed dependency on geo crate functions (Orient, Contains, Intersects, Polygon types)
  • Implemented even-odd parity rule for polygon filling with edge crossing detection

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@louis-e louis-e merged commit 1d170d8 into main Feb 14, 2026
8 checks passed
@louis-e louis-e deleted the scanline-water-rasterization branch February 14, 2026 19:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants