How can I get volumetric lighting

So ive recently been making some research about volumetric lighting also known as “god’s rays” technique, I know this question has been asked before but every time I see it no one answers it correctly.
Im aware roblox itself does not has volumetric lighting HOWEVER, along the years ive seen people managing to do it in pure studio without mods or shaders.
For example this user managed to use a method using beams to render volumetric lights in real time perfectly (Not the cheap beam on a spotlight technique)


So apparently this method used to work with future lighting but roblox made pointlights not influence beams there fore now it only works with sunrays
Here theres another user who worked arround this using billboard GUI’s wich I do not understand exactly how but he did it.
image
I am aware this probably requires math to do so but I am dedicated to learn it in order to get this to work, If anyone knows how these tricks work I would greatly appreciate it.

EDIT: when researching the billboard GUI method I placed a giant billboard GUI with an image label with a white png image, what happened was this inetertesting discovery.


I do not know yet how to make this look nice but maybe ill figure it out.

22 Likes

Maybe this person can help you out:

4 Likes

Hello, I did saw this post previously while doing my research, unfortunately, I tried this person’s method and it is very slow also it seems to not look as good as the other methods.

1 Like

I have found this post that seems to have the answer, although he still does not solves the billboard GUI method he is giving me somewhere to start from.

He seems to cast beams into the camera?

2 Likes

The only way to achieve this effect is by using beams. Are you sure the user in the first project isn’t using beams?

The other image is from a hack project a Roblox engineer made. It wasn’t production ready but maybe in a future version of FiB it will be.

The first image was indeed done using beams, however the beam system would actually cast the beams in real time and they were not put there, In fact the user who made this has plenty of showcases and ended up releasing the script for making this, however FIB v16 seems to have broken this method with pointlights and lighting objects since beams dont seem to be influenced by pointlights anymore and only sun light.

Heres me testing the first method’s tech although it doesnt look as astonishing as back then sadly, back then it looked amazing
image

3 Likes

May I ask what game is that?
05926a6a3a1e0f6930184731432d96b972e260fb_2_690x350

3 Likes

this isn’t a game it was from a video of a guy showcasing a script that allowed volumetric lighting to be created by rendering some beams into the camera on a way they would catch light.

1 Like

Hey! I have been experimenting a way to get this too. I was able to get some sort of volumetric lighting like this.

I think this was uhh particle and some how more performance while in the laggiest spot…


With billboard it kinda doesn’t show for some reason and I forgot where I put the image for it.
also the place that is in the above image is here: Deserted Area - Showcase - Roblox

And this was billboard gui! plus some meshes plane which I improved the version of this person here! (Laggy volumetric lighting) Thx!




The upper image got 16 planes, 16 billboardGui I think and 2 Studs apart I make this for a friend and also I want to test on his place, some spot of his game got like 2 million? billion? trillion? tris I forgot and when in that spot it lowest fps hit was like around 45-60.

Also am trying to optimize this by bring it tris count to the same as beam in this post here

Code!!!

Laggier version!!!

3 Likes

I recommend using Volumika as it is the fastest volumetric lighting engine in roblox, sadly its not as cool as the old beam hack, but it gives desent results.


been using it for my game, only issue is that it costs like 50 dollars…

4 Likes

But it sadly restricted to voxel lighting I tried to recreate it and it does work. Still that is not my aim but it a solution at least but what I want is the shadow of every possible size of object ever.

Also from my testing setting the particle lifetime over 20 entirely broke my math and the sizing wasn’t linear anymore and I must use a lot of froxel because of the big area and the bigger particle size the more it get compress?.

And using a lot of froxel will increase tris count because each particle emitted got 4 tris and the larger the size of the particle also make it lag. While I use a flat plane mesh that is static, doesn’t move, does have realistic shadow ( maybe that the performance issue ), one draw back it doesn’t work with all angle so I much double the tris count ( either with billboardGui or another flipped normal inverse mesh using CFrame) now it the same with particle and it always follow the camera.

But on Volumika I haven’t bought it!!! just only remake it naive system (someone tell me if this is legal to distribute I asked AI and it says it pretty blurry) but what I think what the system does is: it get a froxel host part that hold all of the froxel which is an attachment with particle inside and then make that part follow the camera as usual.

And then use Pythagoras theorem to make each of the particle from each froxel align with other froxel and use speed multiply by lifetime to get its range and make the attachment lookat that position, and then maybe some vector magnitude thing divide by the lifetime to get the speed so it doesn’t spawn particle at the wrong time with other which is very hard to do.

And for how large the area must be cover the more froxel attachment need to use, While I can get a meshpart and change it size to max of 2048, 2048 (x, y), larger if I can use double side with special mesh ( but it isn’t needed right now ), I don’t know it cause any performance issue based on the size though since it should always be the same tris(2) right?.

while particle got point physic simulation, sizing system based on lifetime and a bunch of particle being emitted based on rate property which each one costing 4 tris still some how performance than meshpart with only 2 tris and static is quite insane for me I have tried research it but it seem like literal LITERAL black magic on how it works like that.

1 Like

i think volumika does has an article on how they did it, either way your system looks pretty desent so gl with making it.

1 Like

Thanks.

Also can I ask which video? The picture in question looks like it was a mesh, I might try that method instead of the cheap old beams trick.

It was from this guy

in this video

It uses beam, planes of beams, beam cost 2 tris, meshes cost 2 tris but you need another instance to catch light when it behind because the backside of meshes doesn’t catch it so some people used billboardGui which bring the total to 4 tris, am still wondering when will light influence work with beam :sad:

4 Likes

Volumika does amazing for catching large ammounts of lights in environments and blending them, but this trick worked amazing for sharped lights, im so upset roblox removed the abbility for lights aside from the sun to influence beams, makes no sense why.

1 Like

Yeaa, now we must use a flipped plane mesh with a billboardgui so that it can catch light at all angle making the performance even worse now

but wait… if beams are just a single plane mesh, couldnt we recreate the exact way this old trick worked by instead of using beams just plane meshes, would that be too laggy because of all the resizing and CFrame stuff from meshparts?

Beam react to light when light is infront of it or behind it.

While plane mesh part doesn’t, even castshadow is off even doublesided is on, even if it normal is flipped either using CFrame.fromMatrix or using special mesh scale property, light will only appear in one of it surface, unless well you scale the plane mesh so that it doesn’t look like a plane anymore but more like this while it normal are also flipped.


And when it come into contact with light, light will shine on both of it surface it just that the light is split in half and display half of it evenly on the 2 surface.

So that why we need billboardGui, the flat plane mesh is for using to catch light that are behind it and displaying on it surface, while billboardGui always faces the player so it will catch light is the light is infront of it.

This techniques uses 4 tris and when you scale it up it start to get more intensive on performance versus beam which only has 2 tris and work all the way.

Also I don’t think it will be too laggy the resizing are done before hand and put into a model, the model has a primarypart so that it can always use :PivotTo to the camera CFrame and that literally it.

Setup → Attach Planes Host to Camera CFrame

Here is the picture of the plane mesh that is scale in a way so that it worked on both surface.
Light infront:


Light behind:

it just that the light are split in half.

Also must be rotated correctly or else it will have this thing:

If I’m not mistaken you can also achieve similar effects with particles, do however keep in mind that using anything with transparency (particles, decals, billboards, etc) can cause massive overdraw which might bottleneck on lower end devices.

1 Like