Commit Graph

506 Commits

Author SHA1 Message Date
PepperCode1
1c058018b4 A Performance on the (Render)Stage
- Add RenderStage enum for better control over when a Material should be
rendered
  - Add getRenderStage method to Material
  - Replace RenderLayerEvent with RenderStageEvent
- Pass more information to RenderContext including camera and projection
matrix
- Pass RenderContext instead of Camera to all beginFrame-related methods
  - Remove RenderContext.CURRENT
- Remove FrustumMixin and CameraMixin
- Remove default BasicModelSupplier constructor
- Convert Material to interface and create SimpleMaterial implementation
- Move API instancer classes to instancer package
- Organize imports
2022-07-22 16:41:39 -07:00
Jozufozu
dca2ba7605 Small tidying
- Move RenderTypeExtension to util
 - Avoid creating unnecessary material objects in Shuklers
 - Remove vestigial classes
2022-07-19 10:59:29 -07:00
Jozufozu
0b228b9db9 Merge branch '1.18/dev' into 1.18/next
# Conflicts:
#	.github/ISSUE_TEMPLATE/bug_report.yml
#	build.gradle
#	gradle.properties
#	src/main/java/com/jozufozu/flywheel/Flywheel.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/OptifineHandler.java
#	src/main/java/com/jozufozu/flywheel/backend/instancing/AbstractInstance.java
#	src/main/java/com/jozufozu/flywheel/backend/instancing/InstanceManager.java
#	src/main/java/com/jozufozu/flywheel/backend/instancing/batching/BatchedMaterialGroup.java
#	src/main/java/com/jozufozu/flywheel/core/model/BakedModelBuilder.java
#	src/main/java/com/jozufozu/flywheel/core/model/Bufferable.java
#	src/main/java/com/jozufozu/flywheel/core/model/ModelUtil.java
#	src/main/java/com/jozufozu/flywheel/core/model/WorldModel.java
#	src/main/java/com/jozufozu/flywheel/core/model/WorldModelBuilder.java
#	src/main/java/com/jozufozu/flywheel/core/vertex/BlockVertexList.java
#	src/main/java/com/jozufozu/flywheel/core/vertex/BlockVertexListUnsafe.java
#	src/main/java/com/jozufozu/flywheel/core/vertex/PosTexNormalVertexListUnsafe.java
#	src/main/java/com/jozufozu/flywheel/mixin/FrustumMixin.java
2022-07-19 00:19:50 -07:00
Jozufozu
9c61f57f5a Too much fun with boids
- Fix tickable instances ticking while paused
 - Fix CME on effect origin shift
 - ExampleEffect is now boids fireflies
 - Better tick/update load distribution with small instance counts
2022-07-18 23:44:30 -07:00
Jozufozu
0786a3a2c5 Freestyle instances
- Add Effect instancing
   - Allows mods to create visual effects without (block) entities
   - One effect object maps to many AbstractInstances
   - Effect objects are expected to exist in isolation
 - Refactor InstanceManager to be composable about how its instances are stored
   - EffectInstanceManager uses this to provide a one to many topology
   - This is in need of more iteration, and more aspects of InstanceManager should be made composable in the future
2022-07-17 16:01:30 -05:00
PepperCode1
2323e770d2 Final fix-ups
- Revert mods.toml version to ${file.jarVersion}
- Fix license not being added to built jars
- Rename LICENCE.md to LICENSE.md
2022-07-15 19:29:42 -07:00
PepperCode1
2a715dfd5d Fix mixins sometimes not remapping
- Compress logo image
2022-07-15 09:42:14 -07:00
PepperCode1
dd18300b70 Scheme-a-version
- Fix Resources not being closed properly
- Change versioning scheme to match Create
- Add LICENSE to built jar
- Fix mods.toml version sync
- Move JOML code to non-src directory
- Update Gradle
- Organize imports
2022-07-15 00:00:54 -07:00
Jozufozu
e499bfb98a One line update
- Add modrinth updateJSONURL
2022-07-11 14:36:54 -04:00
Jozufozu
9fc5e04c9d Reading copy
- All vertex lists extend from AbstractVertexList, which handles copying the input
2022-07-11 14:08:07 -04:00
Jozufozu
883ae6ef09 World building exercise
- Yoink the WorldModelBuilder and associated changes from 1.18/next
2022-07-10 19:04:30 -04:00
Jozufozu
5f07fedf2e Oculus compatibility
- Rename OptifineHandler to ShadersModHandler
 - Rename functions to match fabric version
2022-07-10 18:08:59 -04:00
Jozufozu
175da4c521 One more thing...
- Missed a level param in LightVolume
 - Public removeAndMark
 - Remove batching warning
 - Bump forge and parchment builds
2022-07-10 15:22:02 -04:00
Jozufozu
b24818a3a3 Update light updates
- ... to address the nullpointer with create pulleys
 - LightListeners track their own levels
 - Remove BasicProvider and LightProvider
 - Rename MovingListener to better match functionality
 - Remove ListenerStatus in favor of a boolean
 - Instances keep track of their removal status and properly report it via LightListener#isListenerInvalid
 - Bump version - 0.6.4
2022-07-09 13:25:24 -04:00
Jozufozu
a471fdbafd Structless instances
- Instance shaders define their own input variables
 - Input locations are transformed during compilation based on vertex type
2022-07-09 11:32:28 -04:00
Jozufozu
7acf4a8aeb Batch 2
- Re-implement batching under new api topology
 - Lots of duplicated code between instancing and batching, room for abstraction
 - StructTypes now require their type argument to extend InstancedPart
 - Fix crash when re-allocating drawbuffers
 - Disable crumbling pending refactor
 - Separate RenderDispatcher#beginFrame from RenderDispatcher#maintainOriginCoordinate
 - Inline OriginShiftListener
 - Refactor InstancedRenderDispatcher hooks
2022-06-30 14:29:35 -07:00
Jozufozu
0178a438c1 Closing the blinds
- Prevent LightUpdater from interacting with invalid levels.
 - Bump version - 0.6.3
2022-06-22 13:29:28 -07:00
Jozufozu
fa76e3e454 Misc. tweaks
- Drastically reduce stutter on origin shift (it's still bad)
 - GPUInstancers mark their buffers as dynamic
2022-06-20 19:26:39 -07:00
Jozufozu
cdfddba35a Better draw call organization
- InstancingEngine takes over tracking individual draw calls
 - Many draw calls are associated with a single ShaderState
 - Each ShaderState will bind one shader program
 - Make Material a record
 - Inline Renderable and move InstancedModel.Layer to DrawCall
2022-06-20 12:16:37 -07:00
Jozufozu
5dd72a4ba7 A little of everything
- Rename InstanceData -> InstancedPart, and subclasses
 - Burger Fences
 - Fix GlStateTracker nuking vao element buffer bindings
 - GlVertexArray tracks element buffer bindings
 - Use vertexAttribPointer offset instead of ..BaseVertex
 - Setup code for better crumbling rendering
 - Move some logic into CoreShaderInfoMap
 - Simplify VertexWriter/VertexList
 - Prefer IEventBus#addListener to @SubscribeEvent
 - Stop using persistent buffers... for now
2022-06-19 23:25:44 -07:00
Jozufozu
907fc3d3c0 Simply struct
- Inline Instanced* and Batched* StructType
 - flw.dumpShaderSource need only be present
 - Make Backend's static fields screaming snake case
2022-06-09 13:51:50 -07:00
Jozufozu
e521bb20cf Better buffer binding
- Directly call GlBuffer#bind before raw gl calls
 - Everything else is hidden now
 - GlStateTracker.State implements AutoCloseable for try-with-resources blocks
 - Wrap InstancedModel render calls in a GlStateTracker restore block
 - Improve EBO creation
 - Track CPU memory usage (wish java had ownership concepts)
 - Misc cleanups
2022-06-09 12:44:52 -07:00
PepperCode1
3b40a0e120 Crumbling away
- Fix and improve crumbling rendering
- Rename Batched to BatchedStructType and Instanced to
InstancedStructType
- Normalize flw_vertexNormal in context/common.vert
- Add TODO and FIXME comments
2022-05-22 14:28:38 -07:00
PepperCode1
c9b5fa1ff9 Fix and simplify
- Fix #130
- Simplify Material and default FileResolution creation
- Add instancing to command block and TNT minecarts
- Add missing 440-460 GLSL versions
2022-05-20 21:14:31 -07:00
Jozufozu
c65992ec0e Cleaner compilation
- Check for errors immediately after loading shaders
   - Done through FileResolution
   - Add class SourceChecks to
 - Throw away GatherContextEvent, do everything on client init
 - Unify FileResolution and Resolver, PartialModel style
 - Pass around error reporter to detect errors during load
2022-05-17 20:22:23 -07:00
PepperCode1
a7a716b469 Shaded shader
- Rename MaterialManager -> InstancerManager and Material ->
InstancerFactory
- Create Material class consisting of RenderType and shader files
- Make ModelSuppliers use Materials as keys instead of RenderTypes
- Move diffuse calculation from context shaders to material/shaded.vert
- Merge used templates directly into compilers and remove template
classes
2022-05-15 20:09:47 -07:00
PepperCode1
15f41e7b9c Reduced to fragments
- Overhaul shader pipeline
  - Remove VertexType#getShaderHeader in favor of vertex-only "layout
shaders"
  - Remove program specs in favor of vertex-only "instance shaders"
  - Add API GLSL headers for vertex and fragment shaders that store
common values
  - Separate context shaders into vertex and fragment shader files
- Improve import handling
  - Ensure imports are not added more than once
  - Change regex for import directives to be more in line with C-style
directives
- Move some classes and GLSL files
2022-05-15 01:58:33 -07:00
PepperCode1
e280437c4c Instant legacy code
- Respect fog shape and type
  - Add uFogShape uniform
  - Add macro for current FogType
- Respect dimension constant ambient light when calculating diffuse
  - Add uConstantAmbientLight uniform
  - Redirect diffuse calculation to FLWDiffuse
  - Do not automatically include diffuse.glsl
- Fill CoreShaderInfoMap with info for vanilla and Forge core shaders
- Use try-with-resources when querying ResourceManager
- Move WorldProgram uniform uploading from bind to uploadUniforms
- Use correct layer when rendering bells (cutout -> solid)
- Update Starlight
2022-05-13 23:58:24 -07:00
PepperCode1
5697567466 Clean up
- Remove OnlyIn annotations
- Replace JSR305 Nullable and Nonnull with Jetbrains Nullable and
NotNull
- Fix indentation in flywheel.mixins.json
- Organize imports
2022-05-11 18:42:31 -07:00
Jozufozu
eb52acdaa5 Simplifications
- Inline a handful of interfaces that had limited use
 - Removed IndexedModel/VBOModel as a first step in refactoring model uploads
 - InstancedModels/GPUInstancers support multiple VAOs
 - Fix padding issue
2022-05-11 16:32:27 -07:00
Jozufozu
c94a157c97 Refactor GPUInstancer to separate behavior
- Instancer VAO logic moved to InstancedModel
 - Refactor GlVertexArray for easier debugging
 - Sort of clean up BufferLayout
 - Padding items are broken, needs fix
2022-04-30 19:42:57 -07:00
Jozufozu
ea78574869 Stuff renders again
- RenderContext doesn't need to have RenderType
 - Pass RenderTypes separately, clean up refactor
2022-04-24 17:22:22 -07:00
Jozufozu
80017b1559 Better buffering
- Abstract ModelUtil.getBufferBuilder and .getBufferBuilderFromTemplate
 - BakedModelBuilder and WorldModelBuilder as parameter objects for getBufferBuilder
 - WorldModelBuilder supports IModelData
2022-04-19 15:08:41 -07:00
Jozufozu
7cf653eda5 Material refactor pt 4
- Begin reworking layer rendering
2022-04-19 13:42:45 -07:00
Jozufozu
671ac33dda Material refactor pt 3
- Slight simplification to model allocation
 - RenderLayers are no more
 - Add basically empty RenderTypeRegistry, to be filled out as I go
 - Move content of RenderLayerEvent into RenderContext
 - BlockModels have PartialModel names now
 - Futz around with InstancingEngine's render logic
 - Fix invisibility bug caused by not unbinding vaos
2022-04-14 21:20:28 -07:00
Jozufozu
ccbce86a69 Material refactor pt 2
- Inline all the things
 - Now MaterialManager -> Material -> Instancer
 - ModelSuppliers store RenderType
 - Currently broken, it only renders chunk layers so vanilla instances are invisible
2022-04-11 15:15:39 -07:00
Jozufozu
ec92fef445 Material refactor pt 1
- User no longer needs to supply a key object to get an instancer
 - Move memoization logic outside of MaterialManager
 - Provide utility class for memoizing models
 - Vanilla instances use static objects for their models
 - PartialModels don't actually need reference states, use air instead
 - Move RenderLayer to api package
 - Kill lazy killable
2022-04-10 17:02:28 -07:00
Jozufozu
e762d69d0b Fix spooky shaded contraptions
- Logic error in GPULightVolume#move
 - Race condition from LightUpdater showing up in LightVolume#initialize
2022-04-08 17:23:02 -07:00
Jozufozu
a8de91d541 Layoff some workers
- Only one task engine for everything now
 - Fixes crash on LightUpdater init when Flywheel is off
 - Attempt to wrangle InstanceWorld init code
 - Misc. cleanup/renaming
2022-04-07 14:19:36 -07:00
Jozufozu
0c53a55104 Moving in parallel
- LightUpdates now uses task engine to update listeners in parallel
 - Basic workgroup system to run something on the main thread after a group of tasks is complete
2022-04-07 13:23:56 -07:00
Jozufozu
35f513a2a0 Contraptions were too lit
- Fix bug causing potentially moving contraptions to re-upload their light every tick
 - Reduces tick stutter with large amounts of contraptions
2022-04-07 13:23:56 -07:00
Jozufozu
c2be6a0faa Model allocators are passed on init instead of stored 2022-04-07 13:23:56 -07:00
PepperCode1
74f9e1f9a3 Update to 1.18.2
- Switch to SLF4J logging
- Bump version
- Add 0.6.1 changelog
2022-03-14 10:52:28 -07:00
PepperCode1
4097f7e0a4 Fix display test
- Improve version retrieval
- Fix extra description newline
2022-03-12 14:24:15 -08:00
PepperCode1
67b4e655de Add partial support for non-shaded quads
- Add ShadeSeparatedBufferBuilder and other code to allow separating all
non-shaded vertices to the end of the buffer
- Add ShadedVertexList to allow defining if a certain vertex is shaded
or not
- Add new methods to ModelUtil with arguments for more flexibility
- Refactor VirtualEmptyBlockGetter to allow defining arbitrary light
values
- Add shaded argument to DiffuseLightCalculator
2022-02-18 20:39:19 -08:00
Jozufozu
08b331fe18 Move diffuse declaration to vertex compiler 2022-02-14 20:45:13 -08:00
Jozufozu
f7b8aedb95 Fix occasional crash when flywheel objects are loaded in 2022-02-14 20:36:35 -08:00
Jozufozu
a4d3f17fb3 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
e1af5b2533 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
aa08ef1430 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
Jozufozu
bca5383e5a Small utility functions 2022-02-06 00:55:49 -08:00
PepperCode1
d3cffaf495 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
06d2325a7a 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
5d8a0e8e44 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
Jozufozu
5fbca293ef 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
54a5dd7e06 Add more debug info
- Flywheel version
 - Vertex/Instance count
 - Origin coordinate for Instancing Engine
2022-01-31 13:14:30 -08:00
Jozufozu
831c9b9e47 Update changelog and document Translate#nudge 2022-01-25 10:12:08 -08:00
Jozufozu
e6368b291f Initial move to client commands.
- Nothing fancy, just inlining packets.
2022-01-24 10:46:17 -08:00
Jozufozu
231e79984a Add accessor to BlockEntityRenderer map. 2022-01-18 13:44:28 -08:00
Jozufozu
60b0c7a94a Merge branch '1.18/shader-sanity' into 1.18/dev 2022-01-17 16:56:39 -08:00
Jozufozu
c37158efd6 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
c4d6ec706e 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
29d4ec03c2 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
2854e1f1dc 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
c4f07db75f More organized shader compilation 2022-01-11 13:17:55 -08:00
Jozufozu
139c95ebc1 Sodium compatibility 2022-01-10 15:08:02 -08:00
Jozufozu
0785587960 Separate vertex and fragment shaders and templates 2022-01-10 14:38:26 -08:00
Jozufozu
0b84bec4e1 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
Jozufozu
68febaec2e 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
38244deb51 GlStateTracker for better state restore
- Replaces both ShaderInstanceAccessor and BufferUploaderAccessor
2022-01-08 14:51:55 -08:00
Jozufozu
72dc4cb378 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
44d640fc47 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
0b334afaca Flatten core.shader and fix residual merge conflicts 2022-01-07 12:01:03 -08:00
Jozufozu
03c5a41cac 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
d1ee71de4e Reduce merge conflicts with shader-sanity 2022-01-07 11:50:01 -08:00
Jozufozu
c0ddc860d9 RenderLayers directly store DrawBuffers
- Inspired by pepper's BlockEntityTypeExtensions
 - Document the batching engine internals.
2022-01-06 15:25:00 -08:00
Jozufozu
eef3c7fc1c 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
f6b49fb324 Better state restore in InstancingEngine
- Attempt to fix optifine issues
 - Replace <code> with {@code}
2022-01-06 13:04:16 -08:00
Jozufozu
369157c989 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
45ae6c4d90 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
355d6aa163 Consider RenderLayer when compiling shaders
- Disabled cutout logic in other layers
2022-01-01 15:19:49 -08:00
Jozufozu
1b09c2c1eb 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
aca216cf9a 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
e9a4231d4e Write active backend to crash reports 2021-12-30 20:01:45 -08:00
Jozufozu
79952fdc42 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
c265a17f55 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
9abfad00c6 Fix crash on load when backend is off
- Closes #81
 - Disabled crashing on error poll
2021-12-28 20:39:32 -08:00
Jozufozu
b7e1aa581d Batching is not actually compatible with shaders 2021-12-28 15:26:56 -08:00
Jozufozu
b5a9741caf 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
4c4d6b77fc Fix contraption lighting
- Actually just one line.
2021-12-27 13:37:09 -08:00
Jozufozu
283195bbd0 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
dbfeeea477 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
ec6e07f59e 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
Jozufozu
e16b32e116 Track VBO and EBO via vanilla 2021-12-24 16:15:20 -08:00
Jozufozu
de6c4270b2 Repack JOML 2021-12-24 02:21:59 -08:00
Jozufozu
3ce1345d6a 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
af209f525e 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
39439d6335 Small config changes
- Make FlwCommands more readable
 - EmptyArgumentSerializer for EngineArgument
2021-12-22 22:29:52 -08:00
Jozufozu
c3bc231d0a Fix models being backwards
- Regression in ModelUtil#rotateToFace
2021-12-22 22:01:05 -08:00
Jozufozu
d78f030264 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
a1bf03689c 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
21d0db1364 GlBuffer tracks its size
- GlVertexArray#enableArrays
2021-12-22 14:39:34 -08:00
Jozufozu
1594c56df2 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
ceb09d3dfc util and core cleanup
- Consolidate/audit utility classes
 - Move more towards sane vertex types
2021-12-22 00:22:41 -08:00
Jozufozu
b0f6d07b0b 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
Jozufozu
831f990153 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
73134f2628 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
810cae681a 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
Jozufozu
78a21bf0df No need for getDirtyBitSet
- Faster and simpler to just do one loop
2021-12-17 22:41:22 -08:00
Jozufozu
54703d8c1a Use task engine/sync to update instances 2021-12-17 02:17:39 -08:00
Jozufozu
80b3c1ed35 Proper task engine
- Manual threadpool
 - More control
2021-12-17 01:03:52 -08:00
Jozufozu
3049601e4a Simplify SBB
- SBB -> ModelTransformer
 - Shader binding the minecraft way
 - Engines are responsible for ending batches
2021-12-16 23:10:24 -08:00
Jozufozu
a668a7c7ac 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
8b472f4f51 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
f1e63106fc Batching Engine
- Implement alternate backend using SBBs
2021-12-15 17:12:48 -08:00
Jozufozu
d07dbbf1a4 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
0de377d5bb Fix #extension crash on intel 2021-12-15 13:27:06 -08:00
PepperBell
07cff39a95 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
5e2235dab7 No need for InstancedMaterialRenderer
- Here's to premature abstraction
2021-12-13 21:27:15 -08:00
Jozufozu
d9bbd325ed AMD driver workaround
- Just don't pool models
2021-12-13 19:55:50 -08:00
Jozufozu
0cafa48964 Fix vanishing minecarts 2021-12-12 22:30:46 -08:00
Jozufozu
7ff0a87b17 Use GL_ARB_conservative_depth when possible
- Allows the depth test to discard fragments before the fragment shader is run
2021-12-11 22:03:52 -08:00
Jozufozu
4a86c112dd 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
5ebc592391 Fix misaligned contraption light
- That was a pain to debug
 - Idk how that ever worked
2021-12-11 15:06:07 -08:00
Jozufozu
cee1a9b0fe 1.18.1 2021-12-11 14:18:43 -08:00
Jozufozu
abeced384d Implemented 2021-12-10 14:50:01 -08:00
Jozufozu
bd58786f94 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
43289c3579 Worlds are bigger now pt 2
- Stop clamping Y in [0, 256)
2021-12-10 12:31:57 -08:00
Jozufozu
20eb73025c Worlds are bigger now
- Stop clamping Y in [0, 256)
2021-12-10 00:28:32 -08:00
Jozufozu
c0d5c32766 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
50fdf9bb59 Whoops remove imports 2021-12-09 16:40:01 -08:00
Jozufozu
a84d850299 No more material spec, everything is StructType 2021-12-09 16:34:32 -08:00
Jozufozu
f2d406a02a Move api package 2021-12-09 15:27:56 -08:00
Jozufozu
c5b53a0297 Add RecordingVertexConsumer
- Very basic and untested
2021-12-09 15:19:48 -08:00
Jozufozu
f3c57b4ae4 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
860aee28d8 Fix shulker box rendering 2021-12-08 12:48:18 -08:00
Jozufozu
e575b1c580 #tick and #beginFrame on creation
- Fixes weird delay in object appearance when reloading chunks
2021-12-08 12:28:22 -08:00
Jozufozu
008c6c1e3f 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
9347fb76a4 Fix potential nullpointer rendering breaking overlay
- Should backport for #52
2021-12-07 23:53:13 -08:00
Jozufozu
c20b0142e9 Groups store their types again
- Fix crash rendering breaking overlay
2021-12-07 23:40:45 -08:00
Jozufozu
8669d68af3 VAO state clearing handled in InstancingEngine#render 2021-12-07 23:00:32 -08:00
Jozufozu
89c96aa026 Cull legacy compat boilerplate
- Minecraft is on GL32 now!
2021-12-07 22:47:05 -08:00
Jozufozu
fef41658d0 Quick fix for create's contraptions 2021-12-07 22:45:10 -08:00
Jozufozu
c85effe6ea Merge branch '1.17/dev' into 1.18/dev 2021-12-07 21:29:38 -08:00
Jozufozu
cfea89a371 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
46cbd76fb6 Update to 1.18 2021-12-06 21:29:21 -08:00
Jozufozu
d179a68769 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
Jozufozu
3a4fb0e43d Do a 180
- Fix inconsistency in minecart model
2021-12-06 17:19:21 -08:00
Jozufozu
79fe04c6ab 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
Jozufozu
4d795d257a No more InstanceData#write 2021-12-02 20:13:55 -08:00
Jozufozu
241c50291d Yeet json extensions that idea doesn't make sense
- Was only ever used for fog
 - Was the same for every material
 - Made things unnecessarily complex
 - Fix fog
 - Convert ProgramState to record
2021-12-02 17:40:23 -08:00
Jozufozu
bdcf034f7f Shadows causing trouble? No more shadows 2021-11-27 11:30:38 -08:00
PepperBell
b1f34389b7 Improve StitchedSprite functionality
- Make StitchedSprite work like PartialModel
- Allow StitchedSprite instances to be created directly
- Allow StitchSprites to be created for any atlas
- Use texture stitch post event instead of lazy computation for filling
StitchedSprites
- Remove legacy method from AngleHelper
- Change artifact name from flywheel to flywheel-forge
- Organize imports
2021-11-24 18:43:05 -08:00
Jozufozu
b762b1a7d3 Merge remote-tracking branch 'origin/1.16/dev' into 1.17/dev
# Conflicts:
#	changelog.txt
#	gradle.properties
#	src/main/java/com/jozufozu/flywheel/backend/instancing/InstancedRenderDispatcher.java
#	src/main/java/com/jozufozu/flywheel/config/BooleanConfig.java
#	src/main/java/com/jozufozu/flywheel/config/SConfigureBooleanPacket.java
#	src/main/java/com/jozufozu/flywheel/event/ForgeEvents.java
#	src/main/java/com/jozufozu/flywheel/mixin/RenderHooksMixin.java
#	src/main/java/com/jozufozu/flywheel/util/WorldAttached.java
#	src/main/resources/flywheel.mixins.json
2021-11-23 16:49:39 -08:00
Jozufozu
16f43867b6 Implement TransformStack directly on PoseStack
- Add helper method to cast to the interface.
2021-11-23 15:07:31 -08:00
Jozufozu
37eece8756 Split TransformStack interface
- Now individual components Translate Rotate and Scale
 - Internal change to ModelData, store matrices directly
 - Implement Translate Rotate and Scale for ModelData
 - Implement Translate and Rotate for OrientedData
 - Clean usages of ModelData to use new api when possible
 - WriteSafe and WriteUnsafe for matrices
2021-11-22 18:05:53 -08:00
PepperBell
279e0893c6 Server crash fix and formatting
- Fix matrix mixins being applied on dedicated server
- Expand PartialModel functionality: add location getter and model
setter
- Remove Loader.getResourceType since selective reloading is deprecated
- Organize imports and mixin order
- Other formatting
- Update Gradle and Forge
2021-11-18 14:59:39 -08:00
Jozufozu
3919aaeead TextureBinder for dealing with vanilla RenderTypes 2021-11-09 16:48:54 -08:00
Jozufozu
ecb3fd1540 Instance init
- So that simi can have his cogs.
 - Inheritance is painful when models are acquired in an instance's ctor
2021-11-09 15:03:52 -08:00
Jozufozu
1233c95edb Chipping away at light 2021-11-09 14:59:31 -08:00
Jozufozu
7b5b8cca2a Named models 2021-11-08 20:48:02 -08:00
Jozufozu
18f5561f9a Invalidate regardless 2021-11-05 16:47:27 -07:00
Jozufozu
0c94188613 Revert "Weak hash map in world attached"
This reverts commit 98a3f759b3.
2021-11-05 16:45:39 -07:00
Jozufozu
42522ffc27 Weak hash map in world attached
- More robust solution that listening to WorldEvent.Unload
2021-10-31 19:54:12 -07:00
Jozufozu
ba3ef05aa4 Fix world leak 2021-10-31 19:50:01 -07:00
Jozufozu
bf2525cb2e Remove chunk provider mixin and refactor config packets 2021-10-31 17:24:57 -07:00
Jozufozu
d9bfe82a22 Compat work
- No more net.minecraftforge.common.util usages
 - Replace forge lazy with flywheel lazy
 - Replace forge NonNullSupplier with flywheel NonNullSupplier
 - texture2D -> texture
2021-10-12 12:52:02 -07:00
Jozufozu
59ea700b04 Revert "Rename/refactor many interfaces"
This reverts commit 66aa987dbd.

Can re-think the names later.
2021-09-30 13:43:09 -07:00
Jozufozu
18ed201c93 Rename/refactor many interfaces
- Drop I prefix
 - Inline IMultiProgram
 - Remove unused method in InstanceRendered
2021-09-28 17:54:47 -07:00
Jozufozu
39ce96ec9c Better Block Entity filtering
- Assumes IInstanceRendered#shouldRenderNormally does not change over a BE's life
2021-09-26 22:30:11 -07:00
Jozufozu
79ac9e96e4 Testing + fixing 2021-09-26 21:15:02 -07:00
Jozufozu
7c5e02d2e8 UNTESTED - Replace ATs
- Matrices use #store
 - Accessor for pausedPartialTick
2021-09-26 19:40:53 -07:00
Jozufozu
532e7450e9 GL32 shaders and errors
- Update shaders to glsl 150
 - Objectfy errors
2021-09-20 19:27:04 -07:00
Jozufozu
c504496728 Small things
- Fix minecarts rendering really far away
 - InstanceManager#getInstance now has one job
 - Instance creation moved to InstanceManager#addInternal
 - TransformStack#translateBack for Vec3i
2021-09-17 15:59:20 -07:00
Jozufozu
ca554f5993 F3+A
- Reloading chunks correctly reloads block entity instances
2021-09-17 14:20:35 -07:00
Jozufozu
0c6a75ade5 Always use discard 2021-09-16 20:53:35 -07:00
Jozufozu
7da64cded6 It renders stuff
- The lightmap moved
 - Begin to move away from access transformers
 - .textureManager -> .getTextureManager()
 - RIP cutout, saw that coming
2021-09-16 20:03:45 -07:00
Jozufozu
9976de110d Don't crash when block entities are placed
- Block entities got a huge refactor in 1.17, a lot of the old code needs to be rethought
2021-09-15 14:29:58 -07:00
Jozufozu
d67362cacd Minecraft already stores the projection matrix
mixins--
2021-09-15 14:27:51 -07:00
Jozufozu
d023b27ae8 It launches
- yeet the fog
 - update mixin compatibility level
2021-09-15 13:49:18 -07:00
0b2101c25d Fix obvious errors 2021-09-15 09:26:51 +02:00
2fc54ffbee Remap, update forge, minecraft and java 2021-09-15 09:14:30 +02:00
Jozufozu
0ed59a69ed fixup! Initial data/struct format refactor 2021-09-14 13:52:52 -07:00
Jozufozu
56cb4be580 Revert "Parallel light updates"
Caused a crash, likely related to the use of weak references

This reverts commit c68b2bbf91.
2021-09-14 13:19:52 -07:00
Jozufozu
cc5949a4bb LightPacking utility class 2021-09-14 13:17:13 -07:00
Jozufozu
555cc2e57e Initial data/struct format refactor
- Inspired by jellysquid3's vertex sinks
 - More robust/extensible solution for data writes
2021-09-12 14:49:00 -07:00
Jozufozu
c79084ce57 Parallel light updates 2021-09-12 10:29:29 -07:00
Jozufozu
2ed8c6e2e5 Optimize imports 2021-09-12 09:41:45 -07:00
Jozufozu
aa83cd5c60 Instancer interface
- Entire material/model system finally cleaned up
2021-09-12 09:40:36 -07:00
Jozufozu
b706936be1 Fix compat with optifine shaders, again 2021-09-09 15:30:50 -07:00
Jozufozu
98823e3cf1 Fix BeginFrameEvent not firing with sodium installed
- Rendering is still broken, that fix must come from within sodium
2021-09-09 14:07:35 -07:00
Jozufozu
7e65eaa00d Separate LightVolume and GPULightVolume
- LightVolumes now can act as a light cache with configurable size
 - More GridAlignedBB changes
 - Remove ILightUpdateListeners
 - Simplify pulley rendering using LightVolume
2021-09-08 15:48:49 -07:00
Jozufozu
1f7af0d8b2 Immutable view of GridAlignedBB 2021-09-04 19:57:32 -07:00
Jozufozu
c055873bac Moving light updates
- Better system for moving objects that want to receive light updates
 - LightProvider interface to better abstract light lookups
 - All light listeners use GridAlignedBBs
 - More utility in GridAlignedBB
2021-09-04 16:40:40 -07:00
Jozufozu
352608c2ae Light update convergence
- Move light update logic for all instances to use LightUpdater
 - Begin refactor of LightUpdater to account for moving listeners
2021-08-29 14:40:46 -07:00
Jozufozu
1be7d9a286 Merge branch 'dev' into next 2021-08-25 13:21:42 -07:00
Jozufozu
ae6d953c6b Restore single paramater scale function
- Now has default impl in TransformStack
 - MatrixTransformStack now only overrides xyz scale
2021-08-25 13:15:29 -07:00
Jozufozu
86dbed66af Instanced Minecarts
- Rotations in PartBuilder
 - BlockModels are always UNLIT_MODEL format
2021-08-25 12:53:43 -07:00
MehVahdJukaar
0b2e8834d8 Update TransformStack.java 2021-08-25 21:49:06 +02:00
MehVahdJukaar
e6c67fecc7 Update MatrixTransformStack.java 2021-08-25 21:40:35 +02:00
MehVahdJukaar
e541b6d449 Added 3 parameter scaling function
Simply adds a 3 parameter function to to MatrixTransformStack so a matrix can be scaled on different axis
2021-08-25 20:21:33 +02:00
Jozufozu
68ca281ee8 Interfaces and less log lines
- MateralManager, MaterialGroup, and InstanceMaterial are all interfaces
 - Separate (T)EI facing API from implementation
 - Comment out debug log in ModelPool
2021-08-23 22:34:27 -07:00
Jozufozu
d431318022 Errors and pools
- GlException and error checking WIP
 - Put all models within a material in a ModelPool
 - Instancers directly accept IModels
 - ModelPools are very WIP
2021-08-20 15:05:41 -07:00
Jozufozu
d41acf2bcf Storage clean-up
- Wrapper for sync objects
 - Compat layer for buffer storage
 - Don't get persistent buffers if they're not supported
2021-08-14 15:57:52 -07:00
Jozufozu
f82b9d2d23 Persistent buffers v1.5
- Add new sync function to GlBuffer
2021-08-14 13:33:17 -07:00
Jozufozu
5956fbfaa0 Merge branch 'dev' into shader-pipeline 2021-08-13 16:15:28 -07:00
Jozufozu
6374d6e369 Persistent buffers v1 2021-08-13 16:15:20 -07:00
Jozufozu
55537fb2af Better float array buffering 2021-08-13 13:35:18 -07:00
Jozufozu
550f567190 Random utilities from a messy workspace
- More documentation/clean up some old docs
 - isFirstLoad check on GatherContextEvent
 - Instancers no longer crash on empty model
 - setIdentity on MatrixTransformStack
 - more utilities for TransformStack
 - ModelData "nullification"
2021-08-13 11:23:09 -07:00
Jozufozu
9ac7a79d69 Final loader and temporary ShaderSources 2021-08-10 17:39:11 -07:00
Jozufozu
8f13097a40 Some decoupling
- New Loader class in charge of loading and compiling everything
 - ShaderSources now only loads sources
 - ShaderSources is immutable now
 - Resolver singleton in charge of managing name resolutions
 - ProgramSpecs go through Resolver
 - WorldShaderPipeline no longer needs reference to ShaderSources
2021-08-10 15:20:51 -07:00
Jozufozu
82ea5b1720 A heck of a lot
- Reorganize everything
 - Isolate SourceFile related things
 - Should consider decoupling ShaderLoader from resource loading
 - Document a lot of newer things
 - Index functions
 - Awkward WorldContext builder
 - Template responsible for providing shader inputs
 - Template is now an abstract class
 - Template provides GLSL version
 - ProgramSpecs now only accept one file
2021-08-10 02:06:22 -07:00
Jozufozu
3c24abe837 Reload
- Redo shader loading
 - Now loads an immutable SourceFile containing some metadata
 - Replace legacy compilation pipeline with improved new one using new api
 - Builtins are defined in one file, now "header"
 - New ErrorReporter/ErrorBuilder methods
 - Fancier shader loading errors
2021-08-08 22:33:32 -07:00
Jozufozu
a417b2944c Merge branch 'dev' into shader-pipeline 2021-08-08 17:07:33 -07:00
Jozufozu
ef512d8cf9 Almost there
- WorldContext sort of uses a shader pipeline interface
 - Smarter import resolution
 - Reorganize shader sources
 - Rewritten shader templating
 - Still need builtin support
2021-08-07 01:00:32 -07:00
Jozufozu
a9ae8ca68e More LightVolume guards
- Should fix odd crash
2021-08-06 12:55:56 -07:00
Jozufozu
935f8efc00 Merge branch 'dev' into shader-pipeline 2021-08-06 11:45:39 -07:00
Jozufozu
b266e6014c Whoops remove that import 2021-08-05 15:05:47 -07:00
Jozufozu
344ea74cab Event adjustments to work with optifine shadows 2021-08-05 14:53:22 -07:00
Jozufozu
c2d110e38f More steps towards actually using the new loader 2021-08-05 12:16:17 -07:00
Jozufozu
7bb38afda9 Merge branch 'dev' into shader-pipeline 2021-08-05 00:53:29 -07:00
Jozufozu
0e7a61cfcc Fix #23
- Clamp update divisor
2021-08-04 20:50:37 -07:00
Jozufozu
60c85ec4f6 Fix nullpointer in ModelRenderer
- Somehow managed to only do a check in a subclass
 - Add #empty() helper method to IModel
2021-08-04 14:35:16 -07:00
Jozufozu
e3b1172925 Miscellaneous documentation 2021-08-04 14:35:15 -07:00
Jozufozu
613640df52 Simplify synchronization
- Use `synchronized` on the queue sets in favor of explicit locks.
 - Updates and additions work the same now
 - Move updates processing to separate function
2021-08-03 02:06:41 -07:00
Jordan Ramsay
bf27108b18 Patch to stop the java.util.ConcurrentModificationException. 2021-08-03 16:52:00 +10:00
Jozufozu
94c5b4455d Switch to MIT Licence 2021-08-02 20:07:49 -07:00
Jozufozu
d21f2c73ee Wrong display value for chunk caching command 2021-08-02 14:22:21 -07:00
Jozufozu
7f4399c768 Fix chunk caching race condition add toggle
- /flywheel chunkCaching on|off
 - synchronized ftw
2021-08-02 00:06:26 -07:00
Jozufozu
5f7093fa0e Update changelog and remove dead QuaternionTransformStack.java 2021-07-30 14:34:04 -07:00
Jozufozu
e20612cd30 Fix issue with missing banner pattern textures
Fixes #12

What the heck

CrumblingRenderer gets classloaded early because of its event listener.

CrumblingRenderer had an innocent static reference to a member of ModelBakery.

This caused ModelBakery to classload before additional enums could be injected into BannerPattern.

¯\_(ツ)_/¯
2021-07-29 18:50:47 -07:00
Jozufozu
b47bd45510 Model changes
- Buffered models directly consume IModels
 - Document IModel more
 - Move contraption world render spoofing to flywheel
 - Miscellaneous new RenderMaths
 - Added WorldModel, renders many blocks given a world instance
 - Fix broken transparency on contraptions when using Flywheel
2021-07-29 01:37:47 -07:00
Jozufozu
21269e9dd5 Expose ClippingHelper in BeginFrameEvent 2021-07-28 18:13:47 -07:00
Jozufozu
eded055be8 More info in RenderLayerEvent 2021-07-28 14:18:24 -07:00
Jozufozu
7f58d51017 Documentation and organization
- Add a package-info.java to many packages.
 - Annotate the world parameter in Backend#canUseInstancing as nullable.
 - New utility constructor for BlockModel
 - Note that IDynamicInstance#beginFrame and ITickableInstance#tick are run in parallel.
 - Refactor internals of InstancedRenderDispatcher to group things by InstanceWorlds.
 - InstanceWorlds take over most responsibility for dispatching calls.
 - Simplify massive private call chains in InstanceMaterial.
 - Reorganize methods and add some documentation in MaterialManager, MaterialGroup, InstanceMaterial, and Instancer.
 - Remove unused field from MaterialSpec.
 - Remove unused fields from Instancer and InstanceMaterial
 - Document RenderLayer
 - Add RenderLayer field to RenderLayerEvent
2021-07-27 17:31:58 -07:00
Jozufozu
88241c2a58 Merge branch 'dev' into shader-pipeline
# Conflicts:
#	src/main/java/com/jozufozu/flywheel/backend/ShaderSources.java
2021-07-26 21:58:53 -07:00
Jozufozu
e4bf7f715f Update LightVolume to use enum wrapper for glActiveTexture 2021-07-26 16:18:38 -07:00
Jozufozu
6786e11795 Consistent naming for normal debug mode 2021-07-26 13:42:38 -07:00
Jozufozu
0cdb0c1ff3 Optimize imports 2021-07-23 23:46:30 -07:00
Jozufozu
fd96df1abe MaterialManager and MaterialGroup refactor
- Material manager builder
 - No more overload render method/IProgramCallback
 - MaterialRenderers accept a Program consumer instead
2021-07-23 23:45:31 -07:00
Jozufozu
38418b2f91 Update forge
- but not to 36.2.0 because gradle hates me
2021-07-23 16:45:38 -07:00
Jozufozu
721b3b8633 Basic model abstraction
- Stop providing a buffered model supplier
 - Instead, provide an IModel supplier
 - IModel exposes basic properties of models
 - IModel exposes a method to copy the model to a VecBuffer
2021-07-23 12:26:32 -07:00
Jozufozu
7ad7512e7e Merge branch 'dev' into vanilla-opt
# Conflicts:
#	src/main/java/com/jozufozu/flywheel/backend/instancing/Instancer.java
2021-07-22 14:09:28 -07:00
Jozufozu
1ca23c514f Instance stealing 2021-07-22 14:07:02 -07:00
Jozufozu
418676a0f0 MaterialGroups and massive refactors
- Move material stuff to its own package
 - The various render functions in the material tree now bind to specific render layers
 - Instancers can choose which layer to use
 - The layers are SOLID, CUTOUT, and TRANSPARENT
 - More layers are likely unnecessary, but we'll see
 - Deprecate functions in MaterialManager in favor of more builderesque ones using MaterialGroups
2021-07-21 20:28:20 -07:00
Jozufozu
fe836645aa Instancers like suppliers
- Instancers accept model suppliers instead of models directly
 - gpu resource allocation is deferred until render time
2021-07-19 15:45:00 -07:00
Jozufozu
90173360f4 Prime update divisors
- Smooths out load when ticking too many instances
2021-07-18 18:21:30 -07:00
Jozufozu
e5db27379e Parallel and caching
- NEEDS MORE TESTING
 - Tick and update instances in parallel
 - Mixin to cache chunk lookups
2021-07-18 18:00:09 -07:00
Jozufozu
0d474d0d04 Instanced Shulker boxes
- Preliminary concept of RenderStates
 - Vanilla has this too but it's bloated
2021-07-18 15:05:12 -07:00
Jozufozu
04b906d06f Utilities created during an attempt at signs
- Cuboids can be inverted across Y and Z
 - TransformStack scaling
 - VecBuffer coloring
2021-07-17 17:06:49 -07:00