Today I finished building a fully volumetric, CS2-style smoke volume in Roblox using EditableImages.
– showcase
As far as I know, this is one of the first implementations on Roblox that actually utilizes true volumetric rendering instead of traditional particle systems. It was honestly a pain to code especially the math behind it but definitely worth it.
The system is based on real-time raymarching (yeah, actual raymarching in Roblox). It calculates light absorption and density using Beer–Lambert law, allowing the smoke to realistically react to lighting conditions.
On top of that, I implemented collision-aware volumetrics. Using a combination of raymarching and raycasting, the system detects geometry inside the volume and dynamically masks out pixels, preventing the smoke from clipping through walls or objects, and so you can walk in it and allow the smoke to completly cover up your character!
Features:
True volumetric rendering (not particle-based) Real-time raymarching Physically-inspired light absorption (Beer’s Law) Dynamic shadows inside the volume Geometry-aware occlusion (no wall clipping) Noise-based shaping for natural smoke breakup Smooth temporal blending for stability + checkerboard rendering
This was definitely one of the most challenging things I’ve worked on so far, both performance-wise and mathematically, the performance is not great, roblox utilizes mostly the CPU for scripts, and we don’t have a way of doing rendering on the GPU yet… an probably forever idk.
thank you very much! i’m not really into gatekeeping stuff like that, so i’ll probably make this open source, let other people actually use it. because honestly, out of all my projects (and we’re talking 100+), i didn’t finish a single freaking one
Reworked and significantly refined the volumetric smoke rendering to achieve a look much closer to Counter-Strike 2-style visuals. Focused heavily on shaping, density falloff, and noise layering to break the uniform spherical look and introduce more natural, organic structure.
Improved edge softness and internal density distribution, resulting in a fuller, more grounded appearance rather than a flat or overly “cloud-like” effect. Added soft floor interaction to better anchor the smoke in the environment and avoid harsh clipping near surfaces.
Implemented performance-oriented optimizations, including reduced vector allocations, localized math operations, and checkerboard rendering to maintain stable performance despite the relatively high resolution and raymarching workload.
Began experimenting with dynamic shadowing within the volume. Current implementation samples density along the light direction to approximate light absorption and self-shadowing.
Also introduced preliminary ground shadow interaction, allowing the smoke to subtly darken nearby surfaces based on density and light direction, further enhancing scene integration.
thanks! tho i don’t know if i will release it, it’s very unstable and experimental, for showcases it’s great but in practice it’s awful performance-wise.
anyways, i tinkered more with the performance stuff, and with noise mapping, now it looks more like CS2: