I’ve been working on this for a while, and it’s come to a point where i can’t improve it much.
I’ll skip over the volumetric lighting, but i’ll show pictures of it, it’s pretty simple and performant.
My main focus to discuss is the volumetric fog, which I think is quite welldone and is very performant.
I had 2 main issues when starting this,
1, how do i cover a whole map while keeping performance?
2, how can i make it so it’s seamless (very close) and doesn’t move in a way that messes up your immersion?
For issue 1, i created a zoning system, allowing you to have a huge map covered in fog. The way it works is just by well, only rendering fog in the area you are in, meaning the amount of drawcalls is heavily reduced. Now transitions between were a problem but i’ll mention how i got around them in a second.
The next issue, at first I was rotating the fog around the origin of the zone itself when you turn, so if you’re at the edges, it’ll just disappear. My fix was to make it so the beams move and rotate with you in the fog area, making it practically seamless. This also fixed the transition issue, only resulting in an extremely quick flicker (video demonstrates)
This looks so cool, I’v been looking for better volumetric/fog for ages than what I’m currently used to working with, and this blows it out of the water. I can imagine a really cool silent hill type game with this. care to share your secrets in how it’s made or how it works ?
The principle is quite basic, it’s just a cube that is full of layered beams. Now, getting it to acutally look like fog was it’s own thing, but basically beams closer to you are more transparent, further are less transparent. I also simulate density depending on your postition in the volume. It also moves with your player in such a way that it makes it always face the “right” direction i guess, so like rays in the fog stay, instead of disappearing at certain angles.
i’ll probably work on a test place in a bit to demo it a bit
When I tried to use beams, I had a few issues, one being that it was really obvious to see the “layers” of beams when colliding with parts and objects which looks really jarring, increasing the amount of beams to try create a better gradient impacts performance more than I’m comfortable with, so I settled with using BillboardUI’s, which I think works as a decent alternative for volumetric lighting specifically since performance can be easily managed by the MaxDistance property, so the billboardUI’s aren’t drawn outside of a certain range. However it also has a similar problem with rays disappearing at certain angles.
If you do create a test place, let me know, I would love to take a look at it.
This volumetric lighting and fog system looks great and unique! Nice job on creating it! How long did it take to make it in total? Will you use it in anything? It makes Roblox look cool and realistic!
thanks, it took a while to get everything looking good, about a few weeks
plan on using it in a possible horror game and an FPS game i’m working on at the moment
had an old message included with this so mind the edit lol