"Real Time" Light Bouncing in roblox!

Post name says its “real time” and not real time because the way its scripted is a little predictable, but it does render in real time (and only within a set distance) to keep framerates up.

So I got bored, and an hour later I made light bouncing in roblox with no external tools or research on how this stuff even works.


The old system has more accurate colors in smaller rooms for the most part, but gives off too much light.
It’d be good for showcases, but not suited for games.

Old System

Before:


After:

Before:


After:


The new system is much more accurate in larger rooms I’d say, with the lighting being more realistic than it was, and I’m still working towards making it perform as good as I can!

New System



I managed to keep performance pretty good, staying around 60fps the whole time while moving the camera around, however the system does not at all work when there’s a lot of lights near eachother, and it majorly slows down raycasting with larger lights.

Did I do good and what could I improve?

Edit:
After (many) optimizations for the client, it does finally run at a good framerate in the roblox player and still look (nearly) as good!
(It was unoptimized for the player, but ran in studio just fine)
image
image

If you want to try it on your computer, you can here.
(Note, it brings my framerate down from 165 to the numbers shown in the screenshots)

Also, let me know if you want me to release this as an asset or something!


UPDATE 15/11/23

The system now fully supports surface lights!


Just have to create spot light support and I can release it :smiley:

28 Likes

That’s pretty good.
good work!

5 Likes

Looks so good. you can keep improving it and making it better and then release it as a plugin with money or a open source module

4 Likes

This looks good. Nice job on it.

3 Likes

Cool…!

I’m sure if you released this to the public, people could do some pretty cool things with it.

4 Likes

I’m planning to eventually release it, I’m just cleaning up the code and making it run as good as I can beforehand.

6 Likes

can we try the system in studio?

3 Likes

I’m not open sourcing it just yet, it’'s still very unfinished and only works with point lights at the moment, so no.

Who would have thought trying to make such a system with no research would be a nightmare.

3 Likes

btw just wondering how did you make the light like did u use frame or use roblox lights etc cuz this got me interested

2 Likes

It uses SpotLights that face away from the surface they’re placed on.

Due to the amount of lights, they’re brightness is set really low (about 0.04) and the brightness decreases the further away from the base light it is.

There’s several settings to increase or decrease performance using this, and the ability for people to make custom settings to increase performance even more.

Of course, too many lights will cause this issue:

And just because I can, here’s a screenshot of when I started developing the system:


(If I were to visualize the rays now, it would look very different)

2 Likes

so ur making a raycast that fires around the light then when ever it hits it creates a attachment with a spotlight inside?

3 Likes

if im right then is it gonna be laggy since u fire raycast many times

3 Likes

and i was think what’s the difference of volumetric and what u doing rn? is volumetric harder or complicated to make?

2 Likes

Correct.

Its pretty optimized and using an RTX card, the performance is usable.

Well I don’t actually know what you mean by volumetric exactly.
If you’re talking about something like Volumika, the difference between that and this is that Volumika simply adds volumetric fog that reacts to lights.
This light bouncing system makes the light bounce around and colors lights based on the color of whats hit.
For example, if a raycast from a white light hits a pink wall, the placed light be tinted around the same pink.

1 Like

fog, is it gonna be laggy if u add beam that looks like the fog? like start from where the light cam from to where it goes or hit and reacts when covered but since i saw many of these kinds of project i was inspired and wanted to make one and make games better since roblox lighting is not very accurate

1 Like

hey, i really like your real time light bouncing suystem, well i’m doesnt look that good. I’m trying to figure out how i can turn out good but your is the best one i seen. Well, would you gonna release this as an asset or model? That will help me a lot. Thanks

2 Likes

I’ve been working on it a lot, but it still isn’t ready.

When I do release it, I’ll probably release a free and paid version, where the paid version is simply there in case you want to support the work I’ve done on it, but it’ll have extra features like previewing lights without running the game.

I did partially explain how the system works however, so if you want to try and rescript it, go ahead!

2 Likes

when will be the release? can’t wait to try

Unsure, I only just got surface lights (partially) supported.

There’s still some possible issues with them, so I’ll need to test it further.

Once that’s done, I need to add support for Spot Lights, where I have no clue where to begin. The raytracing system is completely done, but I have no idea how to raycast in a circle, so I’ll need to research that.

i never tried fastcast but does it only for projectiles or smt that can be used?