Commit graph

2406 commits

Author SHA1 Message Date
Jozufozu
20a75321e2 Fix occasional crash when flywheel objects are loaded in 2022-02-14 20:36:35 -08:00
PepperCode1
9cc6523368 Merge remote-tracking branch 'origin/1.18/dev' into 1.18/fabric/dev
Conflicts:
	build.gradle
	src/main/java/com/jozufozu/flywheel/backend/Backend.java
	src/main/java/com/jozufozu/flywheel/backend/OptifineHandler.java
	src/main/java/com/jozufozu/flywheel/backend/instancing/batching/BatchedMaterialGroup.java
	src/main/java/com/jozufozu/flywheel/core/model/ModelTransformer.java
	src/main/java/com/jozufozu/flywheel/core/model/ModelUtil.java
	src/main/java/com/jozufozu/flywheel/util/RenderMath.java
2022-02-12 21:38:01 -08:00
Jozufozu
c07c6363f9 Resolve redirect conflict and add more optifine hacks
- Fix entitiesForRendering redirect to be compatible with carpet.
 - Use more reflection for dealing with optifine
 - Fixes issue where flywheel would still be on immediately after enabling optifine shaders
2022-02-10 21:26:56 -08:00
PepperCode1
7515cc74f7 Remove force diffuse
- The batching engine may run in parallel, meaning the force diffuse
state will not be read correctly
- ModelTransformers only process vertices that will be rendered in the
world
- Add 0.6.1 to the issue template
2022-02-08 21:37:09 -08:00
PepperCode1
f24c1fafba Add, refactor, remove
- Add DiffuseLightCalculator
- Add ModelUtil.VANILLA_RENDERER for consistent virtual rendering
- Refactor OptifineHandler
- Remove MatrixTransformStack
2022-02-08 19:26:36 -08:00
PepperCode1
59c4ac3cb8 Fix and optimize model hacks
- Remove isVanillaAdapter check from CullingBakingModel.wrap
- Optimize model wrapping in ModelUtil.getBufferBuilderFromTemplate
2022-02-06 16:28:33 -08:00
PepperCode1
2b5e71e172 Fix Sodium mixin not being remapped in prod 2022-02-06 12:38:47 -08:00
Jozufozu
ae5853442b Small utility functions 2022-02-06 00:55:49 -08:00
IMS
bbc5cc60bf
Fix Sodium block entity support (#108)
* Fix Sodium block entity support

* Fix production remapping

* Make sodium modCompileOnly

* Finalize Sodium compatibility

- Improve mixin to redirect getting of renderer instead of adding of
block entity
- Move mixins from mixin.sodium to fabric.mixin.sodium
- Remove Joml dependency

Co-authored-by: PepperCode1 <44146161+PepperCode1@users.noreply.github.com>
2022-02-03 19:49:24 -08:00
PepperCode1
e48ecccf32 Improve Iris compatibility
- Use config-based areShadersEnabled when choosing the engine
2022-02-03 17:12:50 -08:00
PepperCode1
8fcc1df383 Merge remote-tracking branch 'origin/1.18/dev' into 1.18/fabric/dev
Conflicts:
	src/main/java/com/jozufozu/flywheel/Flywheel.java
	src/main/java/com/jozufozu/flywheel/FlywheelClient.java
	src/main/java/com/jozufozu/flywheel/backend/Backend.java
	src/main/java/com/jozufozu/flywheel/backend/Loader.java
	src/main/java/com/jozufozu/flywheel/backend/instancing/InstancedRenderDispatcher.java
	src/main/java/com/jozufozu/flywheel/config/FlwCommands.java
	src/main/java/com/jozufozu/flywheel/config/FlwConfig.java
	src/main/java/com/jozufozu/flywheel/event/ForgeEvents.java
2022-02-01 21:32:31 -08:00
PepperCode1
1d0e0eb6bc Compress config command code
- Remove BooleanConfig, BooleanConfigCommand, and BooleanDirective
- Make Flywheel.VERSION private so it cannot be changed
- Move createUpdateLimiter from FlwConfig to InstanceManager
2022-02-01 20:44:53 -08:00
Jozufozu
9219fef20a Toggleable update limiting
- Extract update limiting behavior to interface
 - Move original impl to BandedPrimeLimiter
 - Add dummy NonLimiter impl
 - Add command/config to toggle update limiting
 - Refactor InstanceManager to be more consistent between frame updates and tick updates
 - Bump version - 0.6.1
2022-02-01 13:56:08 -08:00
Jozufozu
b403ca3d2b Pepper's catches
- GlCompat now a singleton, doesn't need to be re-created
 - Fix crash with F3 open and backend off
 - Clear program spec map before loading
 - Merge FlywheelClient and Flywheel classes
2022-02-01 12:46:47 -08:00
PepperCode1
c38d66e867 Merge remote-tracking branch 'origin/1.18/dev' into 1.18/fabric/dev
Conflicts:
	gradle.properties
	src/main/java/com/jozufozu/flywheel/Flywheel.java
	src/main/java/com/jozufozu/flywheel/backend/instancing/instancing/InstancingEngine.java
	src/main/java/com/jozufozu/flywheel/config/BooleanConfig.java
	src/main/java/com/jozufozu/flywheel/config/BooleanConfigCommand.java
	src/main/java/com/jozufozu/flywheel/config/BooleanDirective.java
	src/main/java/com/jozufozu/flywheel/config/EngineArgument.java
	src/main/java/com/jozufozu/flywheel/config/FlwCommands.java
	src/main/java/com/jozufozu/flywheel/event/ForgeEvents.java
	src/main/resources/META-INF/mods.toml
2022-01-31 18:18:24 -08:00
Jozufozu
a1791399b6 Un-remove getBackendDescriptor
- No point in incorrectly inlining it
 - One useage was replaced by InstancedRenderDispatcher#getDebugString
2022-01-31 13:26:55 -08:00
Jozufozu
24423c56a8 Add more debug info
- Flywheel version
 - Vertex/Instance count
 - Origin coordinate for Instancing Engine
2022-01-31 13:14:30 -08:00
Jozufozu
84432fb837
Add 0.6.0 to bug report template 2022-01-25 18:01:36 -08:00
Jozufozu
421e11ebc1
Create FUNDING.yml 2022-01-25 10:13:24 -08:00
Jozufozu
5a2de8095c Update changelog and document Translate#nudge 2022-01-25 10:12:08 -08:00
Jozufozu
c490d15876 Initial move to client commands.
- Nothing fancy, just inlining packets.
2022-01-24 10:46:17 -08:00
Jozufozu
2638e79aa2 Add accessor to BlockEntityRenderer map. 2022-01-18 13:44:28 -08:00
PepperCode1
eeab6543da Merge remote-tracking branch 'origin/1.18/dev' into 1.18/fabric/dev
Conflicts:
	src/main/java/com/jozufozu/flywheel/FlywheelClient.java
	src/main/java/com/jozufozu/flywheel/backend/Backend.java
	src/main/java/com/jozufozu/flywheel/backend/Loader.java
	src/main/java/com/jozufozu/flywheel/event/ForgeEvents.java
	src/main/java/com/jozufozu/flywheel/event/GatherContextEvent.java
	src/main/java/com/jozufozu/flywheel/mixin/LevelRendererMixin.java
2022-01-17 21:55:55 -08:00
Jozufozu
26ea6bd315 Bump version - 0.6.0 2022-01-17 18:26:28 -08:00
Jozufozu
1ad64c595c Merge branch '1.18/shader-sanity' into 1.18/dev 2022-01-17 16:56:39 -08:00
Jozufozu
bc55726da3 A fix and a refactor
- ModelPools no longer undbind their buffer during construction, as state should be maintained externally
 - Call BufferUploader#reset at the end of renderChunkLayer to partially fix crash rendering contraptions
 - Remove Engine#getName, it was replaced by FlwEngine
2022-01-17 16:19:18 -08:00
Jozufozu
ddf6383175
Merge pull request #98 from AeiouEnigma/1.18/fabric/dev
merge forge branch
2022-01-17 15:40:07 -08:00
Aeiou
80fb7cef05 Merge remote-tracking branch 'origin/1.18/dev' into 1.18/fabric/dev
# Conflicts:
#	src/main/java/com/jozufozu/flywheel/mixin/LevelRendererMixin.java
2022-01-13 21:16:21 -05:00
Jozufozu
b351baa824 Handle arbitrary numbers of GameStateProviders
- Use bitset instead of long.
 - We only ever iterate over the GameStateProviders, so use a list instead of a map.
 - GameStateProviders don't need IDs.
2022-01-13 15:58:51 -08:00
Jozufozu
298ca3e9f1 Reorganize and simplify
- StructTypes no longer need to be registered
 - Move backend.source to core.source
 - Move GameStateRegistry to core
 - Backend is static again
 - Loader maintains state internally
2022-01-12 21:25:03 -08:00
Jozufozu
a62bc66060 Better memoized shader compilation and global game state
- Properly separate compilation of vertex and fragment shaders
 - Game state is no longer per-program
 - Needs organization
2022-01-12 00:19:37 -08:00
Jozufozu
7d4055f263 More organized shader compilation 2022-01-11 13:17:55 -08:00
Jozufozu
e228427e72 Sodium compatibility 2022-01-10 15:08:02 -08:00
Jozufozu
2d63d8c7db Separate vertex and fragment shaders and templates 2022-01-10 14:38:26 -08:00
Jozufozu
12cab85f69 Merge branch '1.18/dev' into 1.18/shader-sanity
# Conflicts:
#	src/main/java/com/jozufozu/flywheel/backend/instancing/instancing/InstancingEngine.java
2022-01-09 22:35:42 -08:00
PepperCode1
a76cd76c90 Fix build 2022-01-09 16:09:44 -08:00
PepperCode1
cd64f96d01 Merge remote-tracking branch 'origin/1.18/dev' into 1.18/fabric/dev
Conflicts:
	src/main/java/com/jozufozu/flywheel/mixin/LevelRendererMixin.java
	src/main/resources/flywheel.mixins.json
2022-01-09 11:09:24 -08:00
Jozufozu
f8ed5df41d Update changelog 2022-01-08 17:42:32 -08:00
Jozufozu
b2c03a4069 Conditional state restore and BufferUploader sanity check
- Only restore state that has changed
 - Sanity check to fix error condition on reset
2022-01-08 16:48:42 -08:00
Jozufozu
3391e3e168 GlStateTracker for better state restore
- Replaces both ShaderInstanceAccessor and BufferUploaderAccessor
2022-01-08 14:51:55 -08:00
Jozufozu
bfe123d167 Almost sane shaders
- No more ShaderContext. Programs are directly retrieved through ProgramCompilers.
 - Templates don't need generics
 - Remove ExtensibleGlProgram
2022-01-07 22:46:29 -08:00
Jozufozu
b6a00b54dd Fix crash rendering biome-tinted blocks on contraptions
- Biome colors now line up with the world
2022-01-07 14:18:59 -08:00
Jozufozu
06e1d5a901 Flatten core.shader and fix residual merge conflicts 2022-01-07 12:01:03 -08:00
Jozufozu
2254a693c9 Merge branch '1.18/dev' into 1.18/shader-sanity
# Conflicts:
#	src/main/java/com/jozufozu/flywheel/backend/source/FileResolution.java
#	src/main/java/com/jozufozu/flywheel/core/shader/GameStateProgram.java
#	src/main/java/com/jozufozu/flywheel/core/shader/gamestate/NormalDebugStateProvider.java
#	src/main/java/com/jozufozu/flywheel/core/shader/spec/BooleanGameStateCondition.java
#	src/main/java/com/jozufozu/flywheel/core/shader/spec/GameStateCondition.java
#	src/main/java/com/jozufozu/flywheel/core/shader/spec/ProgramState.java
#	src/main/java/com/jozufozu/flywheel/core/shader/spec/SpecificValueCondition.java
2022-01-07 11:52:42 -08:00
Jozufozu
01fb788fa3 Reduce merge conflicts with shader-sanity 2022-01-07 11:50:01 -08:00
PepperCode1
ec97b82ed6 Add Iris compatibility
- Use the Iris API to detect shader rendering state
- Remove CommandNameProviderEnum and use a Function argument instead
2022-01-06 15:25:52 -08:00
Jozufozu
e4182a7f1e RenderLayers directly store DrawBuffers
- Inspired by pepper's BlockEntityTypeExtensions
 - Document the batching engine internals.
2022-01-06 15:25:00 -08:00
PepperCode1
05c6d9d685 Merge remote-tracking branch 'origin/1.18/dev' into 1.18/fabric/dev
Conflicts:
	src/main/java/com/jozufozu/flywheel/mixin/RenderHooksMixin.java
	src/main/resources/flywheel.mixins.json
2022-01-06 14:03:34 -08:00
Jozufozu
5c4ff9ca2a Fix visual artifacts with contraptions while using opfine.
I think the buffers from the shadow pass were bleeding into the color pass.
2022-01-06 13:04:16 -08:00
Jozufozu
e0342c4b78 Better state restore in InstancingEngine
- Attempt to fix optifine issues
 - Replace <code> with {@code}
2022-01-06 13:04:16 -08:00