Commit Graph

143 Commits

Author SHA1 Message Date
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
IThundxr
cbdc3189e2
fixme fixedme fixed... 2024-06-04 15:07:48 -04:00
IThundxr
56b0fce44d
Port to 1.20.4 2024-06-04 15:07:43 -04: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
Jozufozu
1406d21d83 Publicity stunt
- Only publish api/lib and full jars for platforms
- Do not eagerly create outgoing configurations for JarTaskSet
- Add method to create outgoing configuration
- Clean up JarTaskSet creation and move some string constants to statics
- Set @CompileStatic
- Remove ${name} classifier prefix from JarTaskSet jars
- Put JarTaskSet jars into subdirectories in the output folders
- Add configure and configureEach methods to JarTaskSet
- Rename OutgoingConfigurationPlugin -> JarSetPlugin and move extension
  to root module so idea offers completions in gradle files
- Standardize artifact naming flywheel-$platform(-api)?-$mcversion
2024-05-17 08:43:56 -07:00
Kneelawk
bce5f3f9b8 Fix refmaps, again 2024-05-17 08:43:56 -07:00
Kneelawk
f15501dac8 Add common publishing 2024-05-17 08:43:56 -07:00
PepperCode1
b9490fe11a Best-effort untested Fabric model builders
- Also fix crash buffering fluids in BakedModelBufferer#bufferMultiBlock (Forge)
- The mesh order in models created by model builders is currently incorrect and will be fixed later
2024-05-17 08:43:56 -07:00
Jozufozu
9ae4065c1c Pretty groovy man
- Upgrade platform script plugin to pre-compiled groovy plugin
- It was getting really difficult to manage all the logic/plugins/types
  from the basic script, and implementing a real plugin gives us much
  better type safety and IDE access to upstream plugins
- Separate api/lib/backend/impl in platform projects
- Add platform module output to main runtime classpath so the fabric
  loader recognizes our additional modules
2024-05-17 08:43:56 -07:00
Jozufozu
e1b0cebc2c Unconventional
- Use convention plugins for common build logic
- Convention plugins get to be applied in the plugins block and can load
  other plugins
- Move GeneratePackageInfosTask to its own file in buildSrc
- Apply GeneratePackageInfosTask to every sourceSet
2024-05-17 08:43:56 -07:00
Jozufozu
82a098626b Centrifuge
- Separate common project into 4 source sets
- Declare outgoing configurations for forge/fabric to depend on
- Re-compile source from each source set in each platform's compileJava
2024-05-17 08:43:56 -07:00
Kneelawk
0a4d511042 Fix artifactIds 2024-05-17 08:43:56 -07:00
PepperCode1
0d53857f10 Remove old DependencyInjection#load method 2024-05-17 08:43:56 -07:00
PepperCode1
989728ca58 Most of Fabric
- Organize almost all remaining code into one of four modules
- Fix some incorrect inter-module dependencies
- Get Fabric into a working state
  - The config, client commands, and model builders are still missing and registry freezing happens too late
2024-05-17 08:43:56 -07:00
Jozufozu
36362170c7 Graidiomatic
- Move common build script stuff to buildSrc
- Set ideaSyncTask finalizedBy generatePackageInfos directly in
  package-infos.gradle
- Enable loom multiproject optimization, though not sure if it makes a
  difference for us yet
2024-05-17 08:43:56 -07:00
PepperCode1
3ccb4eb9a1 Minor clean up and fixes 2024-05-17 08:43:56 -07:00
Jozufozu
5b5559d682 One line optimization
- Actually init vanilla visuals
2024-05-17 08:43:56 -07:00
Jozufozu
8d4fe7722c Gradle grumbles
- Apply java, maven-publish to all projects
- Prefer the tasks.named() syntax for configuring tasks
- Separate shared configuration for platform projects into a separate
  configure block
- Add more fields to processResources
- Make helper methods static
- Exclude duplicated package infos
2024-05-17 08:43:56 -07:00
Jozufozu
57ac1b08f4 Compiling models
- Make model builders abstract
- Move BakedModelBufferer as is into forge project
- Create Forge*ModelBuilders with modeldata parameters
- Wrap ModelBuilder ctors in factory methods
- Add FlywheelLibPlatform api, similar to api.internal package but for
  lib-only/platform specific stuff
- Move TransformStack wrapping into FlywheelLibPlatform
- Create vanilla renderer through FlywheelLibPlatform
- Handle partial model initialization in separate event handler class
- Fix test configuration in common project
2024-05-17 08:43:56 -07:00
Jozufozu
ff0a928479 Everything but models
- Trying to get xplat forge working, fabric can wait until the common
  project compiles
- Move backend manager event handling to separate class
- Move commands into forge for now
- Make FlwConfig an interface and move concrete impl into forge
- Remove event parameters from handlers than don't actually use them
- Add platform specific blockstate light emission for uniforms
- Remove example effect
- Add accessor for LevelRenderer#ticks
2024-05-17 08:43:56 -07:00
Jozufozu
e152df6769 Platform dependent wheeling
- Use ClientPlatform to:
  - Dispatch events
  - Create iris/oculus handler
- Move VisualizationEventHandler into forge project
2024-05-17 08:43:56 -07:00
Jozufozu
7e5b2098b1 Deduplication and stubs
- Move common gradle business from each subproject into the
  rootProject.subprojects closure
- Add fabric.mod.json
- Register forge mixin configs
- Make blaze3d mixins remap = false
- Separate common, forge, and fabric mod entrypoints
2024-05-17 08:43:56 -07:00
Kneelawk
58278dd8b4 Move events to platforms 2024-05-17 08:43:56 -07:00
Kneelawk
6e0702aa0b Move MinecraftMixin to platforms 2024-05-17 08:43:56 -07:00
Kneelawk
70a72209d2 Move Sodium mixin to platform code 2024-05-17 08:43:56 -07:00
Kneelawk
f227c44ec8 Begin on platform abstraction interface 2024-05-17 08:43:56 -07:00
Kneelawk
dbd8106b4a Add jsr305 compile dependency 2024-05-17 08:43:56 -07:00
Kneelawk
85f68997e0 Re-add sodium/embeddium, iris/oculus, starlight dependencies 2024-05-17 08:43:56 -07:00
Kneelawk
7aed7c7ad1 Re-add package-info generation 2024-05-17 08:43:56 -07:00
Kneelawk
f728ca4a4e Begin architectury setup 2024-05-17 08:43:56 -07:00