Item rendering

This commit is contained in:
2026-10-13 22:29:38 -03:00
parent a18b099206
commit b34e97e487
269 changed files with 12566 additions and 3220 deletions
+23 -23
View File
@@ -129,15 +129,16 @@ each blockstate with placeholder properties, and a per-mod table fills them in.
[Parents](docs/modding/resources/models.md#parents)), and remaps it like any id. Minecraft's template parents (`cube`,
`cube_all`, `cube_column`, `orientable`, slabs, stairs, walls, glass panes) become the base game's models of the same
name in `mods/bworld/models/templates/`, and the default remap is read from that folder. A parent that holds nothing
bworld uses, like `block/block` or a mod's own root of display transforms, is left out. It drops Blockbench's extras and
`display`, keeps every texture variable (some models draw faces with `#particle`), skips item sprites (`item/generated`)
and `loader` models (OBJ, composite) anywhere up a model's parents, and says why.
bworld uses, like `block/block` (bworld has its own way of drawing blocks' items), is left out. It drops Blockbench's
extras and the `display` transforms of places bworld doesn't draw items (third person, the left hand, the head), keeps
every texture variable (some models draw faces with `#particle`), skips item sprites (`item/generated`) and `loader`
models (OBJ, composite) anywhere up a model's parents, and says why.
Run over Create 0.5.0.j's 2237 model files it converts 2105, and with its textures they make a mod `check-mods` accepts.
The rest are 79 item sprites, 50 OBJ or composite models and 5 display-only roots, and 3 name clashes were fixed with
one remap line. Merged the way the game merges them, the 2099 models with boxes come out identical to flattening them,
and the files are 1.5 MB instead of 3.4 MB. 26 vanilla textures they use (pistons, redstone torches, rails) aren't in
bworld yet.
Run over Create 0.5.0.j's 2237 model files it converts 2091, and with its textures they make a mod `check-mods` accepts.
The rest are the 16 crimson and warped ones the remap file skips, 79 item sprites, 50 OBJ or composite models and one
with only third person transforms, and 3 name clashes were fixed with one remap line. Merged the way the game merges
them, the 2099 models with boxes come out identical to flattening them, and the files are 1.5 MB instead of 3.4 MB. 26
vanilla textures they use (pistons, redstone torches, rails) aren't in bworld yet.
**What `texture` does today.** It copies PNGs keeping their folders, since bworld already names a texture in a subfolder
by joining the folders with `_`, which is the same id the converted models use. A `.png.mcmeta` becomes the `.json` next
@@ -150,17 +151,17 @@ models together make a mod `check-mods` accepts, with warnings only for the 27 m
**What `blockstate` and `item` do today.** `blockstate` writes a block for each blockstate: each property becomes a
numbered state with the fewest bits that fit (booleans as false and true, facing as north, east, south, west, up and
down so a 2 bit facing still faces its placer), properties that never change the look (like `waterlogged`) are left out,
`variants` keep their models and `x` and `y` turns, and a `multipart` becomes `parts`, one for each way a part can be
drawn. Blocks that aren't full cubes are `cutout`, or `translucent` when their model asks for it. A model that can't be
imported (OBJ, composite) is drawn as a placeholder cube. Every block gets the same placeholder mining (a second, any
tool) and drops itself, since Java mods set those in code. A block has an item when Java has an item model for it, drawn
with that model, or flat as its sprite. `item` writes the items that aren't a block's, with their sprite; the 11 Java
draws in 3D (wrench, goggles) are flat with a texture of their model until bworld items can have models.
`variants` keep their models, `x` and `y` turns and `uvlock`, and a `multipart` becomes `parts`, one for each way a part
can be drawn. Blocks that aren't full cubes are `cutout`, or `translucent` when their model asks for it. A model that
can't be imported (OBJ, composite) is drawn as a placeholder cube. Every block gets the same placeholder mining (a
second, any tool) and drops itself, since Java mods set those in code. A block has an item when Java has an item model
for it, drawn with that model, or flat as its sprite. `item` writes the items that aren't a block's, with their sprite,
or with their model for the 9 Java draws in 3D from boxes (wrench, potato cannon, extendo grip), whose texture is the
model's `particle`. The empty blaze burner's model is OBJ, so it's flat.
`mods/create` is the result: 556 blocks and 81 items from 0.5.0.j (the crimson and warped windows are left out with the
remap file's `skip`) that can be placed and look like Create's, with no behavior. `check-mods` accepts it, warning only
about 31 vanilla textures bworld doesn't have yet. `uvlock` is left out (132 blockstates use it), so some turned
textures turn with their models where Java keeps them upright.
about 31 vanilla textures bworld doesn't have yet. The 132 blockstates that use `uvlock` keep it.
**What `tag` and `recipe` do today.** Tags and recipes are checked against the mods next to `--output`, read the way
`check-mods` reads them. `tag` writes each item, block, entity and biome tag in bworld's format, which is Java's,
@@ -257,13 +258,12 @@ nothing per frame. See `ports/sodium` for how to keep buffer updates cheap.
**R4. Models without blocks** (P1). Any model in `models/` can be loaded by id for visuals, baked once into a GPU
buffer, and turned for whatever axis it's used on.
**R5. The model format** (P0). What Create's models use that bworld's don't support yet (`parent` and `x` turns are
built):
- `uvlock`;
- element `rotation` at every 22.5° step on all three axes;
- item models from model JSON (3D items in the hand and the GUI, with `display` transforms), since Create's wrench,
goggles and potato cannon aren't flat sprites.
**R5. The model format** (P0, built). Everything Create's static models use: `parent`, `x` turns, `uvlock` on variants
and parts, element `rotation` at any angle around one axis, and items drawn with models. An item's `model` draws it in
3D like a block's `item_model`, and a model's `display` places it in slots, in the hand, on the ground and on blocks
(`gui`, `firstperson_righthand`, `ground`, `fixed`) from the same starting places as Minecraft's, so Create's transforms
look the same. The wrench, potato cannon and extendo grip are drawn with theirs. Third person and left hand transforms
are dropped until bworld draws items there.
**R6. Connected textures** (P2). Create's casings, windows and vaults pick a tile from a sheet depending on which
neighbours are the same block (`foundation/block/connected/`: rectangle, horizontal, vertical and omni). It's done in