Skip to content

feat(skin-renderer): render pack models and a player as a scene - #1249

Draft
ugcodrr wants to merge 62 commits into
feat/render-core-scenesfrom
feat/render-scenes
Draft

ugcodrr wants to merge 62 commits into
feat/render-core-scenesfrom
feat/render-scenes

Conversation

@ugcodrr

@ugcodrr ugcodrr commented Nov 14, 2026 •

Copy link
Copy Markdown
Member

Description: The renderer could only draw a player on their own, with no way to put a pack model on their head, in their hand or under them.

  1. renderScene draws an optional player with any number of pack models from a ModelLibrary, built once per pack. Each model hangs from the root, the head or a hand, and is placed the way the game places a worn or held item, so most models need no offsets.
  2. Players get a sit pose, the game's riding pose.
  3. A model worn at the root is scaled to match the player, since 1.8 draws the armor stand wearing it at full size and players at 0.9375.
  4. A player holding something raises that arm like 1.8 does, and the camera only frames the faces of a pack model that show.
  5. A scene model can be left out of the camera's framing.
  6. A scene model takes a translation only, and a transform that mirrors it fails the render.

renderSkin output doesn't change.

Stacked on #1248.

Testing: renderScene with a kart on the root and a helmet on the head of a seated player draws them where the game does.

napi turned a width of 4294967896 into 600 and 600.9 into 600. The sides now arrive as numbers and must be whole and within the device limit before any model or texture loads.
…lapse the scene

NaN, infinity, a zero scale or values that overflow once narrowed or multiplied through the chain reached the camera and gave an empty image. Each model's transform and placed points must now be finite with an invertible scale, and a scene whose points all meet at one point is refused.
…s depth

The fixed 0.1 to 1000 planes clipped away a kart scaled 100, which sits thousands of units out, and one scaled 0.0001, which falls in front of the near plane. A framed camera now puts its planes at half the nearest point's depth and twice the farthest's, and framing fails for points it can't project. The skin renderer's fitted camera keeps its planes.
Distance from the eye misorders parts that sit side by side, such as a helmet's left and right halves. The blended pass now orders by the w a perspective projection gives each center.
Dividing the scale out of the normal matrix only restores the normals' length under an even scale, so a model scaled unevenly, like a helmet with a nonuniform display scale, lit brighter along some axes. Draws whose transform scales unevenly now have their normals normalized; every other draw, the skin's included, shades exactly as before.
…like the game

LayerHeldItem draws from an arm that misses the sneaking body's 0.2 block drop, then moves the item 0.203125 blocks down the hand. Held items took the body's drop instead. Head items keep dropping with the body before the head's joint, as LayerCustomHead does.
…odels behind them

In a scene the player, its armor and its cape blended partly transparent texels and wrote their depth, so a translucent kart behind a see-through skin texel went missing. Their opaque texels now draw with the depth like a model's, and the rest blend after every opaque texel without writing it, enchanted ones with their glint. They blend before the models' translucent texels rather than sorted among them: what lies behind them is the player's own body, and a model's large translucent shell, such as a kart around the player's legs, has its center behind them.
@vercel

vercel Bot commented Nov 14, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
statsify Ignored Ignored Nov 22, 2026 8:57pm UTC

@ugcodrr
ugcodrr added this pull request to stack #1195 November 16, 2026 17:08
@vercel

vercel Bot commented Nov 22, 2026

Copy link
Copy Markdown

Deployment failed for project statsify with the following error:

Resource is limited - try again in 24 hours (more than 100, code: "api-deployments-free-per-day").

Learn More: https://vercel.com/statsify-net?upgradeToPro=build-rate-limit

The projection no longer goes through cgmath's perspective, which panicked on close planes.
The bones now turn by the same rotation place gives the model.
1.8 draws players at 0.9375 and armor stands at full size, with the stand's head a pixel lower, so a kart worn at the root drew 16/15 too small against its rider.
@ugcodrr
ugcodrr removed this pull request from stack #1195 November 23, 2026 04:04
@ugcodrr
ugcodrr changed the base branch from feat/minecraft-models to feat/render-core-scenes November 23, 2026 04:04
@ugcodrr
ugcodrr added this pull request to stack #1277 November 23, 2026 04:04

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant