Commit graph

905 commits

Author SHA1 Message Date
PepperCode1
69f4899ac6 VertexConsumer-related clean up
- Clean up VertexWriter to closer match BufferBuilder
- Clean up MeshEmitter on Fabric/NeoForge and remove BufferBuilderAccessor
- Remove model data and model data lookup parameters in NeoForge model builders; use IBlockGetterExtension#getModelData instead
- Fix artifact Minecraft version
2024-11-04 13:16:08 -08:00
IThundxr
ad2f3c860b
Stubborn stubs
- Remove Stub SourceSet
2024-11-03 15:02:26 -05:00
IThundxr
d881ba5302
Twas a snowy night full of scripting the builds
- Post merge fixes
- Remove stubs
2024-11-01 22:08:09 -04:00
IThundxr
ad938399b4
post merge fixes 2024-10-29 17:48:20 -04:00
IThundxr
07e66bb299
Merge remote-tracking branch 'upstream/1.20/dev' into feat/multi-loader-1.21
# Conflicts:
#	common/src/lib/java/dev/engine_room/flywheel/lib/util/ShadersModHandler.java
#	common/src/main/java/dev/engine_room/flywheel/impl/FlwImplXplat.java
#	common/src/main/java/dev/engine_room/flywheel/impl/compat/SodiumCompat.java
#	common/src/main/java/dev/engine_room/flywheel/impl/mixin/BlockEntityTypeMixin.java
#	fabric/build.gradle.kts
#	fabric/src/main/java/dev/engine_room/flywheel/impl/FlwImplXplatImpl.java
#	fabric/src/main/java/dev/engine_room/flywheel/impl/FlwLibXplatImpl.java
#	fabric/src/main/java/dev/engine_room/flywheel/impl/mixin/sodium/ChunkBuilderMeshingTaskMixin.java
#	fabric/src/main/java/dev/engine_room/flywheel/impl/mixin/sodium/SodiumMixinPlugin.java
#	fabric/src/main/resources/fabric.mod.json
#	forge/build.gradle.kts
#	forge/src/main/java/dev/engine_room/flywheel/impl/FlwImplXplatImpl.java
#	forge/src/main/java/dev/engine_room/flywheel/impl/FlwLibXplatImpl.java
#	forge/src/main/java/dev/engine_room/flywheel/impl/FlywheelForge.java
#	forge/src/main/resources/META-INF/neoforge.mods.toml
#	gradle.properties
#	gradle/wrapper/gradle-wrapper.properties
2024-10-29 17:38:23 -04:00
Jozufozu
3a949c717a Turn the cutout off crash off
- MaterialEncoder would trigger an indexing of CutoutShaders.OFF, though
  PipelineCompiler would explicitly not index OFF
- This caused a crash on instancing when MaterialEncoder would delete
  all pipeline shaders while instancing was trying to upload the packed
  ubershader uniform
2024-10-19 16:58:04 -07:00
IThundxr
3d2fdb7e83
Backport changes from 1.21.1 (#265)
* Backport changes from 1.21.1

* fix

* Fix building

* fix compile error

* fix

* fix build for real

* address reviews

* Fix sodium compat

* address requested changes

* mark rubidium as incompatible

* add missed call

* Should have worn steel toe boots

- Add "stub" sourceset to each subproject
- Directly pass vararg sourcesets to methods in PlatformExtension to
  avoid automatically shipping jars with the api stubs
- We may have to include stubs in setupLoomMod, but I don't think so
- A lot of this can be stripped back out if we don't need stub sources
  for the forge/fabric subprojects

* Guarded stubs

- Add Sodium 0.6 and Iris API stubs to stubs source set and remove Gradle dependencies on local Sodium jar, Iris, and Oculus
- Ensure usage of APIs that may not exist at runtime is in private classes and access is always guarded
- Change ShadersModHandler
  - Rename to ShadersModHelper
  - Convert methods to check for Iris' and Optifine's presence into static final fields
  - Move implementation to impl source set in form of IrisCompat and OptifineCompat classes
- Rename CompatMods to CompatMod and add public field to access mod ID
- Set BlockEntityType's Sodium predicate to null after it is removed
- Update repository links
- Remove local libs repository

---------

Co-authored-by: Jozufozu <jozsefaug@gmail.com>
Co-authored-by: PepperCode1 <44146161+PepperCode1@users.noreply.github.com>
2024-10-18 20:29:43 -07:00
PepperCode1
734506b010 Fix #266 2024-10-18 18:25:11 -07:00
IThundxr
68d15043a6
address requested changes 2024-10-14 18:11:54 -04:00
IThundxr
c705fdfc6f
address requested changes 2024-10-14 18:06:34 -04:00
IThundxr
fa57f34c47
formatting changes 2024-10-14 17:53:30 -04:00
IThundxr
008b09891a
fix meshemitter 2024-10-14 17:44:55 -04:00
Jozufozu
3193e16498 Weak assumption
- Use a weak hash set for PipelineCompiler.ALL
2024-10-12 17:02:50 -07:00
Jozufozu
efb68dc776 All or nothing?
- Actually add PipelineCompilers into the ALL list so they get deleted
  when uber components need updating
2024-10-12 16:36:20 -07:00
IThundxr
aeb9781bd4
Remove unused check 2024-10-12 17:28:24 -04:00
IThundxr
68e545bddb
forgeEventBus -> gameEventBus 2024-10-12 15:57:05 -04:00
IThundxr
f6ca19cee0
bring back comment 2024-10-12 15:54:08 -04:00
IThundxr
e39554e477
fix breaks formatting 2024-10-12 15:50:10 -04:00
IThundxr
dc3e264869
post to correct bus 2024-10-12 15:48:47 -04:00
IThundxr
6f946fcedc
Rename class 2024-10-12 15:45:14 -04:00
IThundxr
178dd6c44e
address review 2024-10-12 08:37:52 -04:00
IThundxr
93c116384f
Last fixes 2024-10-10 20:54:25 -04:00
IThundxr
b408191d0f
Build against 1.21.1 2024-10-10 19:25:59 -04:00
IThundxr
6cc2b74eef
Fix iris compat 2024-10-06 13:28:43 -04:00
IThundxr
05b82b50ca
Fix sprite UVs being messed up 2024-10-06 13:14:16 -04:00
IThundxr
ae4e4e79f5
post merge fixes 2024-10-05 12:59:27 -04:00
IThundxr
08866edf09
Merge branch '1.20/dev' into feat/multi-loader-1.21
# Conflicts:
#	forge/src/main/java/dev/engine_room/flywheel/impl/ForgeFlwConfig.java
2024-10-01 21:02:33 -04:00
Jozufozu
40577420d5 In the right direction
- Use vanilla light directions for diffuse lighting
- Copy mc's glsl code for it, but assume directions are normalized
- Add command/config to toggle use of light directions vs chunk accurate
  diffuse
- Always use shade in getItemMaterial
- Do not reload resource packs when updating light smoothness config,
  we don't need to anymore with lazy compilation
2024-09-29 11:52:35 -07:00
Jozufozu
22b5676e47 Quick thinking
- Decide not to render entities directly in the renderEntity method
- Prevents allocating large lists every frame to filter entities from
  the client level
2024-09-28 23:37:49 -07:00
Jozufozu
0a01b82647 Glimpse of glint
- Add pick glint material and system time uniform
- Move _FlwCullData to beginning of uniform block to ensure alignment
- Add helper to convert item rendertype into flywheel material
2024-09-28 23:27:28 -07:00
Jozufozu
bd0aadf9d9 Streamlined pipelines
- Make UberShaderComponent#build NotNull
- Move index update and key creation logic to PipelineCompiler
- Always update index when a resource location is requested to fix
  MaterialEncoder misses
- Indices trigger pipeline compiler deletion when updated
2024-09-28 22:05:38 -07:00
Jozufozu
ef05f7d3fd Errors galore
- Make everything in the compiler chain's results not null
- Throw errors immediately when encountered
- Log error messages when falling back
- Do not eagerly grab utility programs in IndirectDrawManager so we can
  actually catch errors and fall back
- Remove CompilerStats
2024-09-28 16:00:23 -07:00
Jozufozu
11ce4ac185 Dynamic ubering
- Remove fog shader registry
- Remove Registry and RegistryImpl
- Make shader indices mutable
- Track fog uber component in a static field in PipelineCompiler
- When a new fog source is added, delete the pipeline compilation
  harness and recreate the fog uber component
- Inline SourceLoader
2024-09-28 15:30:10 -07:00
Jozufozu
bce657804a Source of all pain
- Strip out almost all source registries
- Fog will be dealt with in a follow-up commit
- Remove most static #init methods
- Remove old ubershader indices from shaders
2024-09-28 14:48:22 -07:00
Jozufozu
48fdcdb751 DeDelleetete
- Process instancer deletions in parallel
- Give DrawManagers a frame plan
2024-09-28 14:26:15 -07:00
Jozufozu
7bd59f7b14 Not pointing
- Fix occasional npe in PlayerUniforms
- Mark accessor method as Nullable
2024-09-23 11:16:45 -07:00
Jozufozu
36b0ad4cf9 To bug or not to bug
- Disable the debug stuff in the frag shader with compile flags
- Also disable discard and conservative depth with CutoutShaders.OFF
2024-09-22 15:51:37 -07:00
IThundxr
42bdd3693c
port changes to 1.21 2024-09-22 18:20:36 -04:00
IThundxr
a3bb585a15
Merge branch '1.20/dev' into feat/multi-loader-1.21 2024-09-22 18:18:25 -04:00
Jozufozu
897c350f41 Uberstate ready
- Fix material state sorting/equality functions
2024-09-22 13:13:38 -07:00
Jozufozu
ff73e78e21 Visions of visibility
- Add visible/skipDraw getter/setter to InstanceTree
- Minecart finally gets to resolve its TODO!
2024-09-22 13:04:51 -07:00
Jozufozu
ee0f799f60 More statefuler
- Hidden state now tracks the Instance object to keep the handle small
- Make the recreate supplier an explicit record to allow comparisons
- Add setVisible method to Instance
2024-09-22 12:56:49 -07:00
Jozufozu
c5d9abab5f Tasteful stateful handles
- Use state machine interface in InstanceHandleImpl
- 3 states: deleted, visible, hidden
- Visible is directly implemented by AbstractInstancer
- Hidden stores the instancer supplier to recreate an instancer
2024-09-22 12:28:35 -07:00
Jozufozu
6a6d98c0a7 Fewber
- Do not uberize material or cutout shaders
- Add debug log for shader compilations/program links
2024-09-21 15:10:27 -07:00
Jozufozu
27e5b609af Reject eagerness return to lazy
- Eagerly load ALL shaders in ShaderSources, resolving imports there
- Compile and cache programs on-demand
- Move gl state try blocks to EngineImpl
- EngineImpl catches shader exceptions and triggers a fallback
2024-09-21 13:41:55 -07:00
Jozufozu
cb58f6075e Crumbling grumbling
- Fix crumbling on indirect
- Directly use the baseInstance as instance index without indirection
- #define base instance and draw id variables to simplify usage
- Fix null pointer looking up culling group
- Add method to map an instancer's local instance index to a global
  index in the page file
2024-09-21 12:00:09 -07:00
Jozufozu
b7b7cca992 Happy as a clamp
- Fix instances vanishing close to the edge of your screen
2024-09-20 20:07:38 -07:00
Jozufozu
40cfc08025 Mul-ing things over
- Add missing multiply functions to TransformedInstance
2024-09-20 19:28:27 -07:00
Jozufozu
90e088aedc Creation is change
- Indirect instancers mark pages as changed when instances are added
2024-09-20 19:14:50 -07:00
IThundxr
556e11a683
Fix compile errors 2024-09-20 09:47:32 -04:00