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

Expose a function for querying the non-default fluid renderer #3558

Merged
merged 4 commits into from
Feb 9, 2024

Conversation

jellysquid3
Copy link
Contributor

This pull request exposes the existing functionality located at FluidRenderHandlerRegistryImpl#getOverride so that other mods can use it without depending on internals.

The reason for this is because Sodium (see issue) implements its own "default" for fluids, which allows it to use per-vertex colors to create a smooth gradient across the water surface. Since it's currently not possible to detect whether the default implementation is being returned by Fabric API, we can't know when to override it with our own in rendering.

I'm not sure if this is the best solution, but it seems relatively harmless as far as changes go.

@jellysquid3
Copy link
Contributor Author

jellysquid3 commented Jan 31, 2024

Note: This does introduce one difference, being that the renderer will now always invoke the fluid handler for water/lava fluids in FluidRendererMixin.tesselate. I don't know what the consequences of this are exactly, but there seems to be an escape hatch to deal with the recursion and it appears to work fine.

@modmuss50 modmuss50 added enhancement New feature or request small change labels Jan 31, 2024
@modmuss50 modmuss50 added the last call If you care, make yourself heard right away! label Feb 5, 2024
@modmuss50 modmuss50 added the merge me please Pull requests that are ready to merge label Feb 9, 2024
@modmuss50 modmuss50 merged commit d74054c into FabricMC:1.20.4 Feb 9, 2024
5 checks passed
modmuss50 pushed a commit that referenced this pull request Feb 9, 2024
* Expose a function for querying the non-default fluid renderer

* Do not register default handlers as overrides

* Add @nullable to getOverride

* Add @nullable to get

---------

Co-authored-by: modmuss50 <modmuss50@gmail.com>
(cherry picked from commit d74054c)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request last call If you care, make yourself heard right away! merge me please Pull requests that are ready to merge small change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants