Add Flywheel backend #49

Merged
embeddedt merged 1 commits from flywheel into stonecutter 2026-10-29 10:09:36 -04:00
Owner

This PR adds a Flywheel backend to Celeritas, used when shaders are enabled. The backend is heavily derived from Colorwheel. Performance of Flywheel rendering should be essentially identical to Colorwheel since nothing was really changed there. This adds a rather significant amount of code, albeit isolated to its own module. The benefit is that Create is no longer extremely slow to use with shaders. Assorted notes on design choices etc follow.

Why Colorwheel is integrated in-tree instead of forked: first of all, we do not have a sufficient public API surface for something like Colorwheel to be implemented entirely externally. Building that is currently more effort than it's worth, especially since a replacement for the Iris-derived shader support remains on the roadmap.

Second, the fork would require nontrivial changes to handle cases where our internals have diverged from Iris, and to rewrite usages of the effectively proprietary glsl-transformer. These would then need to be rebased for every upstream change and Celeritas change. With the code in-tree, Celeritas refactors are handled immediately as always. Upstream's commit rate is not that high, so it should be fairly low effort to keep up with. In terms of OSS friendliness, this work has already led to a couple upstream fixes being sent: https://github.com/djefrey/Colorwheel/pull/87

Why I am willing to do this at all: Flywheel has become fairly standard on these versions for efficient instanced rendering, and is now used by several mods, not just Create. Create is also included in a significant majority of modpacks for these versions.

Unlike Colorwheel, we support only Flywheel 1.0.6+, mostly for simplicity. 1.20.1 users will have to download a newer Flywheel jar and add it to mods/ manually, since the last official Create release ships with 1.0.2.

This PR adds a Flywheel backend to Celeritas, used when shaders are enabled. The backend is heavily derived from Colorwheel. Performance of Flywheel rendering should be essentially identical to Colorwheel since nothing was really changed there. This adds a rather significant amount of code, albeit isolated to its own module. The benefit is that Create is no longer extremely slow to use with shaders. Assorted notes on design choices etc follow. Why Colorwheel is integrated in-tree instead of forked: first of all, we do not have a sufficient public API surface for something like Colorwheel to be implemented entirely externally. Building that is currently more effort than it's worth, especially since a replacement for the Iris-derived shader support remains on the roadmap. Second, the fork would require nontrivial changes to handle cases where our internals have diverged from Iris, and to rewrite usages of the effectively proprietary glsl-transformer. These would then need to be rebased for every upstream change and Celeritas change. With the code in-tree, Celeritas refactors are handled immediately as always. Upstream's commit rate is not that high, so it should be fairly low effort to keep up with. In terms of OSS friendliness, this work has already led to a couple upstream fixes being sent: https://github.com/djefrey/Colorwheel/pull/87 Why I am willing to do this at all: Flywheel has become fairly standard on these versions for efficient instanced rendering, and is now used by several mods, not just Create. Create is also included in a significant majority of modpacks for these versions. Unlike Colorwheel, we support only Flywheel 1.0.6+, mostly for simplicity. 1.20.1 users will have to download a newer Flywheel jar and add it to `mods/` manually, since the last official Create release ships with 1.0.2.
embeddedt added 1 commit 2026-10-28 12:08:29 -04:00
[shaders] add Flywheel backend
ci / build (push) Successful in 2m28s
1d7566c9f2
Ported from Colorwheel 1.3.0 (djefrey/Colorwheel@30f90fc).
embeddedt merged commit 4ad1357b39 into stonecutter 2026-10-29 10:09:36 -04:00
embeddedt deleted branch flywheel 2026-10-29 10:09:36 -04:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: embeddedt/celeritas#49