Dear global illumination, please pay rent.
incase you don’t get the joke (pretty dense if you don’t), The idea is I think about global illumination solutions so often it should ‘pay rent’ for living in my head.
(Fake Method) Iteration 1, 7/2/2021
Based on @testingacc333330’s fake GI system, In a nutshell I added a method for determining brightness and range based on object volume ((size.X,Y,Z)/3)
Comparison:
Testingacc’s method:
Note : The original source code has no Realtime features.Iteration 1’s method:
https://i.gyazo.com/874ef16c3f76fa7d08045a93b865c709.mp4In a nutshell, Iteration one added some important features to testingacc333330’s method, Mainly, Volume based Range + Brightness and an optimized refresh system
Commence many attempts at other ‘fake gi’ systems
(Basic RTGI) Iteration 2, 6/17/2022
(Roughly a month ago)
Got Content Deleted because I tested on a copy of the adopt me map (I got curious like an idiot and used a free model instead of an old roblox model)with vs without :
*atmosphere is enabled in both screenshotsThis system functioned by raycasting from a part (updated to match the suns position) down to a range around the player, the system did not support custom emitters and it had many issues with artifacting due to the ‘traci’ system (Placed points wherever the ray hits)
(Basic RTGI remake) iteration 2.5, 6/23/2022
Not important enough to showoff, it does almost the exact same thing that 2 does but rescripted and slightly changed to allow 3’s planned features
(Advanced RTGI) Iteration 3, 6/24/2022
(Shortly after Iteration 2)
Remake of Iteration 2, with many improvements including emitter probes and lifetime fadeDebug views (because they look cool)
With vs without:
This system was essentially a redesign of iteration 2, it included many new features like emitter ‘probes’, QuadBounce (rather than dualBounce), Traci Snapping (automatically snapping traci to a grid) and finally lifetime fade (fading brightness in and out over time). This system, while better than Iteration 2 still left me unsatisfied due to the continued artifacting, performance problems (when adressing the other issues with brute numbers) and brightness inconsistency
Actual quote on discord:
“I dont think it gets better than this, this is the prettiest dynamic lighting on roblox”followed up by watching Elttobs amazing video and realizing, no, it can get better.
(ENVRTGI) (4) Iteration 4, after some intense thinking, 7/9/2022
A simpler method with more realism than 2 and 3 and but mainly stability advantages,
In a nutshell, rather than Raycasting from the sun (part representation) or emitters, we sample the scenes colors (3 dualbounce raycasts) and blend them together with the previous color of the probe, after that we determine the brightness of each probe based on emitters and the sun (checking distance and raycasting to see if the emitter is seen), This process is as trimmed and simple as possible to squeeze the most performance I can out of it to prevent lag, The entire scene is updated every 2-5 frames and the system is lightning fast. (Screenshots when complete)
Something I very much wanted to do is sample the ambient light color aswell but that seems very expensive using existing methods (MaximumADHD’s lightlib or the modified version I have of it)
Now that the system is done I can confirm the performance is not as good as my previous system however it is smoother than iteration’s 2 and 3 when it comes to artifacting and updates, The new system also runs much faster.
More in-depth technical update below
(EGI) iteration 5
Another new method, i5 now samples using region3, it also samples lightlevel rather than using a custom system. Most info from i4 applies to i5 so im not going indepth with this one. however the i5 system is under the hood very different so it gets its now iteration number.
To add some footnotes, There have been a few other systems mixed in between the iterations I list above (like 7 or 8 alternatives) but most of them were horrible performance hogs or ‘fake gi’ like the original (too important to not leave out), so I didn’t include them.
When will any of my suffering be available for you to experience? I might release a plugin/system that can do Realtime GI for your games, But that will come when I cant squeeze any more quality or performance out of this icky game engine (if you can even call it that), I hope my journey of fighting luau for performance pays off.
Finally, What have we learned from this little journey of Global illumination? I cant stop making these, please send help.
Details on some stuff
What does RTGI mean?
RTGI stands for raytraced global illumination, The method of RTGI I used isnt pixel accurate and instead randomly raycasts, samples + blends colors of objects it hits then returns the color and brightness determined to the simulated ‘traci’
What does ENVRTGI Mean?
Instead of simulating rays from emitters, we instead sample the scenery colors (Environment) with probes via raytracing, we then check the distance to emitters, followed up by checking if the emitter is blocked by a wall or object, this determines the brightness of the probes. This method works well for many reasons, mainly it reduces artifacting however in a ‘what is more realistic’ sense it does loose to my RTGI systems, however realtime raytracing isnt really possible on a cpu, ignoring the fact its not really possible on a single thread running inside roblox.
What specs are you running?
all above screenshots are captured on my second pc, it runs on an overclocked 9th gen core i5, an overlocked GTX1660 Super and 16 gigs of ram.
I have tested each system on my laptop aswell (Ryzen 3, Vega3 and 4 gigs of ram) though iteration 2 ran well, iteration 3 and iteration 1 both chugged around 30fps and made the laptop extremely hot, Im assuming its because iteration 3 addressed artifacting with animated fade and more traci per frame (at a lower emission)
Edit History
(7/9/22 : 3:20ish am) – Post created
(7/9/22 : 3:34am) – Added edit history, changed formatting and corrected timeline
(7/9/22 : 3:37am) – changed formatting (again), fixed some grammar
(7/9/22) : 3:37am) – remembered I’m sleep deprived and forgot to update the edit history
(7/9/22 : 3:40ish am) – added some indepth explainations and my specs
(7/10/22) : 4:13ish am) – updates and new reply to demo new iteration
(7/11/22) : 2:01 pm) – added i5 to iteration list