volumetrics.package
- Fire.component
- ParticipatingMedium.component
- README.md7.7 KB
- Smoke.component
- Volume.component
- VolumeSequence.component
- VolumetricLighting.component
- VolumetricSky.component
- cloudShadow.module
- documentation
- emission_raymarch.computeShader
- importers
- lightScattering.renderFeature
- mediaShadow.renderFeature
- mediaTransmittance.module
- media_common.shaderModule
- media_shadow_apply.computeShader
- media_view.computeShader
- mediumResponse.module
- package.yaml452 B
- plume.module
- presets
- scattering_common.shaderModule
- shaders
- surroundings_grid.shaderModule
- vol_composite.computeShader
- vol_lights.computeShader
- vol_scatter.computeShader
- vol_surroundings.computeShader
- volume.module
- volume.renderFeature
- volumeDemos.module
- volumeSequence.module
- volumetricLighting.module
- volumetricSky.module
- volumetricSky.renderFeature
This package holds more than this page lists. See all of its files in its world.
README.md
volumetrics
Volumetric (3D-texture) rendering, end to end, in one package. Built
entirely on the engine's generic compute.* GPU primitives — no
Rust changes are needed to author new volumetric content.
Layout
| Asset | Identity | Role |
|---|---|---|
Volume.component | @builtin::systems.volumetrics.Volume | Attach a 3D voxel texture to an entity; stands it in the scene through the entity's transform AABB, hidden by what stands in front of it. |
VolumetricSky.component | @builtin::systems.volumetrics.VolumetricSky | Clouds in the sky: one per scene, the procedural cloud layer lit by the scene's sun (through the physical atmosphere's air and sky when a PhysicalAtmosphere stands in the scene), drawn by volumetricSky.renderFeature with no composite authored. |
VolumetricLighting.component | @builtin::systems.volumetrics.VolumetricLighting | Light shafts, god rays and glowing air: light scattering between the camera and the scene, drawn by lightScattering.renderFeature. |
ParticipatingMedium.component | @builtin::systems.volumetrics.ParticipatingMedium | Mark an entity as fog/smoke/dust the camera sees through and that shades the sun on what is under it. |
Smoke.component | @builtin::systems.volumetrics.Smoke | Smoke rising from the entity's position: a chimney's column, steam, a smoulder, a black column over a big fire, smoke signals; lit by the scene with a shadow of its own. |
Fire.component | @builtin::systems.volumetrics.Fire | Fire with its smoke at the entity's position: a campfire, a torch, a bonfire, a building on fire, an explosion's fireball; flames glow along a blackbody ramp and a flickering point light halfway up them lights the surroundings. |
plume.module | @builtin::systems.volumetrics.plume | The smoke and fire plumes Smoke and Fire hold, from a script: styles, sizes, quality levels; fills a volume each drawn frame and stands it with Volume:draw. |
mediaTransmittance.module | @builtin::systems.volumetrics.mediaTransmittance | The registry of media and the settings every media pass reads. |
mediaShadow.renderFeature | @builtin::systems.volumetrics.mediaShadow | Writes the sun the media take to @scene.sunOcclusion and marches each view ray through the media. |
volume.module | @builtin::systems.volumetrics.volume | Builders (noise/sphere/box/wrap) + the .zvol header reader + occupancy + brick paging + the per-entity raymarch dispatch + the draws standing in the scene (Volume:draw). |
volume.renderFeature | @builtin::systems.volumetrics.volume | Runs every standing draw's march and composite for each view the frame draws, against its camera and depth. |
VolumeSequence.component | @builtin::systems.volumetrics.VolumeSequence | Play an open volume sequence through an entity's transform AABB. |
volumeSequence.module | @builtin::systems.volumetrics.volumeSequence | A run of .zvol frames streamed through a fixed ring of resident volumes. |
volumeDemos.module | @builtin::systems.volumetrics.volumeDemos | Shared pipeline for the showcase scenes (fill + emissive raymarch + composite). |
volumetricSky.module | @builtin::systems.volumetrics.volumetricSky | The cloud layer: tiling noise, weather map, raymarch, TAA and composite orchestration. |
volumetricSky.renderFeature | @builtin::systems.volumetrics.volumetricSky | The cloud layer's passes for every view the frame draws, brought up by VolumetricSky. |
cloudShadow.module | @builtin::systems.volumetrics.cloudShadow | The shadow the cloud layer casts on everything the sun lights under it: its map, the surfaces' share in @scene.sunOcclusion, and the bindings a pass marching the air reads it through. |
volumetricLighting.module | @builtin::systems.volumetrics.volumetricLighting | The light-scattering settings, set from code. |
lightScattering.renderFeature | @builtin::systems.volumetrics.lightScattering | The light-scattering passes, brought up by VolumetricLighting. |
shaders/* | @builtin::systems.volumetrics.shaders.* | Compute shaders volume_raymarch, volume_draw, plume_fill, volume_pages, volume_pack, cloud_noise, cloud_weather, cloud_raymarch, cloud_taa, cloud_layer_surfaces, cloud_shadow_map, cloud_shadow_apply; shaders volume_draw_composite, cloud_layer_composite, cloud_layer_blit, cloud_sky_composite; shader modules volume_march, cloud_light, cloud_surface, cloud_shell, cloud_density, cloud_shadow, cloud_shadow_space. |
importers/vdb_to_zvol.importer | (auto-discovered) | .vdb → dense .zvol via the openvdb WASM plugin (procedural fallback when the plugin isn't loaded). |
presets/cumulus_default.preset | @builtin::systems.volumetrics.presets.cumulus_default | Canonical full VolumetricSky weather preset. |
The guide systems/volumetrics/documentation/README (guides { path = ... })
names the component for each effect, clouds, fog, light shafts, a fog or smoke
volume and the sky, with what each does and costs.
The scenes in showcase/volumetrics of the public Engine Showcase world show each effect running:
showcase, sky, godrays, smoke_plume, nebula, sdf_solids and
zvol_viewer, with their fill shaders (install one with the zeromind
toolbox's installAsset).
Path convention — fully-qualified builtin identities
Every intra-package reference uses the asset's fully-qualified builtin identity, the same convention every other builtin package follows:
local Volume = require("@builtin::systems.volumetrics.volume")
local Sky = require("@builtin::systems.volumetrics.volumetricSky")
local V = require("@builtin::systems.volumetrics.volumeDemos")
-- shader identities, e.g. asset.resolve("@builtin::systems.volumetrics.shaders.volume_raymarch")
Qualified identities are caller-independent: they resolve identically
from a module, a scene entrypoint, or a component. Caller-relative
(.sibling) requires are deliberately avoided here because the
component runtime caller identity is @builtin::components.<Name>, so a
.sibling require from a component resolves against the wrong root.
(An earlier revision of this package used a ~volumetrics package-root
alias for relocatability; that alias is not resolvable on current main,
so the package uses qualified identities throughout.)
Usage
-- Per-entity volume. The component resolves the name through `Volume.get`,
-- so a volume paged into a brick pool renders from the pool under the same
-- name:
local Volume = require("@builtin::systems.volumetrics.volume")
local cloud = Volume.noise({ name = "cloud", size = 64, scale = 4 })
cloud:buildSparse({ brickSize = 8 })
cloud:releaseDense()
entity(id).component.add("Volume", { volumeName = "cloud", density = 6.0 })
-- Procedural sky:
local sky = entity.spawn("sky")
sky.component.add("VolumetricSky", {})
preset.apply("cumulus_default", { entity = sky.id, component = "VolumetricSky" })
-- VDB import: drop a `.vdb` into the VFS; the importer writes a `.zvol`
-- alongside it. The Engine Showcase world's `zvol_viewer` scene draws one.
-- Animated run: one `.zvol` per frame, played through a bounded ring.
local Seq = require("@builtin::systems.volumetrics.volumeSequence")
Seq.open({ name = "plume", frames = framePaths, resident = 3, fps = 24 })
entity(id).component.add("VolumeSequence", { sequenceName = "plume", density = 6.0 })
Plugin dependency
The VDB importer delegates real OpenVDB parsing to the openvdb plugin
in the builtin library, @builtin::plugins.openvdb. Without the plugin
the importer falls back to a deterministic procedural torus so the
pipeline stays functional.