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
Implement full support for Fabric Rendering API #1851
base: dev
Are you sure you want to change the base?
Conversation
.../java/me/jellysquid/mods/sodium/client/render/chunk/compile/pipeline/BlockRendererFRAPI.java
Outdated
Show resolved
Hide resolved
b9ab9c1
to
9658831
Compare
930db85
to
1307344
Compare
This really deserves to be used. It would be a very good feature. However, if it doesn't support Sodium 0.5, which we don't know as it's not released at the time of writing this, then it would need updating. Same with Fabric API and possibly Minecraft changes as well. @jellysquid3 if you haven't noticed this, this is actually decent. But it has to be stable enough that things won't break though which requires checking. |
It was noticed and discussed a bit already. It will not be in the 0.5 release, however it is likely that it will be in a subsequent one. |
Then do you have any idea of which release it will be in? Will we need to wait until after the whole major 0.5 release or it will be in a release like 0.5.1? @Technici4n |
Unclear yet. For now you can use Indium. |
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as off-topic.
This comment was marked as off-topic.
User was banned from the issue tracker for spamming issues & being utterly helpless. |
That distraction aside, this is something we want to focus on & get implemented/merged for the next major version of Sodium. It's long over-due. |
Proof-of-concept support for FRAPI in terrain meshing Further changes and optimizations Animate sprites again Optimize random handling a little bit Fix typo Fix cached sprite handling Convert bundled Indium code to spaces set cachedSprite in spriteBake Optimize BasicBakedModel#getQuads away Missing license Add item and non-terrain block contexts. Refactor terrain renderer Remove slower meshing Make QuadViewImpl implement a subset of ModelQuadView Cache default model builder Remove old pipeline and pipeline switch Remove NestedModelAccessor stuff Make contexts more similar Small cleanup Consolidate code a bit Honor per-quad normals in BakedModelEncoder Remove misleading comment
1307344
to
6aad895
Compare
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
- Fix FRAPI mixin config - Use more efficient ARGB to ABGR conversion in FluidRenderer - Fix BlockModelRendererMixin using tabs for indentation
This PR implements full FRAPI support for Sodium. There are 3 pipelines: terrain, non-terrain, and item rendering. Terrain meshing was converted to always go through a FRAPI-aware pipeline. This is a heavily modified Indigo pipeline with new optimizations to use Sodium's chunk meshing caches to the largest possible extent. Non-terrain and item pipelines are only used for FRAPI models, and as such most code comes from Indigo.
To test this PR, compare the performance of the two meshing pipelines by enabling and disabling the
Enable FRAPI terrain pipeline
option under performance.Explanation of the implementation
Bundled Indigo
Everything under
me.jellysquid.mods.sodium.client.frapi
is directly copy-pasted from Indigo. This handles all theQuadView
,Mesh
andRenderMaterial
encoding for us.QuadViewImpl
was modified to also store theSprite
, as Sodium uses it for animated texture optimization.An exception is the
render
subpackage which contains Indigo code, but heavily modified for use in Sodium.The AO calculations of Indigo were left out as Sodium already contains what is needed.
BlockRenderer
BlockRenderer
is the core class of this PR. It is completely rewritten to use a FRAPI-aware pipeline, with some optimizations for vanilla models however.The way this works is that the quads end up in
processQuad
where they are processed and buffered one-by-one.The key question is how much performance we lose from having to perform a bunch of chunks for light mode, material, etc... for each quad. From my testing, the new FRAPI pipeline has comparable performance to the original Sodium pipeline. There is 15-20% overhead from FRAPI, but this is compensated by not having to go though
WeightedBakedModel#getQuads
7 times per face, so overall the performance should be comparable to current Sodium.Non-terrain block pipeline
This was ported from Indigo, then modified heavily to use Sodium's light pipeline. This is only used for specific calls to the
BlockModelRenderer
, and only for FRAPI models. The core class isNonTerrainBlockRenderContext
.Item pipeline
This pipeline was ported from Indigo too, and is only used for FRAPI item models. The core class is
ItemRenderContext
.