Commit Graph

788 Commits

Author SHA1 Message Date
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
Jozufozu
cfaf1632de Update changelog, make bug report template loader agnostic 2022-04-06 11:51:59 -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
4442759c57 Add 0.6.0 to bug report template 2022-01-25 18:01:36 -08:00
Jozufozu
5f675b1566 Create FUNDING.yml 2022-01-25 10:13:24 -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
365a15b308 Bump version - 0.6.0 2022-01-17 18:26: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