Realtime Artistic Simulated Light
This is a demo post of how the base system works, the complete solution is not here and is paid.
x~1.25 more expensive than of a total baked solution, while the less expensive real GI solution is about x~1.45
Note a complete scene using a directional light and skylight in real time is already x~1.20 more expensive than the total baked solution.
RASL is a package of tools to upgrade your level realtime light at next level, supporting day-night cycles, simulated GI, and simulated lights at low cost.
Note: As the name say, this is a simulated light solution, no a real light solution, if you’re looking for something automatic and real, this system is not for you.
This is a good low cost system, can be used in all type of desktop computers and give about 20FPS more than the first less expensive GI solution (LPV)
This post will be updated until the end of project
The final package aim to the marketplace, but here I will give the bases of the system for free under MIT license (The engine code changes and the shader material base) feel free to use this in commercial or non commercial projects (Games, tutorials, films, ArchViz…), but no in other marketplace content.
The aim of this project is get results simulating the light from bounces to light blends etc (all in realtime)
How the common light works:
Imagine we got a box scene like in the image:
The Blue top box is a spot light, while the right yellow is a window with the light that come from the sun (a single Directional light).
By default as the line traces show the light comes in one single direction, this don’t give us the result we want when got a room with one window from where the sun comes.
In a real room the sun light bounces in the surfaces until don’t have more energy, as this images show:
when the traces touch the walls or other objects absorb part of the color, this depend of the color intensity and the power of the light, the sun got more power and energy than the normal light in a common case
for example using one single line trace we can get a result like this:
…and the colors blend like this, more or less:
after this, and after know how the light bounces and taking note that the spot light bounces too and mix with the sun and the colors of the walls, at the end we should get a result more or less like this:
Now you know more or less how the global illumination works more or less, as fast intro.
The common GI light solutions try to simulate this at real time, the lightmass baker of Unreal Engine 4 try to simulate this too. Usually this methods are automatic and take time to simulate the light.
So,my solution looks more or less like this:
The base of this solution is, place over the map spheres and cubes that simulate the light of the bounces and can be changed in real time
Note: (Are not real lights, but can be used with real lights).
The max amount of lights in screen are right now 16, you can use less or add more, but this will add or remove performance, since you need overload all the materials in the scene with the new function.
Original Matinee Scene (Baked Static Light):
Original Matinee Scene (Real Time Dynamic Light, and using about 10 lights less):
Why you made this ?
Since I don’t get a true solution to simulate GI in real time or a Day-Night cycle and the GI solutions (In Alpha/Beta status) are pretty expensive, I decided to make this.
- What is the performance ?
Each material used need to be overloaded with a new function to simulate the light. (Or you can use only in the models where you want light simulation).
- This light can affect particles and non static models ?
Yes, just add the new node over that materials you want.
- This work for VR or DX10 ?
Yes and Yes, this is the only method to simulate GI that can be used over DX10 (Shader Model 4).
**Engine changes: **
Engine Fork: https://github.com/Hevedy/UnrealEngine/tree/Hev_RASL_4.11
Download and compile and other versions
(The shader and the code needs updates but in general is more expensive since need do one if more in each light the difference with two directional is 132FPS in the vanilla build and 127FPS in the build with this shader)
To use the new feature you can place a light in the map and uncheck the Bool Cast Shadows, you will notice the difference.
The new lights shader are free for all under the MIT license. (Only the code added)
This new function help to simulate the light bounces since, don’t give any type of shadows info.
This image show the use only of x2 Directional Lights 100% real time:
I’m added a new function to all the light types, to ignore the models shadows, in this way, you can simulate better the GI bounces without shadows in the models (This lights will ignore the walls and all models, so try to no place where are 2 sided walls)
This is how get this feature working:
Pros: (Complete Version)
- Can be used with DX 10. (This include OpenGl 3.2 too but no tested)
- Can be used in all materials, in a single material or in the materials you want (Only the ones using the node are affected by light system)
- Up to 16 lights and one ambient color (You can add more, but will add extra cost to the materials)
- Less expensive than common lights.
- Project the light in all sides, something the normal light wthout shadows can’t do.
- Artist driven.
- Can blend the color of the light in 2 zones.
- Pretty low cost system.
- No need of bake light.
- Support day-night cyles.
- Can give negative values to the colors. (Creating dark zones)
- Can be used with VR.
- Probes to change the light in different zones and be affected by colors.
Cons: (Complete Version)
- Max 16 lights at same time in the camera (You can add more, but will add extra cost to the materials)
- This system add cost to all the materials using this node.(Material overload)
- Not a real light solution.
- Volumes can’t be rotated (This is a possible problem if you think in use the box zones).
- Don’t affect the material properties as other solutions do.
- Since project light in all directions, the walls leak light in the other side (Something the artist should control)
- No automatic system.
- Preview limitations in editor.
- Don’t support 100% white or black surfaces.
- The scene need to be well lighted in some cases.
- Need edit the whole project, scene and materials to add the system.