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

Per quad material properties #1796

Open
leMaik opened this issue Dec 16, 2024 · 0 comments
Open

Per quad material properties #1796

leMaik opened this issue Dec 16, 2024 · 0 comments

Comments

@leMaik
Copy link
Member

leMaik commented Dec 16, 2024

Materials in Chunky are weird:

  • Blocks are materials, which is mostly only useful for customizing them (players think in blocks, not block surfaces)
  • Some blocks (eg. lava cauldron and open eyeblossom require hard-coded material changes)
  • The current and previous materials are stored in the ray and equal the block by default

With the open eyeblossom, Minecraft itself introduced per quad material properties (only the emissive quads emit light). We should update Chunky to allow that, too. For PBR, we need per quad specular/normal/emittance maps anyways).

Proposed solution:

  • Remove the "block = material" assumption and don't let every block implement Material (the block doesn't decide the material that one gets when intersecting it, that's the block model's job)
  • Most blocks only need a single material, though, so add some Material registry that can provide a Material for a block (and, at a later point, some combination of block properties, see Add a way to change material properties for different blockstates #1145), which the block model may or may not use (depending on the model, eg. lava cauldron might use the lava material instead).
  • For quad model blocks, add a method that returns all materials (one for each quad, similar for how textures work)
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

No branches or pull requests

1 participant