Volumetric light beam instances for realistic environments

As a Roblox developer, it is currently too difficult to simulate lighting beams under realistic atmospheric conditions - this is incredibly useful functionality which is currently missing from the engine.

Beams are no longer sufficient for realistic environments

Currently, developers can only use Beams to simulate volumetric lighting beams. In most cases, such as background elements - this is an acceptable workaround. However, there are common cases where this method proves undesirable.

The illusion is immediately broken as soon as the player is viewing the beam from a straight-on perspective. Consider the following flashlight & streetlight example:

584bab9b2fb094ea977f55dcc6adbec2

This side-effect can be remedied by instead using ParticleEmitters - however, this will quickly become a performance bottleneck with how many particles are required.

Unfortunately, all of these workarounds share a common problem. The light beam goes through objects and, at best - ruins immersion, at worst - seriously affects gameplay.

With compatibility and performance in mind

Volumetric lighting beams are an expensive technique to render. Instead of supporting this system globally on every emitter (this would be ideal though) - it could be Instanced, for example - VolumetricBeam with configuration options available.

These new instances could be rendered in HD or use a lower-quality Fallback version depending on the performance of the device they are rendered on.

Developers could also tune this behavior manually on a per-instance basis to optimize distant beams while maintaining visual fidelity on near and important beams like player flashlights or overhead lighting.

These are just a few rough ideas that come to mind when thinking optimization, engineers will, of course, figure out a solution that works best for the engine. Compromises will need to be made to balance performance & visual fidelity.

image

Looking into the future of the platform

The market for realistic experiences on the platform is rapidly growing as the technology developers have at their disposal is advancing. To continue the innovation, developers are going to need more post-processing and lighting effects.

With so many new environmental experiences appearing on the platform lately, horror games, adventure games, and FPS games alike - there is no shortage of demand for this new technology. If implemented, it would be a groundbreaking achievement.

To conclude, here are a few example use cases where this technology could be leveraged. Some examples are not volumetric, but convey a compelling use-case.

63 Likes

That’d be a great addition. Sometimes I do have those projects where volumetric light beams have to play a role in. The only way to make volumetric light beam currently is to make a script that tracks those beams and applies effects based on these factors, but even then it’s not as great as the examples (yet works just fine)

9 Likes

It’s not even impossible to do. You can get a slightly hacky version of fully global, real-time, soft volumetric fog with Volumika, which I specifically engineered to be high-performance. The core research ideas there are completely open, by the way: Dynamic volumetrics in Roblox - Technical Fluff

I bring it up (not just as a timely and shameful self plug) because it proves that many of the fundamental components for a basic version of this effect already exist. The voxel grid stores volumetric light propagation info already. At a low resolution? Sure, but at minimum it is supported on all devices today, and the resolution is decent enough to reproduce most of the large scale effects people care about such as flashlight beams and low-lying fog.

I reckon that the only real obstacle is how to convert the 3D information into pixels on your screen. For this I would suggest some kind of half- or quarter-res ray march that simply collects colour and density along the ray - in spirit, similar to what my hacky technique does already. The only obstacles I see there are shader support on some older devices, though they seem to have successfully rolled out other ray marching techniques for cloud rendering before. I don’t think there is likely to be anything technically insurmountable here.

Beyond the baseline of simply transferring the 4x4x4 voxel grid light information onto the screen, there’s always room to increase the fidelity on more capable systems later, in a ‘graceful degradation’ manner.

So yeah, full support. Volumetric lighting is so important as a tool in a lighting designer’s toolbox. It is vastly undervalued.

8 Likes

Just use meshes for static lighting. It’d be extremely difficult to pull of volumetric lighting with dynamic lighting since they already showed it in FiB and the performance was so bad rtx cards couldn’t run it. Future also runs bad but not as bad as volumetric so I’d say it’s more important to optimize the current system which runs terribly rather than going even further the bad performance path. Also I believe that if we’d be getting dynamic volumetric lighting then it’d also need local reflections, blur reflections and physical particles to actually finish this effect… but with how badly roblox optimizes lighting their rt demo (which shows that we’re closer to getting rt than this) ran better so I can’t imagine volumetric with all those extras. Even if we’d want to add this stuff ourselves lua is just too slow :frowning: what elttob showed is totally pointless. What’s the point of the volumetric lighting that they showed if there’s no actual benefits that we use volumetric lighting normally for and just lose on performance :skull: also some of the games that you showed as examples actully fake volumetric lighting at times too, I’d say the real problem is the low-effort implementation of beams from roblox and not the lack of volumetric lighting on those examples

2 Likes

Unfortunately, meshes are not an acceptable solution to the underlying issue presented in the OP. This post was specifically tailored to dynamic lights - as the original beam examples have highlighted a fundamental need for this technology.

If you attempt to use MeshParts, Beams, or ParticleEmitters - the original problem remains and is often exacerbated. What happens when your flashlight is up against a wall? Perhaps a player is standing underneath a light? In each case, the beam goes right through. This ruins immersion and not an appropriate solution.

This feature request is outlining the need for per-instance volumetric light beams. I’ve updated the original post to clarify this. The performance implications of a global volumetric lighting system would be, agreeably - detrimental to performance.


The performance concerns brought up are valid, as mentioned in the OP - Volumetric lighting in general is an expensive rendering technique. This request was asking for instanced volumetric beams. Developers can better customize and control it this way.

The engine already employs a similar visual effect with the SunRaysEffect lighting effect. Of course, this is not exactly what I’m requesting - as the godrays are not rendered when you’re not directly facing the sun, nevertheless, it’s still shares similarities with the OP.

It’s important to clarify that I’m not a rendering engineer, my suggestions at optimization are “best-guess”. I’m convinced that if this feature is seriously considered, the engineers will find a compromise to balance engine performance and visual fidelity as mentioned.


This feature could take months, years, or may not ever come to fruition. The Future lighting engine could, of course - be improved. This is something Roblox is actively working on. The point of this request and others like it is to voice a need for this tech.

Constructive criticism and feedback is much more welcome than shooting down a valid feature request with lots of backing. Not to mention the unnecessary comments towards @Elttob and his impressive research & implementation of this feature.

If you have any helpful ideas on how to improve upon my request, I’d be more than happy to accommodate these changes in the OP. Regardless, this is the direction the platform is headed - developers need technology like this to keep innovating.

8 Likes

This still needs to be considered. Volumetric lighting is something I have been trying to achieve for years, and it is basically impossible to get a nice resolution real-time volumetric lighting that works with all light instances and from any angle.

While @Elttob’s implementation is nice, it has it’s limitations. It is restricted to the 4x4 stud voxel resolution, and doesn’t appear to cast shadows with sun light (in my testing at least) with ShadowMap lighting.

Many other game engines already have volumetric lighting.

3 Likes

This is technically possible with beams too but roblox had audacity to kill beam illumination through external light sources using Future lighting even tho in the FiB build it worked
Problem is Froxels would no longer blend/feather together nicely so yeah it’d need many beams. But yeah. It is def. possible for native implementation.

3 Likes

yall will any staff member see this post

2 Likes