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

Enablement work for future core shader support #269

Closed
wants to merge 10 commits into from

Conversation

embeddedt
Copy link
Owner

This PR lays some early groundwork for a hybridized renderer that is capable of using vanilla core shaders (if necessary) and more efficient shaders otherwise.

These changes are not sufficient to use resource packs that modify terrain shaders. If you are a user, do not expect that builds from this PR will function with core shaders.

The change set is as follows:

  • Introduce VanillaShaderChunkRenderer, which draws chunks from our vertex buffers using the appropriate vanilla core shader. This renderer is rather inefficient compared to the regular one, as it only issues multidraw calls for one section at a time, rather than one region. This is because the vanilla shader expects the chunk offset uniform to be updated for each section.
  • Introduce a third vertex type (used internally) which produces data in the same format as DefaultVertexFormat.BLOCK.
  • Clean up vertex types so that they are selected in one central location.
  • Add a system property for testing VanillaShaderChunkRenderer (otherwise, the normal renderer is used).

More work is needed for this to be usable in practice. In particular:

  • It needs to be possible to select separate vertex types for each render pass. Otherwise, all chunks must use the vanilla-like vertex type, which is problematic both for performance and for the implementation (as there isn't space for the extra data our shader needs from the vertex).
  • Some simple core shaders need to be found to do testing with.
  • Currently, the Embeddium renderer only has three render passes (solid/cutout/translucent); data from the other passes is merged. This will likely need to be disabled if resource packs override the tripwire or mipped cutout shaders.
  • Sugarcane disappears at a significant enough distance when testing with the vanilla terrain shader. This is likely related to the point above.

@embeddedt embeddedt closed this May 21, 2024
@github-actions github-actions bot locked and limited conversation to collaborators May 21, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant