Commit Graph

100 Commits

Author SHA1 Message Date
IThundxr
4e1a4b6490
fix jittery visual animations 2024-08-16 22:54:01 -04:00
IThundxr
44f045b961
Fix lighting 2024-08-15 17:51:25 -04:00
IThundxr
5313585f3e
update neoforge & fix mixins 2024-08-11 10:05:39 -04:00
IThundxr
f2c0b79085
uncomment the comments
"i commented out the particle stuff for testing something
 uh you can revert that" -IMS
2024-08-10 10:32:46 -04:00
IThundxr
475b1d8d7d
fix view -IMS 2024-08-10 10:31:20 -04:00
IThundxr
68393d11bb
fix(mixins): broken LevelRenderer injector 2024-07-29 19:19:58 -04:00
IThundxr
b55afc9b72
Merge remote-tracking branch 'refs/remotes/upstream/1.20/dev' into feat/multi-loader-1.21 2024-07-28 19:00:44 -04:00
Jozufozu
601b70704a Solidly lit
- Upload a bitset for each section indicating if blocks are solid
- When interpolating light, count the number of transparent blocks and
  divide to avoid the incorrect "AO" effect near the ground
2024-07-28 15:57:05 -07:00
Jozufozu
8dce80ba61 The origin of all your problems
- Expose an ivec3 flw_renderOrigin in the shader api
- Internally add flw_renderOrigin in flw_light(*)
- flw_lightFetch expects an actual world position still
2024-07-28 13:16:50 -07:00
IThundxr
44c2f78458
merge: post merge fixes & porting 2024-07-27 22:03:46 -04:00
IThundxr
5e642245b7
Merge remote-tracking branch 'refs/remotes/upstream/1.20/dev' into feat/multi-loader-1.21
# Conflicts:
#	common/src/lib/java/dev/engine_room/flywheel/lib/material/Materials.java
#	common/src/lib/java/dev/engine_room/flywheel/lib/model/baked/MeshHelper.java
#	common/src/lib/java/dev/engine_room/flywheel/lib/visual/component/ShadowComponent.java
#	common/src/main/java/dev/engine_room/flywheel/impl/mixin/LevelRendererMixin.java
#	common/src/main/java/dev/engine_room/flywheel/impl/mixin/visualmanage/SectionCompilerMixin.java
#	forge/src/api/java/dev/engine_room/flywheel/api/event/BeginFrameEvent.java
#	forge/src/api/java/dev/engine_room/flywheel/api/event/RenderStageEvent.java
#	forge/src/lib/java/dev/engine_room/flywheel/lib/model/baked/PartialModelEventHandler.java
#	forge/src/main/java/dev/engine_room/flywheel/impl/FlwImplXplatImpl.java
#	forge/src/main/java/dev/engine_room/flywheel/impl/mixin/sodium/ChunkBuilderMeshingTaskMixin.java
2024-07-27 21:59:46 -04:00
Jozufozu
fe89e0024a Courier transformed
- SimpleQuadMesh holds a reference to its backing MemoryBlock so the
  cleaner doesn't drop it
- Fixes issue where meshes suddenly start rendering garbage
2024-07-27 18:00:44 -07:00
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
IThundxr
246939b6a5
Merge remote-tracking branch 'refs/remotes/upstream/1.20/dev' into feat/multi-loader-1.21 2024-07-19 18:18:37 -04: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
IThundxr
6533723fdf
feat(api): Make PartialModel's use RL's instead of MRL's 2024-07-15 17:36:57 -04:00
IThundxr
eeb6e0f37a
style: javadoc fixes 2024-07-14 22:19:35 -04:00
IThundxr
1cce5da673
Mixin Fixin' 2024-07-14 22:18:14 -04:00
IThundxr
dfbd451fdb
1.21 Port V 2024-07-10 13:04:42 -04:00
IThundxr
e374365ce4
1.21 Port III 2024-07-10 12:51:47 -04:00
IThundxr
d0924175de
1.21 Port II 2024-07-10 11:44:52 -04:00
IThundxr
d587ec0ec8
1.21 Port I 2024-07-10 11:27:18 -04:00
Jozufozu
b2483def1d Revert "Listless no longer"
This reverts commit 22383fd5
2024-07-05 13:49:39 -07:00
IThundxr
a9c4e5c6f4
Merge branch 'refs/heads/1.20/dev' into feat/multi-loader-1.20.4
# Conflicts:
#	gradle.properties
2024-07-03 09:47:31 -04: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
IThundxr
a9127bee1c
fix instance textures 2024-06-07 16:57:02 -04:00