Skip to content

Conversation

@embeddedt
Copy link

This PR heavily optimizes the rendering of infested leaves & simplifies the code.

  • Fully infested leaves now use a BakedModel for rendering. This makes them no costlier to render than standard vanilla leaves. The grayscale effect is applied once during chunk meshing using a custom BlockColor callback.
  • I removed the use of a custom core shader for applying the grayscale effect and now apply it using a wrapped VertexConsumer that adjusts the provided colors. This approach should be fully compatible with Iris as it only uses standard vanilla RenderTypes.
  • I removed the useFastInfestedLeaves config option, as it is now redundant (the slower, dynamic block entity renderer is only used during the animation, and very few leaves will ever be animated at once).
  • For now, I left the Iris detection logic in place, but it is not used by infested leaves anymore. If it's not used anywhere else, it can be removed completely.

@thedarkcolour
Copy link
Owner

The reasoning behind using a custom shader was so that leaves like Cherry Leaves would be properly tinted. Does this PR properly tint Cherry Leaves? I'm not at my computer at the moment to test, but the original behavior is:
image

@embeddedt
Copy link
Author

Ah, no, it does not. I assumed this would only be used on 'regular' leaves whose color is fully determined by the vertex color. I don't think it's possible to tint precolored leaves using this approach as we don't get control over the texture color. 😞

@thedarkcolour
Copy link
Owner

It would be nice if there was an easier/more efficient way to implement this behavior in a way that was compatible with Iris out of the box, but after lots of searching I found none.

@embeddedt
Copy link
Author

embeddedt commented Aug 29, 2025

Modern Iris (in 1.21.1+) is actually capable of using the custom core shader, but I think they might still not be enabling that by default (haven't checked in months).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants