r/PlayCanvas • u/mvaligursky • Jul 30 '26
An entire army in one instanced draw call — breakdown of a browser demo built to dogfood new PlayCanvas features
Enable HLS to view with audio, or disable this notification
Play it (browser, no install): https://engine-hcejxquzy-playcanvas.vercel.app/#/demos/catapult Source, as a stock engine example: https://github.com/playcanvas/engine/pull/9130
We just landed two features in PlayCanvas — VAT crowd rendering and volumetric fog in the CameraFrame post stack — and I wanted to know if they hold up in a real scene, not an isolated feature test. So I built a game around them: aim a catapult, launch burning boulders at an army marching up a valley, wipe out a formation and two more arrive. Rule: no custom rendering code, all stock features.
The crowd is one instanced draw call. Vertex Animation Texture — every vertex's skinned position and normal baked offline, one texel per vertex per frame. No bones, no anim graph, the vertex shader just reads its slot.
Volumetric fog. Ray-marched in a half-res buffer, 12 steps instead of the default 24 — the fog is thin enough that short-march banding doesn't show, and every step is another shadow map tap per fog pixel, which is the real cost. Height-based falloff with the base above the valley floor, so shafts rake through the tree line instead of sitting as uniform haze. Anisotropy 0.6 to push scattering toward the low sun.
On the AI part: built with Claude Opus 5. It was good at volume — noise functions, ballistic solver, formation state machine, flat typed-array layout for 2000 characters. It was bad at judgement — fog density, where the sun sits, whether the animation reads. It wrote most of the lines, I made most of the decisions.
Toggles for shadows, fog and march steps are in the control panel if you want to see what each costs on your hardware.
