# Bevy 3d Materials

Bevy ECS skill for PBR materials.

- Repository: https://github.com/thedivergentai/Game-Dev-Agentic-Skills (917 stars)
- Category: Engineering
- License: LGPL-3.0
- Last updated: 2026-10-16
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add thedivergentai/Game-Dev-Agentic-Skills --skill bevy-3d-materials -g -a claude-code -y`
Codex: `npx skills add thedivergentai/Game-Dev-Agentic-Skills --skill bevy-3d-materials -g -a codex -y`
Cursor: `npx skills add thedivergentai/Game-Dev-Agentic-Skills --skill bevy-3d-materials -g -a cursor -y`
Gemini CLI: `npx skills add thedivergentai/Game-Dev-Agentic-Skills --skill bevy-3d-materials -g -a gemini-cli -y`

## Description

Bevy ECS skill for PBR materials. Keywords: Bevy, StandardMaterial, PBR, material, ExtendedMaterial.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Bevy 3D materials

## When to use

Load this when a mesh needs a PBR surface. Custom shader extension points are on bevy-shaders. Lighting is on bevy-3d-lighting.

## ECS shape

- **Type:** `StandardMaterial` (feature blurbs and `DistanceFog`).
- **Extension:** `ExtendedMaterial` on the pbr page.
- **Features that mention StandardMaterial textures:** `pbr_anisotropy_texture`, `pbr_multi_layer_material_textures`, `pbr_specular_textures`, `pbr_transmission_textures`. Check the struct page for field names before writing them.
- **Plugin:** `bevy_pbr` adds PBR rendering. It is part of the 3d render collection.

## Surface choice

| Need | Bevy idiom |
| --- | --- |
| PBR surface | `StandardMaterial` on `MeshMaterial3d`, with `base_color`, `metallic`, and `perceptual_roughness`. |
| Extra shader data on that surface | `ExtendedMaterial<StandardMaterial, E>` where `E: MaterialExtension`. |
| Transparency | `alpha_mode`: `AlphaMode::Mask` for cutout, `AlphaMode::Blend` for glass. |

## Examples

```toml
[dependencies]
bevy = "0.20"
```

Spawn a mesh with a metal `StandardMaterial`. The mesh component is `Mesh3d`. The material component is `MeshMaterial3d<StandardMaterial>`.

```rust
fn spawn_metal(
    mut commands: Commands,
    mut meshes: ResMut<Assets<Mesh>>,
    mut materials: ResMut<Assets<StandardMaterial>>,
) {
    let mesh = meshes.add(Cuboid::new(1.0, 1.0, 1.0));
    let material = materials.add(StandardMaterial {
        base_color: Color::srgb(0.75, 0.15, 0.12),
        metallic: 1.0,
        perceptual_roughness: 0.25,
        reflectance: 0.5,
        ..default()
    });
    commands.spawn((Mesh3d(mesh), MeshMaterial3d(material), Transform::default()));
}
```

Cutout foliage discards fragments under the mask. Glass uses alpha blending and a translucent base color.

The rest: https://github.com/thedivergentai/Game-Dev-Agentic-Skills/blob/HEAD/skills/bevy-3d-materials/SKILL.md
