[WIP][Asset] Dynamic Light Probes for Unity Indie, Pro, Mobile

Hello everyone. I am a member of the team developing games for mobile platforms (or at least trying to do it…). While working on lighting, I invented next wheel and named it Dynamic Light Probes. It may be used for the lighting of movable objects. Works with all platforms and licenses, in all rendering paths. Does not break dynamic batching. Just leave all lights in the scene, the system will do the rest. You can change light’s parameters (position, range, intensity and color) in runtime.
Stress test on Nexus 5. 1156 animated lights (and dynamically batched barrels).

This system allows you to do dynamic lighting without increasing the number of drawcalls. And without a big performance hit. It bakes all light’s data into a sort of “light volume”, which is available to any object in any time. It can be a static geometry with precalculated beast-lightmaps, which can be illuminated by dynamic light sources further , or it can be dynamic objects.

Advantages:

  • Editable and movable “light sources”. Theoretically unlimited amount
  • Dynamic objects, static objects.
  • Dynamic batching.
  • Different types of “light sources”.
  • “Working Area” around the camera or other world point. You can control balance between quality and perfomance.
  • Should work with all versions of Unity (tested on PC and Android). In all modes of rendering.
  • No blending or alpha test (mobile friendly)

Disadvantages:

  • Problems with the height difference (although changing lighting supported in some way). Requires sophisticated algorithm. Working on it.
  • Lights not respect obstacles. Requires sophisticated algorithm.
  • With a small number of light sources, the benefits are not obvious (special shaders for objects used, not “free” for GPU).
  • Large areas require big amounts of data (Can be adapted by changing light density / quality).

I’m wondering what you think about this. Will it be useful for you and how much you think it’s worth?

3 Likes

This is clever, (even though not many people can find a use for it)
But it would be cool to use those lights on a ufo :p. Which I think I will use it for eventually. And I think 10$ seems like a fair price

Do you mean there are no people who want to use tons of lighting sources at one scene (lanterns, flashlights, fireplaces, alternating with the time of day, etc.)? I think its not true.:slight_smile: But with “real” lighting you drown in the sea of drawcalls (actually you have to tell it “Goodbye” on mobile platforms, if you are targeting on the wide range of devices).

1 Like

Maybe you can say more about what this does and how it can be used? And what its limitations are? I’m interested in dynamic lighting and solutions that will work for higher level mobile.

Here is another example. At that screenshot you can see the scene with free assets from Asset Store. It is illuminated by 17 light sources. As you can see, all barrels batched in 1 drawcall, as they have the same material (men does not batch because of skinmesh). You can move lights and change their parameters, the number of dc and performance is not affected.
p.s. #1 message updated.

This could be really useful, anything that saves drawcalls but still have dynamic light is important to me.

Working on optimization. Stress test video added (check #1). 1156 animated point lights (and barrels).

Looking very impressive, any chance of a webplayer demo ?

any updates on this ?

  • Spot light type added
    1712573--107882--spotLight.jpg
  • Still working on correct height algorithm
    1712573--107887--LightHeight.gif
  • Optimizations

Looking really good, the spot lights great. Will this support any form of bump mapping?

Well, as I wrote earlier, I’m interested in mobile gamedev and complex per-pixel lighting is not very good choise for it. Especially considering that in DLP getting a light direction is not so easy. Nevertheless, it is possible, by use of a few tricks. Although for the tangent-space normalmaps, you’ll need gles3 support, but for world-space it’s much easier, and gles2 is enough. As you can see, this trick also allows to light objects almost correctly, based on vertex normals.
Image

Can lights be created at runtime? What are you actually doing on the assets, vertex color?

Any time scale for a release ?

No, you can’t do it for now, for the performance reasons. But you can turn it on / off (and use something like ObjectPool).

Actually, I do not touch it. Perhaps in time, i’ll try to keep some information in the attributes of vertices for optimization.

I work on demo scenes that will help to represent system abilities in details.
Image

1734521--109486--dlpScene.jpg

How are you doing this? IT LOOKS AWESOME!!! :slight_smile:

Also, a free version would be great. Means I could spruce up one of my mobile projects for free. all I really need though is a good (and Unity-free compatible for $0) light probe system.

This cant come soon enough.

@dirtybassett : please state what you mean! I have no idea what you’re talking about! :slight_smile:

I ment that a system like this will greatly improve the look of my environments. Can only get so far with static lighting.

@dirtybassett : Agreed! :slight_smile: