Download

RASL - Upgrading the real time light by Hevedy

RASL
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.

https://dl.dropboxusercontent.com/u/28070491/UE/Forums/RASL/Before_After.png

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:

https://dl.dropboxusercontent.com/u/28070491/UE/Forums/RASL/Light_SunLightTraces.png

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:

https://dl.dropboxusercontent.com/u/28070491/UE/Forums/RASL/Light_SunTraces.png

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

https://dl.dropboxusercontent.com/u/28070491/UE/Forums/RASL/Light_SunTracesBounce.png

for example using one single line trace we can get a result like this:

https://dl.dropboxusercontent.com/u/28070491/UE/Forums/RASL/Light_Traces.png

…and the colors blend like this, more or less:

https://dl.dropboxusercontent.com/u/28070491/UE/Forums/RASL/Light_TracesColor.png

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:

https://dl.dropboxusercontent.com/u/28070491/UE/Forums/RASL/Light_ColorFinal.png

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:

https://dl.dropboxusercontent.com/u/28070491/UE/Forums/RASL/Light_MySolution.png

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.

Examples:

Original Matinee Scene (Baked Static Light):

https://dl.dropboxusercontent.com/u/28070491/UE/Forums/RASL/Baked.png

https://dl.dropboxusercontent.com/u/28070491/UE/Forums/RASL/BakedPreview.png

Original Matinee Scene (Real Time Dynamic Light, and using about 10 lights less):

https://dl.dropboxusercontent.com/u/28070491/UE/Forums/RASL/Realtime.png

https://dl.dropboxusercontent.com/u/28070491/UE/Forums/RASL/RealtimePreview.png

  • 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:

https://dl.dropboxusercontent.com/u/28070491/UE/Forums/RASL/GIF2Directional.gif

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)

https://dl.dropboxusercontent.com/u/28070491/UE/Forums/RASL/LightAll%20Sides.png

This is how get this feature working:

https://dl.dropboxusercontent.com/u/28070491/UE/Forums/RASL/2016-04-14_19-21-17.png

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.

Very cool Hevedy :smiley: I’ll definitely be taking a look at that!

Thanks you :slight_smile:

You here! Thanks you :stuck_out_tongue: ^^

Hey Hevedy, trying it out, but was getting a compile error for the RASL_LightActor and a whole bunch of stuff not connected.
Is that the correct link? I’m using 4.11, attempted to make the blueprint again, but something isn’t linked

when i load the RASL_LightActor BP it throws a message, saying I have invalid type, Light color.
This breaks the link to the struct inside the calculate Parameters.
Error Default value ‘NewEnumerator2’ for Index is invalid: ‘Expected a valid unsigned number for a byte property’
Material function was unlinked too, but that was easy to fix.

Is it just me? Does anyone else have any issues?

Thanks for the good work, keen to test it out.

Looking forward to trying in a few weeks once I check off a few more tutorial learnings.
The results looks great and make sense artistically.

The BP are made for the 4.11.1, said this make sure you place the 2 folders in the Content Folder, need to be in the root of the Content Folder or will return problems.
*Your problem sound like the Struct in the Core folder is not there.

Thank you Hevedy, I’ll update and give it a burl. Cheers mate

Yep you were right, working correctly now, on 4.11.0, but i’m only getting one light actor at a time. what else am i missing?

Correct you can have max one Box light and One Sphere light at time, as this post say is a free sample presentation of the RASL system (This is a demo post of how the base system works, the complete solution is not here and is paid.), the complete system will come to the Marketplace allow to manage the light you want with 16 render at time.

*Note you can use the engine code and do the same effect with the normal lights, and you can place until the max supported by the engine. (The engine code will be added this week)

This post is more a demo to developers of how I managed the light system, you can upgrade or buy my package later.

ah. fantastic concept then. Great idea and good work. look forward to seeing it out in the open.

Amazing Hevedy, I will definitely try this for my VR game and share the results.

Muy interesante, buen trabajo…:slight_smile:

Muchas gracias ^^

Just uploaded the Unreal Engine 4.11 changes to allow 100% no shadowed lights, you can use the amount of lights you want until reach the UE4 cap or reach your computer limit.

This new lights should cost less than the normal ones and can be used in Point Light, Directional light and Spot light.

Try to combine 2 Directional Lights one with shadows and other without shadows to get a simulated light results.

https://dl.dropboxusercontent.com/u/28070491/UE/Forums/RASL/GIF2Directional.gif

When is this coming out?

Sadly decided not release it (or atleast for now, as I’m using it for my games, and make the games take me all the time plus made the image tools app over that months.) There is another fact since Epic released the forward shading the core change of the engine dont work with it and on defered give some problems. If I release it in the future will ping to.

Thanks you.

Update on this one, I’m porting this system to the postprocess (4.21+) rather than use it directly on materials, now won’t mix with the materials so will result on probably less realistic result but less costly in general that will allow me to add more lights, aswell now is automated and won’t need to setup materials individually.

Aswell now can simulate light propagation rather than turn all at same level, as you can notice on the photo based on world normals (It won’t get occluded on the other side as a normal light)

It will come with a manager to world load/unload more news soon…