Atmospheric Vistas, Volumetric Clouds & Deterministic Feel in Pulse
Composing Pulse physical sky, volumetric clouds, volumetric fog, water/foliage, and pure component-backed spring feel without violating sandboxed tick determinism.
- clouds
- volumetric
- sky
- fog
- lighting
- springs
- game-feel
- deterministic
- environment
- vistas
When to Use & Field Best Practices
Pulse runs on WebGPU in the browser with built-in physical sky, volumetric clouds, volumetric fog, water, foliage, and procedural motion — while enforcing strict tick determinism (compile rejects module-level mutable state, Math.random, Date, or Promise in systems/*.ts).
Best-in-field composition in Pulse combines two layers:
- Declarative Atmospheric Area Environment (
world/<area>.area.jsonc):
- Enable
physical_sky: trueandvolumetric_clouds: 0.45..0.72alongside calibrated three-band sky colors (sky_zenith,sky_horizon,sky_grounddarker than horizon) and low-angle golden or crisp directional light (sun_dir: [-0.45, -0.62, -0.38]). - Keep
fog_densityinversely proportional to area span (rho ≈ 0.45 / D_span, e.g.0.0035for a 100 m valley;0.01washes out a 50 m area) and pair subtlevolumetric_fog_density(0.004) withtonemap: "agx"or"aces"and restrained bloom (bloom_intensity: 0.18,bloom_threshold: 1.05). - Frame distant horizon silhouettes (layered mountain wedges/arches outside the playable navmesh) so
volumetric_cloudsand aerial perspective create unmistakable depth cues.
- Pure Component-Backed Springs & Feel (
contracts/+systems/):
- Store spring state (
scale_y,vel_y,hitstop_s) inside acosmeticcomponent declared viapulse_declare(cosmetickeeps visual juice out of gameplay save hashes while keeping every tick 100% deterministic!). - Use built-in
ProceduralMotion(bob, breathe, lean),ProceduralGait(multi-legged creatures),ProceduralChain(tails, banners, tentacles),vfx("burst" | "spark" | "ring" | "shockwave", ...), andshake(amount)on impacts.
Mathematical & Algorithmic Core
- Fog Calibration: For arena diameter $D$ metres, set
fog_density= clamp(0.45 / D,\; 0.0015,\; 0.008)so foreground and midground targets keep> 65\%contrast while distant vista silhouettes soften into haze. - Pure Fixed-Tick Spring: In a fixed-
hzPulse system (dt = 1 / hz), update component fields(value, vel)directly with symplectic Euler: $v' = v + bigl(-ω^2(x - x_target) - 2zetaω vbigr)Δ t, x' = x + v' Δ t$
Engine Implementation
1. Area Environment Recipe with Volumetric Clouds (world/highlands.area.jsonc excerpt)
Apply via pulse_edit or area JSONC (flat environment keys only so compile emits zero unknown-key warnings):
{
"environment": {
"physical_sky": true,
"volumetric_clouds": 0.58,
"sky_zenith": "#1f4987",
"sky_horizon": "#9ec2e6",
"sky_ground": "#1c202b",
"sun_dir": [-0.46, -0.58, -0.36],
"sun_color": "#ffe9c7",
"sun_intensity": 3.2,
"sun_shadows": true,
"sun_disc_size": 1.15,
"ambient_color": "#58749e",
"ambient_intensity": 0.55,
"ibl_intensity": 0.75,
"fog_density": 0.0035,
"volumetric_fog_density": 0.004,
"volumetric_fog_rgba": "#b8cde6",
"tonemap": "agx",
"exposure": 1.05,
"bloom_intensity": 0.18,
"bloom_threshold": 1.08,
"contrast": 1.06,
"saturation": 1.08,
"contact_shadows": true,
"taa": true
}
}
2. Declaring & Running Deterministic Feel Springs (contracts + systems/feel.ts)
First declare the cosmetic component and tuning with pulse_declare:
"component FeelSpring { squash: num=1.0, squash_vel: num=0.0, was_grounded: bool=true } cosmetic""tuning feel { spring_hz: 6.5, spring_damping: 0.42, jump_stretch: 3.8, land_squash: 4.4 }"
Then step it in a pure deterministic system (systems/feel.ts) with zero module-level mutable variables:
import { query, shake, system, vfx } from "pulse";
import { FeelSpring, Player } from "../contracts/game";
import { feel } from "../contracts/tuning";
export const feelSystem = system("feel", { after: "physics" }, (dt) => {
const omega = 6.2831853 * feel.spring_hz;
const damp = feel.spring_damping;
for (const e of query(Player, FeelSpring)) {
const fs = e.feelSpring;
if (fs.was_grounded && !e.grounded && e.vel[1] > 1.5) {
fs.squash_vel += feel.jump_stretch;
vfx("ring", { pos: [e.pos[0], e.pos[1], e.pos[2]], color: "#d8f0ff", count: 8 });
} else if (!fs.was_grounded && e.grounded) {
fs.squash_vel -= feel.land_squash;
shake(0.18);
vfx("burst", { pos: [e.pos[0], e.pos[1], e.pos[2]], color: "#e8dcc4", count: 10 });
}
fs.was_grounded = e.grounded;
const acc = -omega * omega * (fs.squash - 1.0) - 2.0 * damp * omega * fs.squash_vel;
fs.squash_vel += acc * dt;
fs.squash = Math.max(0.55, Math.min(1.65, fs.squash + fs.squash_vel * dt));
}
});
Browser, Mobile & Software-Renderer Budgets
- Flat Environment Keys Only: Pulse validates
environmentkeys atcompile; never nest objects insideenvironmentor invent non-existent fog color keys (fog_densityandvolumetric_fog_rgbaare the exact keys). - Scenario Robustness (
robust >= 3/4): KeepFeelSpringmarkedcosmeticand avoid alteringCharacterMotor3Dcapsule height from visual squash so keptspec/scenarios/tapes remain 100% witnessed when tuning visual feel!
Verification Checklist
- Run
compileand verify zero determinism errors and zero unknown-environment-key warnings. - Run
pulse_lookwith"views play"and open the rendered PNG withReadto verify volumetric cloud coverage, horizon separation, and target readability. - Run
test(EditMode+PlayMode) to confirm all scenarios stay witnessed.
Official references
- Sébastien Hillaire (SIGGRAPH 2016 — Physically Based Sky, Atmosphere and Cloud Rendering)
- Naty Hoffman & Preetham (Outdoor Light Scattering)
- Pulse Deterministic ECS & Area Environment Architecture
More Pulse techniques
Deterministic Grid Push-Block & Tile Sweeps in Pulse →
Deterministic grid-based puzzle sweeps in Pulse using integer cell components, per-entity occupancy scans, and smooth fixed-tick interpolation.
Deterministic ECS Enemy Brains, Encounter Directors & Telegraphed Bosses in Pulse →
Data-oriented Pulse ECS enemy perception, orbit steering, attack-token encounter pacing, and multi-phase telegraphed boss state machines verified with headless pulse_run invariants.
Deterministic Telegraphed Boss Phases in Pulse →
Deterministic multi-phase boss telegraphing in Pulse with integer phase state, ground ring vfx, rand() jitter, and fixed-tick shockwaves.
Procedural Gait, Chain Motion & Readable Impact VFX in Pulse →
Expressive creature locomotion and impact readability in Pulse using ProceduralMotion, ProceduralGait, ProceduralChain, deterministic hit-flash/recoil components, and layered vfx bursts.
Use verified techniques inside a real game
Describe your game idea for free or connect an MCP assistant to search and contribute techniques.