Realtime Global Illumination 'Tegi'

Introducing i6, My new Realtime GI system.

Quick thing before we dig into the details, Sorry for the sheer amount of posts relating to my GI systems, I’ve worked on 6 different systems so far, each a massive improvement to the last, I enjoy documenting the systems and how they work.

Terminology for this project :

Emission - refers to brightness
EnvAmbient - refers to the Environment Sampling feature (EGI)
Realtime - refers to the ability to run dynamically and smoothly (NOT instantly)
Traci - referring to Three Rays (Trace + Tri)
TEGI - A combination of two systems, RTGI and EGI

What does ‘TEGI’ stand for?

TEGI breaks down into ‘Traced Environment Global Illumination’ What does this mean? Its not possible to make the system run smoothly on every device with a high number of traci (Triple bounce traces), The solution comes from the ‘E’ in ‘TEGI’, Using environmental data to affect the final image, In config we refer to this as ‘Environmental Ambient’, Using Roblox’s workspace:GetPartBoundsInBox() functionality allows us to scan a small region around each GI probe without casting even more rays, when sampling the environment we do this twice, Scan 1 includes the entire game world, the final color it outputs is then divided by an intensity, Scan 2 includes only the RTGI traci (Represented by parts), We then combine the two colors with C1:lerp(C2, 0.5) this outputs the final color of each emitter. What about the T?, The tracer system uses a triple bounce raycast system with a ‘limit per frame’ value, It is impossible to get ‘true’ Realtime Realtime RTGI on the CPU so we trace roughly 125 times a frame then approximate the rest of the RT data.

How do you ‘project’ the GI into the scene?

Rendering everything in GUI’s wouldn’t be performant enough for this system (keep in mind its intended for genuine usage), So we simply use Roblox’s built in light emitters with shadows disabled and a very low brightness (Referred too as emission), To keep the scene running smoothly we have a limit on how many ‘probes’ can be rendered at once.

Enough Details, How does it look?

note: Both ROBLOX’s ambient and envambient are disabled for the demos below.

Scene 1 :

On


Off

Scene 2 :

On


Off

Scene 3 :

On


Off

Cool, but you mentioned performance a few times…

In this case performance can mean a few things, in most areas this version succeeds,
Goal 1 : Make it run on mobile (50%)
Goal 2 : Make it Perform Realtime (100%)
Goal 3 : Make it production Stable (100%)

Why is mobile a 50% instead of 100%? Mobile can only perform well relying on ENVambient for most of the visuals instead of the true RTGI solution

How can you configure TEGI to run smoothly on mobile?
50-100 RaysPerFramePerV
0.25-0.5 ENVAmbient

What config did you in the above demo?
100-250 RaysPerFramePerV
0 ENVAmbient

When will I see this in an actual game?

You can check out ‘horizons’ an earlier demo containing some of the methods used here however the stability and performance is much better than previous systems.

Who has access to this system?
Until I build a new i7 system i6 is closed access, mainly to my friends and team members.
What about previous systems? i2/i3 (Now combined) will release to the public when I feel like polishing and cleaning its code, i4 and i5 will likely not release as they aren’t ‘true’ GI.

Edits

Added ‘edits’, Fixed grammatical mistakes - 7/17/22
Fixed more grammatical mistakes - 7/18/22

8 Likes

This seems promising, can’t wait for more improvements.

2 Likes

This seems very promising. Excited to see where it ends up!

2 Likes

I feel obligated to share, this project is cancelled. Why? I’m leaving ROBLOX. I’ve begun working on a game framework built on top of Love2D (a 2D lua-based application/game framework), using the existing G3D renderer as a basis for 3D functionality I’m adding ROBLOX-like features (mainly a lighting implementation similar to ROBLOX future). Im not sure if I can share mediafire links or discord links (for people to be able to check out the project) So Ill give a few screenshots before I go. (Ill update with github links later on maybe)

Even if I do opensource this project I want to add it wont have an editor, everything has to be done programmatically or via other softwares.

note : Scene is a 3D scan from sketchfab - lighting baked in blender (Realtime lighting is incomplete)


image

2 Likes