Expand description
Heightmap and splatmap terrain rendering for viewport-lib.
The plugin registers as a viewport-lib
ItemTypePlugin and
draws terrain inside the standard scene pass, picking up shadows,
clipping, selection outline, picking, and frustum culling from the
lib automatically.
renderer.with_item_type_plugin(device, Box::new(TerrainPlugin::new()));
// Each frame:
frame.scene.submit_plugin_items(
TYPE_NAME,
TerrainCollection { items: vec![] },
);See examples/eframe_terrain.rs for a runnable demo.
Structs§
- Detail
Layer - A single scatter recipe over the terrain surface.
- Detail
Scatter Output - Output batches built by
scatter_terrain_details. - Detail
Scatter Params - Per-frame scatter inputs read from the host’s camera state.
- Layer
Textures - A per-layer texture array (diffuse or normal), packed so every layer samples from a single binding.
- Splatmap
Data - Per-channel layer weights painted across the terrain.
- Terrain
Collection - Per-frame collection of terrains.
- Terrain
Item - One terrain submission for the current frame.
- Terrain
Layer - One surface layer in a splatmap-blended terrain.
- Terrain
Plugin
Enums§
- Detail
Kind - What a
DetailLayeremits per scatter point.
Constants§
- LAYER_
COUNT - Number of surface layers in a
TerrainItem. Two splatmaps carry four channels each; channels map to layers in order. - TYPE_
NAME - Stable name used as the
SceneFrame::submit_plugin_itemskey. Match this againstTerrainPlugin::type_namewhen wiring the host side.
Functions§
- scatter_
terrain_ details - Build per-frame sprite/mesh batches for the given detail layers.