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
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
PepperCode1
0a8a9551c7
Merge remote-tracking branch 'origin/1.18/dev' into 1.18/fabric/dev
2022-01-04 21:50:33 -08:00
Jozufozu
379fe60ce6
Document, annotate, and rename
...
- Add documentation for new InstancedRenderRegistry
- Annotate TypeExtensions with Nullable
- Add method for creating bulk instances
2022-01-04 14:14:30 -08:00
PepperCode1
b2bc5fd438
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/config/BooleanConfig.java
src/main/java/com/jozufozu/flywheel/core/vertex/BlockVertex.java
2022-01-04 10:56:09 -08:00
PepperCode1
eb8dc6bc07
Switch to instancing controllers
...
- Combine InstanceFactories and FlywheelRendered into
InstancingControllers
- Store these controllers directly in the BlockEntity/Entity type
instead of a map for efficiency
- Redo InstancedRenderRegistry to fit these changes
- Rename all tile to block entity
- Remove all interface I prefixes
- Organize imports
- Bump version to 0.5.1
2022-01-03 21:41:08 -08:00
Jozufozu
c196ed5d78
Consider RenderLayer when compiling shaders
...
- Disabled cutout logic in other layers
2022-01-01 15:19:49 -08:00
PepperCode1
44f3358f3e
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/event/EntityWorldHandler.java
2021-12-31 12:57:19 -08:00
Jozufozu
1f5f2a5476
Compile everything on the fly
...
- Simplify game state system
- Need some way to re-add errors on load.
- Streamline shader compilation, reduce map lookups
- Move pipeline package from backend to core
- Simplify interfaces and remove unnecessary classes
2021-12-31 12:08:07 -08:00
Jozufozu
67b91a95f6
Merge branch '1.18/dev' into 1.18/shader-sanity
...
# Conflicts:
# src/main/java/com/jozufozu/flywheel/backend/Backend.java
# src/main/java/com/jozufozu/flywheel/backend/gl/shader/GlShader.java
# src/main/java/com/jozufozu/flywheel/backend/pipeline/ProgramAssembler.java
# src/main/java/com/jozufozu/flywheel/core/WorldContext.java
2021-12-31 00:25:24 -08:00
Jozufozu
4c0df23702
Write active backend to crash reports
2021-12-30 20:01:45 -08:00
Jozufozu
d38e2421c9
Fix crash on resource reload with flywheel disabled
...
- Closes #83
- Move engine selection to function
- Rename Backend.log to Backend.LOGGER
2021-12-30 15:15:25 -08:00
Jozufozu
a8842d4c64
Shader sanity
...
- Drastically lower shader boilerplate for instance materials
- Somewhat lower boilerplate for contexts
- VertexTypes are responsible for shader headers
- Better shader compiler errors (at least on nvidia)
- Simplify template classes
- Begin work on lazy shader compilation
2021-12-29 13:10:38 -08:00
Jozufozu
123a548474
Fix crash on load when backend is off
...
- Closes #81
- Disabled crashing on error poll
2021-12-28 20:39:32 -08:00
PepperCode1
c4ef94f5f5
Merge remote-tracking branch 'origin/1.18/dev' into 1.18/fabric/dev
...
Conflicts:
build.gradle
src/main/java/com/jozufozu/flywheel/Flywheel.java
src/main/java/com/jozufozu/flywheel/config/FlwPackets.java
src/main/java/com/jozufozu/flywheel/core/model/ModelTransformer.java
src/main/java/com/jozufozu/flywheel/core/model/ModelUtil.java
2021-12-28 16:19:53 -08:00
Jozufozu
92ad07c779
Batching is not actually compatible with shaders
2021-12-28 15:26:56 -08:00
Jozufozu
179eafecd3
Go through GlVertexArray
...
- VAO state is now handled by GlVertexArray objects
- IndexedModel no longer inherits from VBOModel
- BufferedModel doesn't need #clearState
- Likely fixes crash on intel drivers
2021-12-27 19:14:19 -08:00
Jozufozu
78030b2f40
Fix contraption lighting
...
- Actually just one line.
2021-12-27 13:37:09 -08:00
Jozufozu
47e3aaa290
Towards starlight compat
...
- Steal Mods enum from Create.
- Cursemaven dep for starlight
Co-authored-by: Aeiou <3160746+aeiouenigma@users.noreply.github.com>
2021-12-26 15:41:20 -08:00
Jozufozu
c153995121
No more diffuse divide
...
- Move PlacementSimulationWorld to Flywheel as VirtualRenderWorld
- Simplify ModelTransformer
- Model doesn't need #configure
2021-12-25 15:51:22 -08:00
PepperCode1
1e9e4e0054
Clean up
...
- Use Flywheel.rl and Flywheel.ID where ever possible
- Rename Flywheel.log to LOGGER
- Don't add namespace to network channel version
- Use counter for packet IDs
2021-12-24 23:26:18 -08:00
PepperCode1
0d79ee8638
Merge remote-tracking branch 'origin/1.18/dev' into 1.18/fabric/dev
...
Conflicts:
build.gradle
gradle.properties
src/main/java/com/jozufozu/flywheel/Flywheel.java
src/main/java/com/jozufozu/flywheel/backend/Loader.java
src/main/java/com/jozufozu/flywheel/config/BooleanConfig.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/config/FlwPackets.java
src/main/java/com/jozufozu/flywheel/core/model/BakedModelModel.java
src/main/java/com/jozufozu/flywheel/core/model/ModelUtil.java
src/main/java/com/jozufozu/flywheel/mixin/RenderHooksMixin.java
src/main/java/com/jozufozu/flywheel/util/BakedQuadWrapper.java
src/main/java/com/jozufozu/flywheel/util/BufferBuilderReader.java
src/main/java/com/jozufozu/flywheel/util/RenderUtil.java
2021-12-24 22:55:44 -08:00
PepperCode1
a2b6c4fd9d
Fix BufferBuilderReader endianness
...
- Set split ByteBuffer's order to that of the BufferBuilder's ByteBuffer
in BufferBuilderReader
- Move Fabric-only mixins from mixin.fabric to fabric.mixin and create
separate mixin config
2021-12-24 16:21:57 -08:00
Jozufozu
c268b9cc9b
Track VBO and EBO via vanilla
2021-12-24 16:15:20 -08:00
Jozufozu
6c40b8be0b
Repack JOML
2021-12-24 02:21:59 -08:00
Jozufozu
f4cdbb73f7
Fix GL error spam and do some cleanup
...
- Add flywheel$ prefix to mixin duck interfaces/accessors
- Better chat messages for /flywheel backend command
- Track VAO via vanilla
2021-12-24 01:45:38 -08:00
Jozufozu
4d5391f5dc
Contraptions and engines
...
- Sort of get the batching engine working for contraptions but this feels wrong
- TaskEngine gets passed in methods
- Better naming for TaskEngines
- Do BufferSource ourselves
- Change BufferBuilderMixin to allow for injection into BufferBuilder objects
2021-12-23 23:22:52 -08:00
Jozufozu
7c1de5c06a
Small config changes
...
- Make FlwCommands more readable
- EmptyArgumentSerializer for EngineArgument
2021-12-22 22:29:52 -08:00
Jozufozu
dc5382b658
Fix models being backwards
...
- Regression in ModelUtil#rotateToFace
2021-12-22 22:01:05 -08:00
Jozufozu
ee2b418ef7
Better config/backend to account for multiple engines
...
- Rename probably too many things
- Needs to be tested with Optifine
2021-12-22 21:35:48 -08:00
Jozufozu
99a50631cb
Fix diffuse lighting in batching engine
...
- Complete hack that definitely won't come back to bite me
- Also slighting change some unsafe writing stuff
2021-12-22 16:11:56 -08:00
Jozufozu
80d41a76af
GlBuffer tracks its size
...
- GlVertexArray#enableArrays
2021-12-22 14:39:34 -08:00
Jozufozu
ede2ba8776
Finally safe vertex formats
...
- true to false for Pepper
- IBufferedModel -> BufferedModel
- VertexFormat -> BufferLayout
- Use ImmutableList in BufferLayout
- LayoutItem naming consistency
- Try to reduce usage of raw BufferLayouts
- Move vertex interfaces to api package
- #createWriter and #createReader in VertexType
- Some documentation
2021-12-22 02:45:45 -08:00
Jozufozu
42365def02
util and core cleanup
...
- Consolidate/audit utility classes
- Move more towards sane vertex types
2021-12-22 00:22:41 -08:00
PepperCode1
09f3c495e9
Fix virtual model rendering
...
- Add various utility classes to allow FRAPI-compatible virtual
rendering
- Fix PartialModel using field instead of getter method
2021-12-21 23:37:52 -08:00
Jozufozu
4f31fa3e9c
Make the BatchingEngine not jittery
...
- Stop having threads compete for a single BufferBuilder
- ...by skirting around minecraft's BufferSource
- Begin work on making vertex writing sane
2021-12-21 22:47:29 -08:00
PepperCode1
1ee11c0af9
Merge remote-tracking branch 'origin/1.18/dev' into 1.18/fabric/dev
...
Conflicts:
src/main/java/com/jozufozu/flywheel/core/model/BlockModel.java
src/main/java/com/jozufozu/flywheel/core/model/ModelUtil.java
src/main/java/com/jozufozu/flywheel/util/VirtualEmptyModelData.java
2021-12-21 14:00:02 -08:00
Jozufozu
dc0ba5214b
Merge branch '1.18/dev' into 1.18/batching
...
# Conflicts:
# src/main/java/com/jozufozu/flywheel/core/model/BlockModel.java
2021-12-21 01:12:47 -08:00
Jozufozu
4908abc9e0
StructType doesn't need #asBatched and #asInstanced
...
- More organized this way
- BatchingTransformer function moved into Batched
2021-12-20 22:38:33 -08:00
PepperCode1
3e8644c988
Improve virtual model rendering
...
- Use VirtualEmptyBlockGetter instead of mc.level
- Move getBufferBuilder from BlockModel to ModelUtil
- Add static .is method to VirtualEmptyModelData
2021-12-20 17:47:30 -08:00
PepperCode1
03c2a51754
Fix "enabled" config command
...
- Change "enabled" subcommand to "backend" to match Forge version
2021-12-20 00:08:02 -08:00
PepperCode1
d144403d70
Merge remote-tracking branch 'origin/1.18/dev' into 1.18/fabric/dev
...
Conflicts:
README.md
gradle.properties
src/main/java/com/jozufozu/flywheel/FlywheelClient.java
src/main/java/com/jozufozu/flywheel/mixin/RenderHooksMixin.java
src/main/resources/pack.mcmeta
2021-12-19 23:56:37 -08:00
Jozufozu
a43fe2bc9a
No need for getDirtyBitSet
...
- Faster and simpler to just do one loop
2021-12-17 22:41:22 -08:00
Jozufozu
ffe17e4449
Use task engine/sync to update instances
2021-12-17 02:17:39 -08:00
Jozufozu
f651676dea
Proper task engine
...
- Manual threadpool
- More control
2021-12-17 01:03:52 -08:00
Jozufozu
431ff92861
Simplify SBB
...
- SBB -> ModelTransformer
- Shader binding the minecraft way
- Engines are responsible for ending batches
2021-12-16 23:10:24 -08:00
Jozufozu
be3f47dfbd
Naive parallelism
...
- Submit many tasks to executor and then wait for them all to complete.
- Use WaitGroup
- SBB no longer stores params, instead accepts Params arg to render
- SBB keeps scratch variables local
- CPUInstancer keeps track of default params
- Separate #setup and #draw... functions in CPUInstancer
- Combine DirectBufferBuilder#updateAfterWriting with #intoDirectConsumer
- DirectVertexConsumer#split to distribute work
2021-12-16 10:49:26 -08:00
Jozufozu
3767390c96
Better SBB params
...
- Transform interface for grouping traits and combined behavior
- Move transforms to params, impl Transform
- Pass Params object to BatchingTransformers instead of SBB
2021-12-16 00:11:47 -08:00
Jozufozu
cc707cf66a
Batching Engine
...
- Implement alternate backend using SBBs
2021-12-15 17:12:48 -08:00
Jozufozu
15ea38ede7
Possible fix(es) for accessor crash
...
- Haven't been able to reproduce
- Try forcing PausedPartialTickAccessor to load early
- Try renaming the method
2021-12-15 16:19:52 -08:00
Jozufozu
17fb8d34ed
Fix #extension crash on intel
2021-12-15 13:27:06 -08:00
PepperBell
cb5047f677
Sweeping up
...
- Remove deprecated methods and fields
- Bump pack format
- Fix CI badge link
- Update VanillaInstances javadoc
- Organize imports
2021-12-14 22:00:44 -08:00
Jozufozu
64a7443dde
No need for InstancedMaterialRenderer
...
- Here's to premature abstraction
2021-12-13 21:27:15 -08:00
Jozufozu
d9fd668bbb
AMD driver workaround
...
- Just don't pool models
2021-12-13 19:55:50 -08:00
Jozufozu
56150b2645
Fix vanishing minecarts
2021-12-12 22:30:46 -08:00
PepperBell
6fede0851e
Merge remote-tracking branch 'origin/1.18/dev' into 1.18/fabric/dev
...
Conflicts:
README.md
build.gradle
gradle.properties
src/main/java/com/jozufozu/flywheel/backend/RenderWork.java
src/main/java/com/jozufozu/flywheel/backend/material/MaterialManagerImpl.java
src/main/java/com/jozufozu/flywheel/config/BooleanConfigCommand.java
src/main/java/com/jozufozu/flywheel/config/FlwCommands.java
src/main/java/com/jozufozu/flywheel/config/FlwPackets.java
src/main/java/com/jozufozu/flywheel/config/SConfigureBooleanPacket.java
src/main/java/com/jozufozu/flywheel/core/PartialModel.java
src/main/java/com/jozufozu/flywheel/core/StitchedSprite.java
src/main/java/com/jozufozu/flywheel/core/model/ModelUtil.java
src/main/java/com/jozufozu/flywheel/event/ForgeEvents.java
src/main/java/com/jozufozu/flywheel/event/RenderLayerEvent.java
src/main/java/com/jozufozu/flywheel/mixin/LeakChunkStorageArrayMixin.java
src/main/java/com/jozufozu/flywheel/mixin/RenderHooksMixin.java
src/main/java/com/jozufozu/flywheel/util/ChunkIter.java
src/main/resources/META-INF/mods.toml
src/main/resources/flywheel.mixins.json
2021-12-12 17:29:09 -08:00
Jozufozu
11e5719e0d
Cylindrical fog
...
- having the world position is very nice
- mojang manages to do multiple matrix multiplications
2021-12-11 17:31:09 -08:00
Jozufozu
ebfeff0b54
Fix misaligned contraption light
...
- That was a pain to debug
- Idk how that ever worked
2021-12-11 15:06:07 -08:00
Jozufozu
79e61b44e5
1.18.1
2021-12-11 14:18:43 -08:00
Jozufozu
2207da5eed
Implemented
2021-12-10 14:50:01 -08:00
Jozufozu
21a23d650f
Mapped buffer sanity
...
- MappedBuffer no longer abstract
- Mappable interface used within MappedBuffer
- MappedBuffer is mapped before ctor
- No more subclasses, no more thin wrapping overrides
- Use try with resources for buffer mapping
- Better error handling with mapped buffers
- Unimplemented exception as a procrastination method
2021-12-10 14:45:18 -08:00
Jozufozu
fd8d436640
Worlds are bigger now pt 2
...
- Stop clamping Y in [0, 256)
2021-12-10 12:31:57 -08:00
Jozufozu
931fffb5f1
Worlds are bigger now
...
- Stop clamping Y in [0, 256)
2021-12-10 00:28:32 -08:00
Jozufozu
99e15cbcd9
Debugging changes
...
- MapBufferRange compat layer not needed, missed that
- Don't need MappedFullBuffer anymore
- Add guard for size in GPULightVolume#bind
- LightVolume#getStride not needed
- Replace usaged of GlError#poll with #pollAndThrow
- VecBufferConsumer doesn't need a format
2021-12-10 00:07:52 -08:00
Jozufozu
b892f602cb
Whoops remove imports
2021-12-09 16:40:01 -08:00
Jozufozu
5374baf241
No more material spec, everything is StructType
2021-12-09 16:34:32 -08:00
Jozufozu
eee9b3fb51
Move api package
2021-12-09 15:27:56 -08:00
Jozufozu
da55941e4f
Add RecordingVertexConsumer
...
- Very basic and untested
2021-12-09 15:19:48 -08:00
Jozufozu
7b3bab6647
Reorganize, rename, refactor, 0.4.0
...
- Move most user facing interfaces to flywheel.api package
- Refactor InstanceData to have no package private classes
- Remove 'I' prefix from many interfaces
- ILightUpdateListener -> LightListener
- IMultiProgram -> ContextAwareProgram
- IFlatLight -> FlatLit
- All materials use the same vertex format: UNLIT_MODEL
2021-12-09 00:42:27 -08:00
Jozufozu
47b110c48c
Fix shulker box rendering
2021-12-08 12:48:18 -08:00
Jozufozu
9fe0bae2ad
#tick and #beginFrame on creation
...
- Fixes weird delay in object appearance when reloading chunks
2021-12-08 12:28:22 -08:00
Jozufozu
aaaccc47ee
Add instances when chunks are built for rendering
...
- RIP ChunkIter, may you rule over the depths of hell in peace
- Fix memory leak when instance worlds get reset
- Server worlds are not flywheel worlds
- Nothing to do on world load anymore
2021-12-08 12:16:01 -08:00
Jozufozu
b4fe00a314
Fix potential nullpointer rendering breaking overlay
...
- Should backport for #52
2021-12-07 23:53:13 -08:00
Jozufozu
ef5de609a2
Groups store their types again
...
- Fix crash rendering breaking overlay
2021-12-07 23:40:45 -08:00
Jozufozu
36f32ececc
VAO state clearing handled in InstancingEngine#render
2021-12-07 23:00:32 -08:00
Jozufozu
97949ab1da
Cull legacy compat boilerplate
...
- Minecraft is on GL32 now!
2021-12-07 22:47:05 -08:00
Jozufozu
a90e6a1f56
Quick fix for create's contraptions
2021-12-07 22:45:10 -08:00
Jozufozu
fd0343c48b
Merge branch '1.17/dev' into 1.18/dev
2021-12-07 21:29:38 -08:00
Jozufozu
f7c45e5486
Get started on a batching engine
...
- An Engine is a MaterialManager and a RenderDispatcher
- Refactor InstanceManager's ctor to use the MaterialManager interface instead of the concrete type
- MaterialManagerImpl -> InstancingEngine
- Add skeleton for BatchingEngine
- Hack in InstanceWorld to switch between the 2
- Rename/move existing MaterialManager impl to new package
2021-12-06 23:36:14 -08:00
Jozufozu
ca459dd2ca
Update to 1.18
2021-12-06 21:29:21 -08:00
Jozufozu
7813eedf61
Miscellaneous gl changes while debugging
...
- Only unbind at the end of MaterialManagerImpl#render
- Add GlBufferType#bind and #unbind
- Make GlVertexArray#unbind static
2021-12-06 21:11:51 -08:00
PepperBell
621ce2b43c
Merge remote-tracking branch 'origin/1.17/dev' into 1.17/fabric/dev
...
Conflicts:
src/main/java/com/jozufozu/flywheel/Flywheel.java
src/main/java/com/jozufozu/flywheel/core/model/BlockModel.java
src/main/resources/flywheel.mixins.json
2021-12-06 17:22:55 -08:00
Jozufozu
e08633af3c
Do a 180
...
- Fix inconsistency in minecart model
2021-12-06 17:19:21 -08:00
Jozufozu
b9352bc3a4
Vanillaization
...
- IModels now accept a VertexConsumer
- IRenderState -> RenderType
- AbstractInstancer for dealing with InstanceData tidyness
- Alter crumbling renderer to match new system
- Add hack to keep track of bound atlas textures
2021-12-06 15:23:26 -08:00
PepperBell
e7ef9291c7
Merge remote-tracking branch 'origin/1.17/dev' into 1.17/fabric/dev
...
Conflicts:
build.gradle
gradle.properties
2021-12-05 18:42:30 -08:00