Commit graph

122 commits

Author SHA1 Message Date
PepperCode1
81e8c5765a Indigo shade related fixes and other changes (#2898)
* Apply disabled shade from vanilla quads directly to material

- Remove QuadViewImpl.shade

* Fix enhanced AO calculation and respect non-terrain culling state

- Fix AoCalculator using AO face data computed with a potentially different shade state
- Move non-cached computation code to separate method in AoCalculator
- Turn AoCalculator's brightnessFunc and aoFunc into abstract methods
- Do not check null check world in non-terrain AO calculation since it cannot be null
- Pass through lightFace and shade state as method arguments in AoCalculator methods to prevent additional lookups
- Do not check for the axis aligned flag in AbstractQuadRenderer.shadeFlatQuad
- Respect cull parameter passed to non-terrain rendering by merging TerrainBlockRenderInfo into BlockRenderInfo
- Use reusable search pos when calling Block.shouldDrawSide to prevent additional BlockPos allocation
- Change BlockRenderContext.render and TerrainRenderContext.tessellateBlock to return void since return value is no longer used
- Remove QuadViewImpl.vertexStart since it is unused

* Add suggestions

- Mark Direction parameter to BlockRenderInfo.shouldDrawFace as Nullable
- Reuse MaterialFinder in FrameBakedModel

(cherry picked from commit 3a95925af4)
2023-02-23 10:15:13 +00:00
modmuss50
e45f7c6532 23w07a 2023-02-15 19:54:58 +00:00
modmuss50
57338cbe24 23w06a 2023-02-08 17:54:34 +00:00
Technici4n
9f179aa14c
Indigo and Renderer API fixes related to fallback consumers (#2775)
* Fix #2639: Indigo fallback consumer does not respect BlendMode or emissivity

* Change renderer testmod to test material change

* Remove presumably unneeded `quad.geometryFlags()` call

* Also test emissivity

* Call emitBlockQuads in the testmod

* Allow passing the block state explicitly to the fallback consumer. Fixes #1871

* Expand testmod to also test item models

* Also fix fallback consumer ignoring material for items

* Slight changes

* Introduce new interface for the expanded fallback consumer

* Add javadoc to ModelHelper
2023-01-02 13:05:49 +00:00
modmuss50
99f9db8063
Cleanup Environment annotation usage. (#2755)
* Remove @Environment(EnvType.CLIENT) from BoundedIntRule.validate

* Move ItemTooltipCallback to client source set

* Remove @Environment(EnvType.CLIENT) annotation

* Remove @Environment(EnvType.SERVER) from WorldChunkMixin
2022-12-23 13:10:16 +00:00
modmuss50
11ba9c3b22
22w43a (#2610)
Co-authored-by: Technici4n <13494793+Technici4n@users.noreply.github.com>
2022-10-26 20:48:38 +01:00
modmuss50
aeb40ebeab
Rename and validate Mixin class names. (#2450)
And update loom.
2022-08-15 18:59:19 +01:00
PepperCode1
5187d39fe0
Fix Indigo AO calculation (#2344)
* Fix AO calculation

- Ensure calcFastVanilla and computeFace have parity with vanilla
- Ensure BlockStates are not queried more than once for the same position
- Replace deprecated FabricLoader#getConfigDirectory call with FabricLoader#getConfigDir

* Revert opaque sides fix

* More AO fixes and optimizations
2022-07-21 20:07:20 +01:00
Player
1f92344eb5 Clarify Indigo TextureHelper BAKE_NORMALIZED use 2022-06-24 05:51:57 +02:00
Player
b29f2732f8 Revert "Fix the bitwise comparison for BAKE_NORMALIZED (#2353)"
This reverts commit d0a4acbdc1.
2022-06-24 05:51:48 +02:00
RichieSams
d0a4acbdc1
Fix the bitwise comparison for BAKE_NORMALIZED (#2353)
The bitwise comparison is doing the opposite of what we want. It's currently checking for the *absence* of the BAKE_NORMALIZED flag. And if the flag is absent, it is normalizing. This should do the opposite.
2022-06-23 20:17:51 +01:00
PepperCode1
c57dbccabe
Defer Indigo item rendering (#2336)
- Move ItemRenderer injection point from head to before isBuiltin check to allow model replacement to run
2022-06-19 19:18:26 +01:00
modmuss50
9ff28f4026
Split client only code into its own sourceset. (#2179)
A common source of crashes on modded Minecraft servers comes from modders accidently calling client only code from the client, this PR is another large step towards elimitating that.

This PR has been months in the making and years in the planning, requiring major changes to Loom & Loader. In recent Minecraft versions Mojang has made it easier than ever to cleanly split the jar, going against the status-quo of merging the client and server into one jar.

From the start we have designed Fabric to have a very clear split between client and common (client & server) code. Fabric has always encoraged keeping client only code seprate from the server, this can be seen at a fundamental level with the entrypoints in Loader. Fabric API's have all been designed with this mind.

This PR provides a compile safety net around Fabric API using client only code on the server. Even though there are almost 400 changed files, minimal changes beyond moving the files were required to achieve this in Fabric API, thanks to the effort of all contributors in the past.

These changes should not affect modders or players in anyway, a single "universal" jar is still produced. Im happy to awnswer any questions.
2022-05-21 16:26:46 +01:00
modmuss50
23acfcd6a1 Update mappings. 2022-05-20 18:56:00 +01:00
modmuss50
55043e695a 1.19-pre1 2022-05-18 19:16:52 +01:00
modmuss50
56447d9b95 22w17a 2022-04-27 20:48:57 +01:00
modmuss50
ec94c6f636
22w16b
Co-authored-by: Player <player@player.to>
2022-04-20 22:22:10 +01:00
PepperCode1
4f5836e5d4 Modernize Indigo (#2110)
* Modernize Indigo

- Restructure ItemRenderContext to be more efficient and consistent with block rendering
- Remove unnecessary code including CompatibilityHelper
- Add Unique annotations to fields added by Indigo
- Fix typos
- Organize imports

* Remove unused import

* Fix bugs

- Fix enchantment glint not rendering on item models
- Fix QuadView#copyTo not copying enough data
- Make ItemRenderContext vertex consumer calculation mirror vanilla and be more efficient

* Clear the target quad's material

* Tweaks

- Retain material during copyTo instead of clearing it
- Standardize mixins

* Direct return

- Return from ItemRenderContext#quadVertexConsumer instead of assigning value to variable
2022-04-17 19:49:15 +01:00
modmuss50
8eae451042 22w15a 2022-04-13 19:03:57 +01:00
modmuss50
717abbc48a 22w14a 2022-04-06 21:49:45 +01:00
haykam821
d8c7b9aeb5 Fix Indigo rendering item models without transforms multiple times (#1982)
Fixes #1981
2022-02-02 18:35:21 +00:00
modmuss50
d7c144a830
Migrate to SLF4j and update loom (#1960)
* Migrate to SLF4j and update loom

* Update loom

* Update to latest loom
2022-01-30 21:37:23 +00:00
qolq
b0b66fc386
Fix Indigo UV rotation (#1945)
* Fix Indigo UV rotation

* Update MutableQuadView bakeFlags javadocs
2022-01-14 15:20:28 +00:00
Player
3ac43d9577 Revert Mixin compatibilityLevel bump, bump versions 2021-11-17 03:29:11 +01:00
modmuss50
e77d3ea62f 1.18-pre2 & Java 17 2021-11-16 18:41:10 +00:00
modmuss50
b4f4f6cda4 Update Loom and Loader. Cleanup/improve buildscript. 2021-11-12 15:02:54 +00:00
modmuss50
65d505fc8a Bump versions
All of the version need to be bumped due to fabric-api-base being updated, this highlights the need for a better solution.
2021-11-05 17:09:48 +00:00
modmuss50
0b944752fc 21w43a 2021-10-27 20:48:33 +01:00
modmuss50
cbda9318cd
Update Gradle/Loom and mappings. (#1692)
* Update Gradle/Loom and mappings.

* Fix deprecations and enforce

* Review feedback

* More cleanup and deprecation fixes.
2021-08-31 14:00:20 +01:00
modmuss50
a02b4463f9 21w19a 2021-05-12 20:23:04 +01:00
modmuss50
413ddf6456 21w14a - Mappings update 2021-04-07 18:46:09 +01:00
modmuss50
23b3c92ea9 21w13a 2021-03-31 20:52:51 +01:00
modmuss50
92519afafe Version bump 2021-01-19 19:38:22 +00:00
i509VCB
f8cf2bb436 Add custom value denoting module lifecycles. (#1253)
* Add custom value denoting module lifecycles.

* Make the module validation work.

My hand has been forced - we must use buildSrc since JsonSlurper is not available in main buildscript.

* Apply task to each project and dont cross projects

* A horrible hack

* Wait what

* It works now.

* Not needed

* Drop unneeded maven repo, cache map lookup

(cherry picked from commit daa38b3d82)
2021-01-19 18:54:23 +00:00
modmuss50
e1f1abb1c0 20w49a 2020-12-02 19:02:44 +00:00
Thalia Nero
9f7a7423f3 Add module dependencies to maven POM (#1104) 2020-11-15 19:46:01 +00:00
modmuss50
3e817a62fd Version bump 2020-11-05 18:26:58 +00:00
modmuss50
fd6e7547e7
20w45a
Added FabricBlockEntityTypeBuilder
Reworked EntityRendererRegistry
Ported BlockEntityRendererRegistry
2020-11-05 18:05:55 +00:00
modmuss50
a4467d2a9c Bump version 2020-10-27 18:36:48 +00:00
i509VCB
eacb8ba396
Update yarn mappings (#1127) 2020-10-22 18:54:44 +01:00
modmuss50
2b462379ad Bump versions 2020-10-18 18:38:30 +01:00
Technici4n
16a658fec4
Fix sprite and spriteBake (#1122) 2020-10-18 18:28:31 +01:00
modmuss50
f8ac1db2b1 Version bump 2020-09-27 12:38:48 +01:00
Deximus-Maximus
5f10696617
Add @Nullable and friends (#1007)
* Boost to Loom 0.5
Add null related annotations

* Rearrange nullable to be overline

* Fix anno sorting for picky

* Add imports

* Address feedback

* Fix import
2020-09-27 12:10:02 +01:00
grondag
8bcfced859
Fix for #987 (#1046)
* Fix #987, simplify geometry tracking, clean up scoping

* Bump indigo version

* Expose improved fromVanilla method

* Strip deprecations in non-API components

* bump renderer api version

* Clear tag for converted quads

Otherwise possible for tags added by transforms to pollute subsequent quads

* Borrow from Canvas - don't set nominal face twice, prevent header state leakage
2020-09-03 19:50:26 +01:00
shartte
5d32f58344
Make Indigo more closely aligned with vanilla's behavior when (#901)
rendering flat-shaded quads. Use the cull-face (if present)
to determine where the light-value is being sampled from,
and use the light-face to apply diffuse lighting.
Also do not force the light-face to be set to the cull-face,
since some blocks use faces where these are both set and different
(see the insides of a Cauldron for example).
2020-07-24 16:24:33 +01:00
modmuss50
7548be6d43 Revert "Indigo Flat-Shading Lighting Fix (#898)"
This reverts commit 28388fad
2020-07-20 19:52:17 +01:00
shartte
28388fadd8 Indigo Flat-Shading Lighting Fix (#898)
* Make Indigo more closely aligned with vanilla's behavior when
rendering flat-shaded quads. Use the cull-face (if present)
to determine where the light-value is being sampled from,
and use the light-face to apply diffuse lighting.

* Bump Indigo version to 0.3.4
2020-07-20 19:37:34 +01:00
modmuss50
3b4b2c130e Version bump 2020-07-17 16:22:50 +01:00
shartte
1036f7f1f9
Reuse TerrainFallbackConsumer to render vanilla models when (#870)
called from BlockModelRenderer. Fixes #869.
2020-07-17 14:49:30 +01:00