chunky-dev / chunky-dev/chunky

Per quad material properties

Open
#1,796 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
738
Forks
78
Avg merge
10h 5m
Merged PRs (30d)
3

Description

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](https://github.com/chunky-dev/chunky/pull/1794/commits/a3af3a2130fe1dfaca1254e5026d35448c356c4f))
* 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 #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)

Contributor guide

Open the contributing guide

Research direction

No files, tests, or entry points are named. Start by tracing how blocks, materials, rays, and quad models currently relate, then examine the existing hard-coded material changes and texture-per-quad handling. Done means quad models can provide per-quad materials while ordinary blocks retain a suitable default without assuming every block implements Material.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
computer-graphics
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.