-
-
Notifications
You must be signed in to change notification settings - Fork 70
Improve model builders #299
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 1.20.1/dev
Are you sure you want to change the base?
Conversation
| public static final Material SOLID_BLOCK = SimpleMaterial.builder() | ||
| .build(); | ||
| public static final Material SOLID_UNSHADED_BLOCK = SimpleMaterial.builder() | ||
| public static final Material SOLID_UNSHADED_BLOCK = SimpleMaterial.builderOf(SOLID_BLOCK) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is adding new static final field in the middle binary compat safe?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How a static final field is computed should never impact binary compat. Right now, no new fields are added, but adding new fields should not affect binary compat either as they are referenced by name.
common/src/lib/java/dev/engine_room/flywheel/lib/model/baked/ResultConsumer.java
Outdated
Show resolved
Hide resolved
forge/src/lib/java/dev/engine_room/flywheel/lib/model/baked/ForgeMeshEmitter.java
Show resolved
Hide resolved
forge/src/lib/java/dev/engine_room/flywheel/lib/model/baked/ForgeMeshEmitterManager.java
Outdated
Show resolved
Hide resolved
common/src/lib/java/dev/engine_room/flywheel/lib/model/baked/MeshEmitterManager.java
Outdated
Show resolved
Hide resolved
common/src/lib/java/dev/engine_room/flywheel/lib/model/baked/MeshEmitterManager.java
Outdated
Show resolved
Hide resolved
| RenderType defaultLayer = ItemBlockRenderTypes.getChunkRenderType(state); | ||
| universalEmitter.prepare(defaultLayer); | ||
| model = universalEmitter.wrapModel(model); | ||
| boolean defaultAo = useAo && state.getLightEmission() == 0 && model.useAmbientOcclusion(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this logic copied from vanilla somewhere? Should we reference where so we can check for consistency later on?
common/src/lib/java/dev/engine_room/flywheel/lib/model/baked/MeshEmitterManager.java
Show resolved
Hide resolved
| return this; | ||
| } | ||
|
|
||
| public BlockModelBuilder materialFunc(@Nullable BlockMaterialFunction materialFunc) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Binary compat?
- Additionally provide AO to material function - Optimize mesh count by not preserving quad order between blocks - Optimize mesh count by not splitting meshes when different inputs to the material function (except RenderType) produce the same material
7c2d5ab to
15cef3f
Compare
- Completely inline result consumer - MeshEmitterManager now directly creates the SimpleModel
- Inline ArrayList and directly use parallel arrays in MeshEmitter
RenderType) produce the same materialTODO
ModelUtil.getMaterialoverload and add newLightShaders if necessary.BufferBuilders.BlockMaterialFunctioninModelBuilderResultConsumerascreateKeywill be called a lot of times.