Add material library and targeted surface drops
This commit is contained in:
1 parent
3931de1f0a
commit
02247f029a
24 files changed
+2794
-150
No files matched your search
@@ -40,7 +40,7 @@ Docs for the in-process egui editor (`crates/editor/`). Update this index when a
|
||||
| `play/audio_preview.rs` / `game::audio` | Non-dirty editor audition and authored runtime playback/bus adapter | audio-authoring.md, ADR 0030 |
|
||||
| `assets/animation.rs` / `ui/animation_inspector.rs` / `game::animation` | Generated animation manifests, controller authoring/preview, and runtime state adapter | animation-authoring.md, ADR 0031 |
|
||||
| `ui/navigation_inspector.rs` / `scene::navigation` / `game::navigation` | Navigation authoring, deterministic bake artifacts, viewport preview, and runtime path queries | navigation-authoring.md, ADR 0032 |
|
||||
| `assets/materials.rs` / `shared::renderer_material` / `shared::hydration::{static_meshes,skinned_meshes}` | Shared material discovery, stable renderer slots, and draw binding | material-system.md, ADR 0035 |
|
||||
| `assets/materials.rs` / `ui/material_library.rs` / `viewport/material_drop.rs` / `shared::renderer_material` | Shared material discovery, docked catalog/usage UI, exact reversible surface drops, stable renderer slots, and draw binding | material-system.md, ADR 0035 |
|
||||
| `blacksite_surface` / `game_hot::rendering::solari` / `third_party/bevy_solari` | Surface ABI packing, raster composition, Solari evaluator dispatch, and deformation eligibility | material-system.md, rendering.md, ADR 0036 |
|
||||
| `assets/` | Catalog, asset DB, static mesh artifacts, `thumbnails/`, `materials.rs`, prefab overrides v2 | this file (below), prefab-authoring.md, ADR 0017, ADR 0027 |
|
||||
| `shared::prefab_overrides` | Versioned stable override schema and editor-independent runtime application | prefab-authoring.md, ADR 0027 |
|
||||
@@ -68,6 +68,7 @@ Docs for the in-process egui editor (`crates/editor/`). Update this index when a
|
||||
- **Unified viewport** uses one render-to-texture target for both the editor fly camera and the possessed player camera so HDR/atmosphere is not broken by sub-viewport cropping.
|
||||
- **PIE:** F8 possess/eject while sim runs; **F6** pauses/resumes simulation in Play; project settings drive shared rendering for the active viewport camera.
|
||||
- **Asset browser** mirrors the on-disk `assets/` directory with project tree, breadcrumb, search/filter/sort, grid/list views, texture/model/material thumbnails, a details pane, and context-aware row/menu actions; narrow docks prioritize content, keep the root panel fixed, switch list view to a compact single-column layout, and hide tree/details panes when they would crowd the content area. The footer stays pinned while only the project tree, asset content, and details panels scroll. **Built-ins** holds spawnable primitives and lights. **Materials** folder scans `assets/materials/*.ron`, renders material thumbnails on a sphere using `MaterialDesc`, and exposes shader-schema-driven parameters/textures in the details editor; **Shaders** holds shader schema RON files. **Audio** accepts Bevy-supported Ogg/Vorbis and Speex (`.ogg`, `.oga`, `.spx`), WAV, MP3, and FLAC clips under `assets/audio/`, with a dedicated filter, waveform icon, format/file details, and stable registry-backed references that retain a runtime source path. glTF/GLB/FBX rows can expand into a shelf of normalized embedded mesh, material, and texture subassets with independent generated thumbnails. Mesh subassets can be selected, dragged into the viewport, or placed from details/context menus; material subassets render source-material spheres; texture subassets can be applied to the selected actor. Model import settings are staged with **Apply** / **Revert**, asset context menus can regenerate thumbnails, material asset details edit shared `MaterialAsset` fields, and file asset deletion moves sources/generated artifacts into `assets/.trash/`. Before thumbnail loading, glTF sources preflight local external buffers/images and show a stable non-retryable failure state when a dependency is missing instead of repeatedly invoking the asset loader.
|
||||
- **Material Library** is a dockable bottom-panel catalog for cross-folder Material and direct-base Material Instance authoring. It provides search, type and scene-usage filters, grid/list thumbnails, dependency health, usage counts, creation, guarded details editing, and first-class drag sources. Viewport drops resolve an exact renderer slot, primitive, or brush face under the pointer, preview transiently, reject incompatible/read-only targets explicitly, restore on target change/cancel, and commit one typed undo step on release.
|
||||
- **Static/skinned renderer split** — model drag/drop uses normalized artifacts under `assets/meshes/generated/`. Unrigged, non-animated sources create `ActorKind::StaticMesh + StaticMeshRenderer`; skin-bound or animated sources create `ActorKind::SkinnedMesh + SkinnedMeshRenderer` and preserve the imported hierarchy. Static slots never contain marked skinned primitives or geometry from animated sources. `SceneInstance` placement keeps `ImportedModel + ModelRef` for generic full-source scenes. See [ADR 0033](../adr/0033-dedicated-skinned-mesh-renderer.md).
|
||||
- **Animation authoring** — glTF/GLB imports generate UUID-keyed rig/clip manifests and expandable skeleton/clip shelves. Clip drag creates a skinned actor or adds one exact-signature-compatible state to a selected skinned actor through typed history. `AnimationControllerDesc` exposes named states, ranges, loop/speed, default/crossfade, and non-dirty runtime-backed preview; project validation resolves the same stable refs and blocks animated/skinned FBX with conversion guidance. Production acceptance completed in Gitea #46. See [animation-authoring.md](animation-authoring.md) and [ADR 0031](../adr/0031-animation-authoring-runtime-contract.md).
|
||||
- **Navigation authoring** — bounds, obstacles, areas, and links use typed history and viewport visualizers. Rerecast produces a versioned fingerprinted artifact; Polyanya powers both editor path preview and the game-owned runtime API. The existing horizontal toolbar path button creates or bakes bounds, while Scene > Navigation exposes the complete workflow. See [navigation-authoring.md](navigation-authoring.md) and [ADR 0032](../adr/0032-versioned-navigation-bake-and-runtime-query.md).
|
||||
|
||||
@@ -21,17 +21,31 @@ material, but may not reference another instance.
|
||||
|
||||
## Assign materials
|
||||
|
||||
1. Select a static- or skinned-mesh actor.
|
||||
2. In **Static Mesh Renderer** or **Skinned Mesh Renderer**, find the material slot by its imported
|
||||
name and stable ID.
|
||||
3. Use **Browse** or **Select** to assign a Material or Material Instance. **Locate** reveals the
|
||||
current asset in the Asset Browser.
|
||||
4. Use **Clear** to remove only the explicit assignment. The slot returns to its read-only imported
|
||||
source material.
|
||||
Open **Window > Material Library** for the cross-folder Material/Material Instance catalog. It
|
||||
supports search, Material/Instance/scene-usage filters, grid/list thumbnails, dependency health,
|
||||
scene-reference counts, creation, drag sources, and the guarded shared-asset editor. It lives in the
|
||||
existing bottom dock and does not add permanent viewport chrome. Scene-usage rows select the exact
|
||||
actor, focus the viewport, and identify its renderer slot, primitive surface, or brush face.
|
||||
|
||||
Assign through either exact workflow:
|
||||
|
||||
1. Drag a Material or Material Instance from the Material Library or Asset Browser onto the desired
|
||||
viewport surface. A hydrated static/skinned draw targets its exact stable renderer slot, a
|
||||
primitive targets its actor material, and a brush targets the exact face under the pointer.
|
||||
2. Check the pointer card and target visual. Green names a valid actor/slot/face; red gives the
|
||||
blocking reason. Release commits one undoable assignment. Move away, leave the viewport, press
|
||||
Escape, or right-click to restore the pre-drag state without history or dirtying the scene.
|
||||
3. Alternatively, select a static- or skinned-mesh actor and use **Browse** or **Select** on the
|
||||
named slot in its renderer inspector. **Locate** reveals the current asset in the Asset Browser;
|
||||
**Clear** removes only the explicit assignment and restores the read-only imported source.
|
||||
|
||||
From the Asset Browser, **Apply Material** assigns the selected material to every material slot on
|
||||
each selected static or skinned renderer. Use the per-slot inspector when different draws need
|
||||
different assignments.
|
||||
each selected static or skinned renderer. This is the explicit bulk path. A viewport hit never
|
||||
silently broadens to all slots.
|
||||
|
||||
Texture drops target a primitive's base-color texture or one brush face. Direct Texture drops on a
|
||||
renderer slot are rejected because a renderer slot stores a Material reference; create or edit a
|
||||
Material Instance and assign the texture there.
|
||||
|
||||
Static draw slots and material slots are separate. Removing a static draw retains its explicit
|
||||
material assignment as an orphan rather than guessing a replacement. Reimport also reconciles
|
||||
@@ -39,10 +53,11 @@ slots by stable ID, never by display name. Resolve an orphan explicitly in the r
|
||||
|
||||
## Author shared assets
|
||||
|
||||
Material files and material-instance files are RON documents under `assets/materials/`. The Asset
|
||||
Browser identifies the document kind, exposes its schema-driven properties and texture bindings,
|
||||
and uses stable subasset IDs (`material:source` or `material:instance`). Built-in shader schemas
|
||||
live under `assets/shaders/`.
|
||||
Material files and material-instance files are RON documents under `assets/materials/`. The
|
||||
Material Library and Asset Browser identify the document kind, expose the same guarded
|
||||
schema-driven editor and texture bindings, and use stable subasset IDs (`material:source` or
|
||||
`material:instance`). Material Instance thumbnails resolve the direct base plus sparse overrides.
|
||||
Built-in shader schemas live under `assets/shaders/`.
|
||||
|
||||
Select a Material and use **Create Instance** to create a direct-base variant beside it. The
|
||||
instance inspector exposes its base Material plus sparse property and texture override checkboxes;
|
||||
@@ -147,3 +162,5 @@ bases, and unsupported project content through the same editor/headless finding
|
||||
| Custom normal has no visible effect | Verify the mesh has tangents. |
|
||||
| Animated actor is missing from Solari GI | Expected for current skinned/morph geometry; inspect the deformed-exclusion diagnostic. |
|
||||
| Material reference is unresolved | Run project validation and repair/reselect the stable asset reference; do not hand-edit a display-name match. |
|
||||
| Texture drop is red on an imported renderer | Renderer slots accept Materials, not loose textures. Create/edit a Material Instance, set its texture, then assign it. |
|
||||
| Drag preview remains after leaving a target | This is a regression: target changes, viewport exit, Escape, right-click, and invalid release must restore the exact snapshot. |
|
||||
Reference in new issue
Block a user