[PR #7774] Cosmetics: a still picture of a player wearing items, drawn on the CPU #7812

Open
opened 2026-11-03 07:24:32 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/7774
Author: @ludovic111
Created: 11/2/2026
Status: 🔄 Open

Base: main ← Head: feat/cosmetics-preview


📝 Commits (2)

  • a1ba83e Cosmetics: a still picture of a player wearing items, drawn on the CPU
  • 9e8c3f6 Merge feat/cosmetics-draw into feat/cosmetics-preview

📊 Changes

4 files changed (+365 additions, -0 deletions)

View changed files

📝 crates/horizon-cosmetics/src/item.rs (+19 -0)
📝 crates/horizon-cosmetics/src/lib.rs (+1 -0)
➕ crates/horizon-cosmetics/src/preview.rs (+338 -0)
📝 docs/cosmetics.md (+7 -0)

📄 Description

🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself.

Part of #7722. Stacked on #7772 (retargets as the stack merges).

What

horizon_cosmetics::preview: a still picture of a player wearing items, drawn on the CPU, for the launcher's Wardrobe (next PR), which has no game renderer to borrow.

  • player_model(slim): vanilla PlayerModel's boxes and UVs on a 64×64 skin (wide or slim arms, the outer layers included), the same Part shape as items.
  • Draw::item(item, body, ticks) puts an item on its bone at rest, animated to ticks.
  • render(draws, w, h, yaw, pitch): a small rasterizer with a depth buffer, cutout alpha (the skin's transparent outer layer doesn't hide what's under it) and simple directional shading; the figure is framed to the picture's height.

No game code changes; nothing calls it in this PR.

Tests

At 100×100, where the expected pixels follow from the framing (40 px a block): the head's front is at (50, 20) facing the viewer and the back of the head shows when turned 180°; above the head is empty while bare and holds a cap's pixel at (50, 5) once one is worn on the head bone.

pr_ready

pr_ready (tools/pr_ready.py --quick --base origin/feat/cosmetics-draw on ludovics-mac-mini, against origin/feat/cosmetics-draw at dcf54ab49, 8 min 47 s)

Check Result
Scope ✅ 4 files, +365 −0
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 614 passed (4 min 0 s)
rustfmt ✅ (6 s)
clippy ✅ (3 min 10 s)
tests: horizon-cosmetics ✅ 15 passed (24 s)
doc tests ✅ 0 passed (1 s)
content root tests ➖ content root untouched
mod API up to date ➖ native hooks untouched
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ 137 affected, to run in CI (--quick): ambient_sound, anvil_turtle_egg, armor_stand_frost, armor_stand_turtle_egg, arrow, arrow_wind_charge, audio_attributes, auto_jump, block_entity_anim, block_entity_render, block_entity_tickers, block_particles and 125 more
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

The parity harnesses it lists are the ones reachable from horizon-cosmetics through horizon-client; nothing in the game calls preview.

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/7774 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 11/2/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `feat/cosmetics-preview` --- ### 📝 Commits (2) - [`a1ba83e`](https://github.com/horizon-rust/horizon/commit/a1ba83e95ceffe85510e6265de7523ac22c7fba2) Cosmetics: a still picture of a player wearing items, drawn on the CPU - [`9e8c3f6`](https://github.com/horizon-rust/horizon/commit/9e8c3f64f4d8ba3389e445b0eadf1f665aa44edd) Merge feat/cosmetics-draw into feat/cosmetics-preview ### 📊 Changes **4 files changed** (+365 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-cosmetics/src/item.rs` (+19 -0) 📝 `crates/horizon-cosmetics/src/lib.rs` (+1 -0) ➕ `crates/horizon-cosmetics/src/preview.rs` (+338 -0) 📝 `docs/cosmetics.md` (+7 -0) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. Part of #7722. Stacked on #7772 (retargets as the stack merges). ## What `horizon_cosmetics::preview`: a still picture of a player wearing items, drawn on the CPU, for the launcher's Wardrobe (next PR), which has no game renderer to borrow. - `player_model(slim)`: vanilla `PlayerModel`'s boxes and UVs on a 64×64 skin (wide or slim arms, the outer layers included), the same `Part` shape as items. - `Draw::item(item, body, ticks)` puts an item on its bone at rest, animated to `ticks`. - `render(draws, w, h, yaw, pitch)`: a small rasterizer with a depth buffer, cutout alpha (the skin's transparent outer layer doesn't hide what's under it) and simple directional shading; the figure is framed to the picture's height. No game code changes; nothing calls it in this PR. ## Tests At 100×100, where the expected pixels follow from the framing (40 px a block): the head's front is at (50, 20) facing the viewer and the back of the head shows when turned 180°; above the head is empty while bare and holds a cap's pixel at (50, 5) once one is worn on the head bone. ## pr_ready **pr_ready** (`tools/pr_ready.py --quick --base origin/feat/cosmetics-draw` on ludovics-mac-mini, against origin/feat/cosmetics-draw at dcf54ab49, 8 min 47 s) | Check | Result | | --- | --- | | Scope | ✅ 4 files, +365 −0 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 614 passed (4 min 0 s) | | rustfmt | ✅ (6 s) | | clippy | ✅ (3 min 10 s) | | tests: horizon-cosmetics | ✅ 15 passed (24 s) | | doc tests | ✅ 0 passed (1 s) | | content root tests | ➖ content root untouched | | mod API up to date | ➖ native hooks untouched | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ 137 affected, to run in CI (--quick): ambient_sound, anvil_turtle_egg, armor_stand_frost, armor_stand_turtle_egg, arrow, arrow_wind_charge, audio_attributes, auto_jump, block_entity_anim, block_entity_render, block_entity_tickers, block_particles and 125 more | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | The parity harnesses it lists are the ones reachable from horizon-cosmetics through horizon-client; nothing in the game calls `preview`. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#7812
No description provided.