/bevy-skills:bevy-voxel-datafrom bevy-skills
Defines voxel blocks in RON, builds runtime palettes, bakes per-block textures into KTX2 atlases, and binds them as StandardMaterial for Bevy 0.20 voxel projects.
Ships in bevy-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
BlockId (u16/u32) for fast lookup during meshing.1. Define blocks in RON (assets/blocks.ron):
(
blocks: [
( name: "air", visibility: Empty ),
( name: "grass", visibility: Opaque,
faces: ( top: "textures/grass_top.png",
bottom: "textures/dirt.png",
side: "textures/grass_side.png" ) ),
( name: "stone", visibility: Opaque,
faces: ( all: "textures/stone.png" ) ),
],
)
2. Core Rust types — BlockCatalog is a Bevy Asset; Palette is a Resource:
#[derive(Debug, Deserialize, Asset, TypePath)]
pub struct BlockCatalog { pub blocks: Vec<BlockDef> }
#[derive(Resource, Default)]
pub struct Palette {
pub by_id: Vec<PaletteEntry>, // index == BlockId
pub by_name: HashMap<String, u16>,
}
#[derive(Default, Clone)]
pub struct PaletteEntry {
pub name: String,
pub visibility: BlockVisibility,
/// Atlas tile per face: [−X, −Y, −Z, +X, +Y, +Z] (block-mesh order).
pub face_tiles: [u16; 6],
}
3. Build the palette — walk the catalog, look up each face path in the
AtlasIndex (JSON sidecar loaded alongside the KTX2 file), emit one
PaletteEntry per block in catalog order (that order is the BlockId space).
4. Bind the atlas to StandardMaterial.base_color_texture; compute
per-vertex UVs as tile_x = tile_index % atlas_cols during the meshing pass.
| Topic | Reference |
|---|---|
| Full RON schema, all fields, serde defaults, parser notes | references/ron-schema.md |
BlockDef / BlockFaces / BlockVisibility types, build_palette in full, face_tiles slot convention | references/palette.md |
| KTX2 packing, tile-size budgets, padding for mip safety, BC7/ETC2/ASTC per platform | references/ktx2-atlas.md |
StandardMaterial binding, UV formula, per-vertex emission, sampler config, alpha modes | references/atlas-binding.md |
| Runtime chunk storage formats — flat array, RLE, palette compression, hybrid — with RAM estimates | references/storage-formats.md |
| Procedural generation patterns — noise upsampling, biome sharing, extremity bounds, caching | references/generation.md |
Rust/Bevy voxel-crate ecosystem survey (block-mesh, bevy_voxel_world, bevy-vox-scene, …) | references/ecosystem.md |
zstd_rust, not zstd. ktx2 and
zstd_rust are both pulled in by 3d_api (so by 3d and the defaults).
For trimmed WASM builds add ktx2 plus zstd_rust (or zstd_c) explicitly.
Use BC7 (desktop) or ETC2/ASTC (mobile) — see
references/ktx2-atlas.md.compressed_image_saver changed meaning (0.20). It now emits BCn/ASTC
via ctt; the old Basis Universal UASTC behaviour is
compressed_image_saver_universal. Pick one when you let the asset
processor bake the atlas instead of an offline script.bevy::image. ImageSampler,
ImageSamplerDescriptor, ImageAddressMode are bevy::image::*;
bevy::render::texture::* is stale pre-0.16 output and no longer resolves.Image::pixel_bytes returns Result (0.19). Atlas-inspection code that
did if let Some(px) = image.pixel_bytes(..) must match on Ok/Err.BlockVisibility. bevy::prelude::* already exports
Visibility; a local Visibility shadows it silently and the next
Visibility::Hidden on a chunk entity hits the wrong type.Resource implies Component (0.19). #[derive(Resource)] on
Palette is enough; #[derive(Component, Resource)] is now an error.BlockId space. Reordering the catalog after a
save file ships will corrupt saves. Always append; never reorder.clamp_to_edge per slice. Details
in references/ktx2-atlas.md and
references/atlas-binding.md.Translucent blocks need a separate draw call. Use
AlphaMode::Blend on a second material and a separate mesh batch per chunk —
translucent quads cannot be merged with opaque ones. AlphaMode moved to
bevy_material in 0.19 but stays in the prelude..ktx2 + JSON index; load both at startup.bevy-voxel-pipeline — the meshing step that consumes face_tiles.bevy-voxel-runtime — remesh scheduling once blocks change.bevy-custom-assets — implementing the RON catalog loader.bevy-pbr-materials — wiring the atlas into StandardMaterial.bevy-migration-0-19-to-0-20 — compressed_image_saver and image-feature renames.references/atlas-binding.md (opens in a new tab)references/ecosystem.md (opens in a new tab)references/generation.md (opens in a new tab)references/ktx2-atlas.md (opens in a new tab)references/palette.md (opens in a new tab)references/ron-schema.md (opens in a new tab)references/storage-formats.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub chrisgliddon/bevy-skills --plugin bevy-skills32 skills in this plugin
/bevyUse when starting any Bevy task, choosing between Update and FixedUpdate, picking Cargo feature flags, or recalling which sibling skill covers ECS, assets, rendering, UI, or migration. Routes to the right Bevy 0.20 skill and pins the engine version for downstream snippets./bevy-a11yUse when designing or auditing high-standard video-game accessibility in Bevy 0.20, integrating screen readers and focus navigation, supporting adaptive controllers and complete remapping, implementing captions or audio description, checking contrast and motion safety, or building disabled-player test evidence./bevy-animationUse when wiring `AnimationPlayer` + `AnimationGraphHandle`, building an `AnimationGraph` from glTF clips, blending state-driven animations with `AnimationTransitions::play`, isolating body parts with `AnimationMask`, firing gameplay sync via `#[derive(AnimationEvent)]` + `On<E>` observers, tweening with `AnimatableCurve` / `EaseFunction` / `CubicSegment::new_bezier_easing` from `bevy::curve`, or applying the 12 Basic Principles of Animation to 3D characters in Bevy 0.20.Other plugins' skills for the same job