Commit Graph

76 Commits

Author SHA1 Message Date
Jozufozu
69411fb36f Uber smooth
- Add material shader component to specify smooth lighting behavior
- Allows much easier composition of smooth lighting/material shader
  effects, and potentially gives backends the option to specialize
  shaders on the complexity of shader lighting
- Pack fog, cutout, and light into a single uint
2024-07-27 15:31:08 -07:00
Jozufozu
cdc68244e7 An original thought
- Require embeddings to specify an origin coordinate on creation
2024-07-27 14:12:28 -07:00
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
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
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
Jozufozu
4546de8987 Vulcan't
- Catch exception from GlCapabilities to detect vulkanmod and similar
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
f25d66680e Wait, it's all kotlin?
- Port to kotlin gradle
2024-05-17 08:43:56 -07:00
Jozufozu
a44e7f5205 All your script are belong to us
- Port java/subproject convention plugins to kotlin binary plugin
- Fix licence bundling in jars
- Update licence year
2024-05-17 08:43:56 -07:00
Jozufozu
069679689f Shaders and ladders
- Compile with progressively lower glsl versions to test which are
  available.
- Properly returns 460 on my machine even with a gl version of 320
- Remove glsl enums below 150
2024-05-17 08:43:56 -07:00
Jozufozu
e40f50f4f7 Willing and able
- Refine capabilities checks
- To compile with glsl 150:
  - Instancing needs ARB_shader_bit_encoding
  - Indirect needs gpu_shader5 and shading_language_420pack
- Require extensions instead of just enable, probably doesn't make a
  difference since we check for their presence first but require aligns
  with our intent better
2024-05-17 08:43:56 -07:00
Jozufozu
15184b8ccd Declaration of jar
- Expose desired behaviors from platform plugin via an extension
- Move PlatformPlugin to platform package
2024-05-17 08:43:56 -07:00
Jozufozu
2072bea11b Caught linking
- Upgrade buildSrc to kotlin buildscript
- Add TransitiveSourceSet extension to abstract creating the different
  source sets and creating the configurations to apply dependencies
2024-05-17 08:43:56 -07:00
PepperCode1
29b8c3b00f Fabric client commands 2024-05-17 08:43:56 -07:00
Jozufozu
745ccfae10 Plugin play
- Convert package infos stuff to a proper plugin
- Add extension for specifying which source sets get generated package
  infos
- Move extension classes into their own files
- Move GeneratePackageInfosTask into com.jozufozu.gradle
2024-05-17 08:43:56 -07:00