Commit Graph

770 Commits

Author SHA1 Message Date
Jozufozu
b8f6bf841d Biased towards artistic control
- Extend InstancerProvider to allow visuals to bias the render order of
  their instancers
- Keep the old InstancerProvider#instancer method with a bias of 0
- Add an explanation of render order in InstancerProvider
2024-07-26 16:32:05 -07:00
PepperCode1
eb2ba12a98
Formalize most public API (#253)
* Start on general API formalization

* More API improvements

- Add Engine#onLightUpdate; remove LightUpdateHolder and backend/ClientChunkCacheMixin
- Add Effect#level
- Add VisualizationHelper#queueAdd and #queueRemove for Effects
- Fix PartialModel not assigning bakedModel field when populating on init
- Fix PartialModel.ALL using weak keys instead of weak values
- Make Simple*Visualizer and corresponding inner Builder classes final
- Restore FlatLit#light overload that accepts block and sky light values separately
- Add AbstractBlockEntityVisual#relight overloads that accept Iterator and Iterable
- Reorganize classes in impl.vizualization

* TaskExecutor simplification

- Move TaskExecutor#sync* methods to TaskExecutorImpl
- Move Flag and RaisePlan to impl
- Remove TaskExecutor#scheduleForMainThread and #isMainThread methods
- Remove SyncedPlan
- Add Engine#setupRender
- Remove TaskExecutor parameters from Engine#render* methods
- Convert Engine$CrumblingBlock into an interface
- Unmark RenderContext as NonExtendable to allow fulfilling the purpose described in the doc of VisualizationManager#renderDispatcher

* Remove registry freeze callbacks

- Lazily initialize MaterialShaderIndices
- Rename MaterialShaders#*Shader to #*Source
- Move BackendImplemented to api.backend package
2024-07-26 14:21:35 -06:00
Jozufozu
cc0ad90242 Lit on init
- Automatically call updateLight upon visual creation
2024-07-19 12:50:08 -07:00
PepperCode1
fe0eacad8e Light clean up
- Ensure section set returned by SectionTracker is Unmodifiable to avoid copy in LightUpdatedVisualStorage
- Do not recompute section set in ShaderLightVisualStorage if not dirty
- Fix BlockEntityStorage not clearing posLookup on recreation or invalidation
- Fix Storage.invalidate not clearing everything
- Inline TopLevelEmbeddedEnvironment and NestedEmbeddedEnvironment into AbstractEmbeddedEnvironment and rename to EmbeddedEnvironment
- Move some classes between packages
- Remove unused fields in EmbeddingUniforms
- Remove suffix on field names in BufferBindings
- Rename enqueueLightUpdateSection methods to onLightUpdate
- Rename SectionCollectorImpl to SectionTracker
- Rename classes, methods, fields, and parameters and edit javadoc and comments to match previously done renames, new renames, and other existing classes
2024-07-15 15:15:34 -07:00
Jozufozu
1ea94a859e The name game
- Rename the light visuals to have distinct names
- Rename SectionProperty -> SectionCollector because it isn't really a
  property
2024-07-15 15:15:34 -07:00
Jozufozu
caa02f2666 Lighter tracking
- Deduplicate section tracking logic between Lit and SmoothLit
- Now there is one SectionPropertyImpl which the 2 storages add
  listeners to
2024-07-15 15:15:34 -07:00
Jozufozu
c4c4d45b0b Sunset box
- Unused in flywheel and not a productive utility for others with the
  new features
2024-07-15 15:15:34 -07:00
Jozufozu
0c5995bad8 It's not a phase!
- Optimize collecting light section edges
- Kinda an absurd amount of code, but I'm not sure how to parameterize
  by an axis without having capturing lambdas
- Around 3-4x faster
2024-07-15 15:15:34 -07:00
Jozufozu
2cced88749 Lazy as can be
- Only push light sections to the engine when the set of sections
  requested by visuals changes
- Clean up light storage plan and comment code
- Remove LIGHT_VOLUME debug mode as it's no longer used
2024-07-15 15:15:34 -07:00
Jozufozu
2837762cbf SmoothLit joins the battle
- Not attached to the name
- Add SmoothLitVisual opt in interface, allowing any visuals to
  contribute light sections to the arena
- Remove lightChunks from VisualEmbedding, it has been usurped
- Pass total collected light sections from BEs, Es, and effects to the
  engine interface. It seemed the most proper way to hand off
  information from the impl to the backend
- Add SmoothLitVisualStorage to maintain the set of collected sections,
  though at the moment it is very naive and simply unions everything
  upon request, which is also naively done every frame
2024-07-15 15:15:34 -07:00
Jozufozu
b9a51d0e5f Smoothest operator
- Implement RogueLogix's normal-dependent smooth lighting function
- Uses a lot of fetches, so I imagine occupancy is kinda bad
2024-07-15 15:15:34 -07:00
Jozufozu
ef2bb09fcd Literally unusable
- Trim out dead light code from *EmbeddedEnvironment
- Fix indirect never deleting empty culling groups
- Fix embedded transforms not being applied
2024-07-15 15:15:34 -07:00
Jozufozu
b7c8604898 Light in the shade
- Expose light in the shader api
  - flw_light - for builtin smooth lighting, faster than can be
    implemented by materials alone
  - flw_lightFetch - for materials that want to go crazy, access to raw
    data
2024-07-15 15:15:34 -07:00
Jozufozu
495c047968 Lighting, for instance
- Sideport light lut stuffs to instancing engine
- Move actual lookup logic to light_lut.glsl, and have backend mains
  provide functions to index the backing storages for sanity's sake
- Standardize naming of lut and sections
- Pull in pepper's loom fix, so I can build :lwe:
- Allow specifying the internal format of texture buffers so light can
  be a simple uint array
2024-07-15 15:15:34 -07:00
Jozufozu
253de1f343 Lightly observed
- Pass light updates to LightStorage so that we don't have to re-upload
  every tracked section every frame
- Slightly optimize light section writing, still room for improvement
- Remove dead code in LightStorage
2024-07-15 15:15:34 -07:00
Jozufozu
b34d0f1c15 Cornered again
- Fix light being fetched from a section adjacent to the block a
  fragment actually resides in
- Fix light always being missing
2024-07-15 15:15:34 -07:00
Jozufozu
2a0694ccaf Missing section misdirection
- Avoid adding all sections every frame
- Remove sections when they are no longer needed
- Rebuild the lut when sections are removed
- Properly detect missing sections by writing 1-based indices to the lut
2024-07-15 15:15:34 -07:00
Jozufozu
cf2c11a37c Get lerped
- Use naive trilinear interpolation when fetching embedded light
2024-07-15 15:15:34 -07:00
Jozufozu
6cd30b8164 Pixel perfect
- Do embedded lighting in the fragment shader
- Fix light coord being saturated
2024-07-15 15:15:34 -07:00
Jozufozu
51224d618f Indirectly lit
- "Functional" arena based lighting for indirect
- Strip out most of the reference counting stuffs for embeddings
- Naively re-buffer all tracked light sections every frame
2024-07-15 15:15:34 -07:00
Jozufozu
e10852fe7a Little light lut
- Commit entire chunks of light at a time
- Share all light data between embeddings
2024-07-15 15:15:34 -07:00
PepperCode1
4e8dcb0248 Move Intel MDI workaround to GlCompat 2024-07-15 16:13:24 -06:00
Jozufozu
b2483def1d Revert "Listless no longer"
This reverts commit 22383fd5
2024-07-05 13:49:39 -07:00
PepperCode1
06a2788f9c Implicitly initiated
- Pass partial tick to visualizers and Effect#visualize
- Pass partial tick to LitVisual#updateLight
- Remove Visual#init
- Rename LitVisual#initLightSectionNotifier to setLightSectionNotifier
- Add static utility methods to FlatLit
- Remove relight methods from AbstractVisual and add specialized relight methods to AbstractBlockEntityVisual and AbstractEntityVisual to match how vanilla retrieves lightmaps
- Rename AtomicBitset to AtomicBitSet
2024-07-01 13:16:27 -07:00
PepperCode1
6017228f4a Add ExtraMemoryOps lib class
- Rename some fields and methods in ColoredLitInstance and FlatLit
2024-06-29 19:15:00 -07:00
Jozufozu
22383fd51e Listless no longer
- Visualizers return a list of visuals instead of just one
- Simple*Visualizer's builders still only allow one visual per object,
  I'm not sure how best to expose adding multiple in a way that allows
  other mods to extend existing visualizers
2024-06-29 13:57:41 -07:00
PepperCode1
ee3958b140 Remove VertexViewProvider and VertexViewProvider registry 2024-05-30 17:30:39 -07:00
PepperCode1
c880cdc2a7 Fix MeshEmitter not restarting builder after emitting 2024-05-27 16:10:57 -07:00
Jozufozu
9593126d6e Build sources are engine room too
- Update buildSrc to use engine_room package
- Publish artifacts under engine_room
- Specify group in gradle.properties
2024-05-25 12:08:52 -07:00
Jozufozu
a69389c175 Ctrl Shift R
- Bulk replace com.jozufozu.flywheel with dev.engine_room.flywheel
- Optimize imports
2024-05-25 12:08:50 -07:00
Jozufozu
6e710049a5 Moving house
- Move all files without touching package names in-code
2024-05-25 12:08:01 -07:00
Jozufozu
18b6490220 FLW citation
- Include common source in platform api jars
2024-05-20 22:10:13 -07:00
Jozufozu
1e81903494 Now you have been promoted
- Move VisualizationHelper into lib
2024-05-20 20:59:20 -07:00
Jozufozu
e19cc337fe A ticking time bomb
- Add context object back to SimpleTickableVisual#tick
- Document base *Visual plan methods
2024-05-18 17:34:45 -07:00
PepperCode1
7ef9ce3907 Fix mesh order of models from model builders
Meshes are now always sorted by chunk layer first, then in order of how the BakedModel returned quads. This should exactly match vanilla's chunk buffering and avoid any rendering issues.
2024-05-17 08:43:56 -07:00
PepperCode1
914ce0a7de Fix registry freeze timing
- Move registry freezing to right before start of initial resource reload
- Also warn if Fabric config JSON is not an object
- Move Flywheel.java to API
- Remove Flywheel.LOGGER and others; add impl-specific and backend-specific loggers
- Remove unused mixins
- Organize imports
2024-05-17 08:43:56 -07:00
Kneelawk
6dff488f8c Use better method for telling loom to remap api artifacts
This reverts commit c5a6fe98c2.
2024-05-17 08:43:56 -07:00
Kneelawk
9c0f0e94f7 Fix api artifacts getting remapped by consumers 2024-05-17 08:43:56 -07:00
Kneelawk
6719cbd431 Upgrade gradle-wrapper action 2024-05-17 08:43:56 -07:00
Kneelawk
9e73ad3e33 Fix upload-artifacts path 2024-05-17 08:43:56 -07:00
Kneelawk
a3093a8c63 Update CI 2024-05-17 08:43:56 -07:00
Jozufozu
b04fc0666c Burning books
- Remove changelog.txt
- Remove old gradle properties
- Update readme but nothing comprehensive
2024-05-17 08:43:56 -07:00
Jozufozu
4546de8987 Vulcan't
- Catch exception from GlCapabilities to detect vulkanmod and similar
2024-05-17 08:43:56 -07:00
Jozufozu
b95201f001 JSON Fabrication
- Add rudimentary JSON parsing to load a config on fabric
- Save the config file after a config command changes
2024-05-17 08:43:56 -07:00
Jozufozu
18676599a2 Extending clarity
- Use immutable lists for backend extensions
- Copy the contents of indirect base extensions into compute extensions
- Move uniform block binding to Uniforms class and make magic strings
  static final
2024-05-17 08:43:56 -07:00
Jozufozu
77833a5b01 Aven-jars assemble
- Create separate remap tasks for the common mojmap api to get loom to
  populate its manifest file
- Add helper method to fork a JarTaskSet and generate new remap tasks
- Remove non-remap publish method
- Set assemble to depend on published jar tasks again
- Add companion methods to create individual jar tasks
2024-05-17 08:43:56 -07:00
Jozufozu
4c706f23e6 Less is more
- Merge package-infos, jar-sets, and transitive-source-sets plugins
- Move publishing logic into JarTaskSet
- Do not eagerly add all jarsets to assemble
  - Significantly reduces build times
- Add separate helper method for creating outgoing jarsets
2024-05-17 08:43:56 -07:00
Jozufozu
3f24efba8a Final warning
- Address warnings generated by javadocs and mixin remaps for joml
2024-05-17 08:43:56 -07:00
Jozufozu
4094093825 Overextending
- Use cool kotlin dsl extension methods in plugins where possible
2024-05-17 08:43:56 -07:00
Jozufozu
f25d66680e Wait, it's all kotlin?
- Port to kotlin gradle
2024-05-17 08:43:56 -07:00