Skip to main content
← Back

Cobblemon Model Viewer

Interactive 3D viewport that renders Cobblemon Bedrock models (.geo.json) with their textures and overlay layers. Pass a species and aspects — the resolver automatically selects the right model, base texture, and any emissive or translucent overlays. Drag to rotate · scroll to zoom · auto-rotates.

Resolver system

Resolver JSON files in public/cobblemon/bedrock/pokemon/resolvers/ map aspect combinations to models and textures. Each resolver has an order field; multiple resolvers per species are loaded and sorted by it (lowest = highest priority). Variation matching requires all listed aspects to be present in the active set, preferring more specific matches (more aspects = higher score), with resolver order as a tiebreaker. Layers are typed as emissive, translucent, or emissive + additive (a 0–1 strength number), each resolved to a public URL via cobblemon: namespace stripping.

Bedrock geometry loader

A custom loader parses .geo.json without any third-party Bedrock library:

  • Coordinate mapping — Minecraft +Z south maps to Three.js −Z, so all Z positions are negated. Bone rotations use (+rx, −ry, −rz) with ZYX Euler order to match Blockbench's internal Z-negated frame (conjugated by an implicit Y180 flip relative to Blockbench's own loader).
  • Bone hierarchy — each bone becomes a THREE.Group positioned at its pivot. Cube meshes are offset by −pivot so their vertices land at model-space coordinates regardless of nesting depth. Cube-level rotations get their own wrapper group positioned at the cube pivot.
  • Box-UV unfolding — the side strip follows [west][front][east][back] order (not the Java skin convention). Bottom-face UV winding is corrected by forcing BL = (x1, z1) and inverting the flipU flag relative to the other faces.
  • mirror_uv — mirrors east/west rects AND flips the U axis on all six faces, matching Blockbench's source behavior. Used on mirrored cubes like Pidgeot's wings and eyes.
  • Per-face UV — per-face uv / uv_size specs are supported alongside box-UV; inflate pads all six faces outward.

Material and layer blending

Geometry is built once and shared across the base and all overlay layers — only materials differ. Layer blending:

  • BasealphaTest cutout, depth write enabled.
  • Emissive — full-bright (not additive); NormalBlending with cutout alpha and no depth write. MeshBasicMaterial is already unlit, so AdditiveBlending would only saturate toward white.
  • Emissive + additive: <number>AdditiveBlending with opacity set to the 0–1 strength value, scaling how much the layer adds to the scene. opacity multiplies the source alpha before the GPU blend equation, so it's a direct brightness control with no shader changes needed. Used for Lapras's crystal tips (0.6).
  • TranslucentNormalBlending with full alpha channel, no depth write.