0af1127745
- Goal: avoid needing to re-upload everything when instance count for one instancer changes - Solution: store instances in pages of 32 - Allocate pages in a GPU arena - Store one uint per page to indicate which model the instances in the page belong to, and how many instances are actually stored in the page - Instancers eagerly allocate and free pages as their instance count changes - Instancers will not necessarily store instances contiguously anymore, but that's okay because any given cull workgroup will only reference a single page - Culling threads *will* write instances contiguously however, and so we still need to keep track of a base instance per instancer, and the target buffer logic does not change |
||
---|---|---|
.github | ||
.idea | ||
buildSrc | ||
common | ||
docs/shader-api | ||
fabric | ||
forge | ||
gradle/wrapper | ||
.editorconfig | ||
.gitattributes | ||
.gitignore | ||
build.gradle.kts | ||
gradle.properties | ||
gradlew | ||
gradlew.bat | ||
javadoc-options.txt | ||
LICENSE.md | ||
README.md | ||
settings.gradle.kts |
About
The goal of this project is to provide tools for mod developers so they no longer have to worry about performance, or limitations of Minecraft's archaic rendering engine. That said, this is primarily an outlet for me to have fun with graphics programming.
Instancing
Flywheel provides an alternate, unified path for entity and tile entity rendering that takes advantage of GPU instancing. In doing so, Flywheel gives the developer the flexibility to define their own vertex and instance formats, and write custom shaders to ingest that data.
Shaders
To accomodate the developer and leave more in the hands of the engine, Flywheel provides a custom shader loading and templating system to hide the details of the CPU/GPU interface. This system is a work in progress. There will be breaking changes, and I make no guarantees of backwards compatibility.
Plans
- Vanilla performance improvements
- Compute shader particles
- Deferred rendering
- Different renderers for differently aged hardware
Getting Started (For Developers)
Add the following repo and dependency to your build.gradle
:
repositories {
maven {
name "tterrag maven"
url "https://maven.tterrag.com/"
}
}
dependencies {
compileOnly fg.deobf("dev.engine_room.flywheel:flywheel-forge-api-${minecraft_version}:${flywheel_version}")
runtimeOnly fg.deobf("dev.engine_room.flywheel:flywheel-forge-${minecraft_version}:${flywheel_version}")
}
${flywheel_version}
gets replaced by the version of Flywheel you want to use, eg. 1.0.0-beta
${minecraft_version}
gets replaced by the version of Minecraft you're on, eg. 1.20.1
For a list of available Flywheel versions, you can check the maven.
If you aren't using mixed mappings (or just want to be safe), add the following properties to your run configurations:
property 'mixin.env.remapRefMap', 'true'
property 'mixin.env.refMapRemappingFile', "${projectDir}/build/createSrgToMcp/output.srg"
This ensures that Flywheel's mixins get properly loaded in your dev env.