Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FRAPI improvements: context getters, full removal of fallback consumers, small enhancements #3287

Merged
merged 4 commits into from
Sep 18, 2023

Conversation

Technici4n
Copy link
Member

@Technici4n Technici4n commented Aug 28, 2023

Add cull check and item transformation mode getter to FRAPI

New methods in RenderContext:

  • isFaceCulled to perform a cull check that can be optimized and cached by the renderer.
  • hasTransform, self-explanatory. Must be checked before using isFaceCulled to skip some geometry.
  • itemTransformationMode to get the current item transformation mode in item contexts.

Terminally deprecate fallbackConsumer and bakedModelConsumer

The primary goal of this change is to make renderers not need to implement these fallback consumers themselves. However, their design relies on hidden context state that cannot be queried via the API. It is thus impossible to implement a fallback layer for them, and they must be deprecated, with plans for removal in 1.20.2 (EDIT: too late for that) in a follow-up PR.

Note that BakedQuadFallback.emitBlockQuads uses the newly introduced isFaceCulled and hasTransform methods to shortcut some geometric analysis.

I also removed the "vanilla quad handler" from Indigo.

Fix uvs in octagonal column test mod

Fix the uvs in the octagonal column test mod by:

  • setting the cull face and thus the nominal face to leverage spriteBake for the axis-aligned quads;
  • manually setting the UVs for the corner quads.

@Technici4n Technici4n changed the title Add cull check and item transformation mode getter to FRAPI FRAPI improvements: context getters, full removal of fallback consumers, small enhancements Aug 29, 2023
@Technici4n Technici4n requested a review from a team September 6, 2023 21:25
@Technici4n Technici4n added the last call If you care, make yourself heard right away! label Sep 10, 2023
@modmuss50 modmuss50 self-requested a review September 11, 2023 22:19
@modmuss50 modmuss50 merged commit 39a511b into FabricMC:1.20.1 Sep 18, 2023
5 checks passed
modmuss50 pushed a commit that referenced this pull request Sep 18, 2023
…rs, small enhancements (#3287)

* Add cull check and item transformation mode getter to FRAPI

* Terminally deprecate `fallbackConsumer` and `bakedModelConsumer`

* Fix uvs in octagonal column test mod

* Review comments

(cherry picked from commit 39a511b)
comp500 added a commit to comp500/Indium that referenced this pull request Sep 23, 2023
Ports the parts of FabricMC/fabric#3287 that relate to Indigo. Now uses the same renderer-api-v1 impl details that Indigo uses; if this becomes an issue the util class can be moved into Indium.

Fixes #228, fixes #232.

Co-authored-by: Technici4n <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
last call If you care, make yourself heard right away!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants