Package Exports
- @genart-dev/plugin-atmosphere
Readme
@genart-dev/plugin-atmosphere
Atmospheric effects for genart.dev — fog, mist, clouds, and haze layers with terrain masking and depth stacking. 37 presets across 4 categories, with 7 MCP tools for AI-agent control.
Part of genart.dev — a generative art platform with an MCP server, desktop app, and IDE extensions.
Install
npm install @genart-dev/plugin-atmosphereUsage
import atmospherePlugin from "@genart-dev/plugin-atmosphere";
import { createDefaultRegistry } from "@genart-dev/core";
const registry = createDefaultRegistry();
registry.registerPlugin(atmospherePlugin);
// Or access individual exports
import {
ALL_PRESETS,
getPreset,
filterPresets,
searchPresets,
fogLayerType,
mistLayerType,
cloudsLayerType,
hazeLayerType,
} from "@genart-dev/plugin-atmosphere";Layer Types (4)
| Layer Type | Category | Default Preset | Description |
|---|---|---|---|
atmosphere:fog |
Fog (5) | morning-valley-fog |
Ground-level fog with terrain masking support, 4 fog types |
atmosphere:mist |
Mist (4) | morning-mist |
Mid-level haze bands with parallax stacking and drift |
atmosphere:clouds |
Clouds (22) | fair-weather-cumulus |
Sky-level formations with 20 cloud types, 3 algorithms, layered-tint shadowing |
atmosphere:haze |
Haze (6) | light-haze |
Gradient atmospheric haze with 4 directions and noise modulation |
Presets (37)
Fog (5)
Mist (4)
Clouds (22)
Haze (6)
Mood Scenes (5)
The create_atmosphere MCP tool composes multi-layer scenes from curated preset combinations:
Rendering
Each layer type renders via canvas2d at reduced resolution for performance:
- Fog — Domain-warped fractal noise with patchiness control, vertical color gradient, fog-type modifiers (valley = denser at bottom, upslope = denser at top). 1/4 resolution.
- Mist — Multi-layer parallax noise bands with per-layer noise scale variation and drift offset. 1/4 resolution.
- Clouds — 20 cloud types via CloudFormation billow system, three rendering algorithms:
- Discrete: Multi-lobe formations with layered-tint shadowing (3-pass: shadow/body/highlight)
- Threshold: Warped noise field with Worley cellular blending and layered-tint shadowing
- Streak: Continuous tapered strokes via perpendicular-distance rendering (cirrus, contrails, pileus)
- Haze — Gradient atmospheric color with 4 directions (bottom-up, top-down, center-out, uniform), noise-modulated density. 1/4 resolution.
Terrain Masking (ADR 083)
Atmosphere layers are designed to work with the compositor masking system:
// Fog masked by terrain:profile — fog is occluded by foreground terrain
layers.setMask(fogLayerId, terrainProfileId, "alpha");
// Mist behind terrain — mist only shows behind terrain ridges
layers.setMask(mistLayerId, terrainProfileId, "inverted-alpha");The masking is handled by the compositor in @genart-dev/core@^0.7.0, not by the plugin itself.
Depth Slot System
Every atmosphere layer has a depthSlot property (0-1) for front-to-back ordering:
0= closest to viewer (foreground)1= farthest background (sky level)
Default values: fog = 0.2, mist = 0.6, clouds = 1.0.
MCP Tools (7)
Exposed to AI agents through the MCP server when this plugin is registered:
| Tool | Description |
|---|---|
add_fog |
Add a fog layer by preset with optional overrides (fogType, density, color, opacity, fogLayers, wispDensity) |
add_mist |
Add a mist layer by preset with optional overrides (density, layerCount, color, skyColor, colorShift) |
add_clouds |
Add a cloud layer by preset or cloud type with optional overrides (cloudType, coverage, sunAngle) |
add_haze |
Add a haze layer by preset with optional overrides (color, opacity, gradientDirection, noiseAmount) |
list_atmosphere_presets |
List all presets, optionally filtered by category or search keyword |
set_atmosphere_lighting |
Set sunAngle and sunElevation across all cloud layers for consistent lighting |
create_atmosphere |
Compose a multi-layer atmospheric scene from 5 mood presets (now includes haze layers) |
Utilities
Shared utilities exported for advanced use:
import {
mulberry32, // Deterministic PRNG
createValueNoise, createFractalNoise, createWarpedNoise, createWorleyNoise, // Procedural noise
parseHex, toHex, lerpColor, varyColor, // Color utils
} from "@genart-dev/plugin-atmosphere";Preset Discovery
import { ALL_PRESETS, filterPresets, searchPresets, getPreset } from "@genart-dev/plugin-atmosphere";
// All 37 presets
console.log(ALL_PRESETS.length); // 37
// Filter by category
const fog = filterPresets("fog"); // 5 presets
const clouds = filterPresets("clouds"); // 22 presets
const haze = filterPresets("haze"); // 6 presets
// Full-text search
const results = searchPresets("storm"); // storm-clouds
// Look up by ID
const preset = getPreset("sunset-cumulus");Examples
The examples/ directory contains 42 .genart files (37 individual presets + 5 mood scenes) with rendered PNG thumbnails.
# Generate .genart example files
node generate-examples.cjs
# Render all examples to PNG (requires @genart-dev/cli)
node render-examples.cjsRelated Packages
| Package | Purpose |
|---|---|
@genart-dev/core |
Plugin host, layer system, compositor masking (dependency) |
@genart-dev/mcp-server |
MCP server that surfaces plugin tools to AI agents |
@genart-dev/plugin-terrain |
Sky, terrain profiles — provides masking sources for fog/mist |
@genart-dev/plugin-particles |
Particle effects (snow, rain, fireflies) — pairs with atmosphere layers |
@genart-dev/plugin-painting |
Vector-field-driven painting layers |
@genart-dev/plugin-plants |
Algorithmic plant generation (110 presets) |
@genart-dev/plugin-patterns |
Geometric and cultural pattern fills (153 presets) |
@genart-dev/plugin-compositing |
Compositing tools including mask set/clear |
Support
Questions, bugs, or feedback — support@genart.dev or open an issue.
License
MIT









































