Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

[RELEASED] BG Light Engine (With Real Time GI Area Lights)

Discussion in 'Assets and Asset Store' started by brilliantgames, Mar 13, 2014.

  1. kurylo3d

    kurylo3d

    Joined:
    Nov 7, 2009
    Posts:
    1,123
    How exactly does all this stuff work in terms of scene set up? Do we generate or place cubemap probes? Or is this some other method.

    Also what is a "GI light"?
     
    Last edited: Oct 22, 2014
  2. JecoGames

    JecoGames

    Joined:
    Jan 10, 2013
    Posts:
    135
    LPV is a method that includes reflections, they are best used with screenspace reflections to make the quality better but are still acceptable without,no cubemaps used. I expect that a "GI Light" is a light that contributes to the global illumination.
     
  3. kurylo3d

    kurylo3d

    Joined:
    Nov 7, 2009
    Posts:
    1,123
    I am still so confused. As much as I am interested in this product I wont be buying it if i dont understand it or its workflow.

    lpv is a method u say... a method of what? is it a camera shader for screen space effects? is it a material shader...? is it box projected cubemapping? is it realtime reflections?

    A tutorial video would be great.
     
    Last edited: Oct 22, 2014
  4. JecoGames

    JecoGames

    Joined:
    Jan 10, 2013
    Posts:
    135
    LPV(light propagation volumes) is a method to approximate global illumination (including specular) by using the direct light information from shadow maps and do some fancy spherical harmonics stuff to calculate bounced light. This information is then stored in a 3d texture that is used to shade objects. To make a long explanation short its a global illumination solution (including real time low res reflections) that is used in Cryengine and now Unreal. However it suffers from problems such as light leaking and very performance intensive.
     
  5. kurylo3d

    kurylo3d

    Joined:
    Nov 7, 2009
    Posts:
    1,123
    Whats the set up like?
     
  6. JecoGames

    JecoGames

    Joined:
    Jan 10, 2013
    Posts:
    135
    Well its completely real time if that's what your asking,so no pre computation, also forgot to mention one other disadvantage, it's only one bounce GI
     
  7. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    12,992
    I remember i had seen a similar technique video for Unity a while back. I wonder what happened to that one. Was it ever released ?

    I also remember a DX11 only asset, i dont know if that was released either, but for sure i cant find either on the store.

    EDIT: Here is the video, is it using same technique as this one ?

    http://www.polycount.com/forum/showthread.php?t=125297
    .
     
  8. kurylo3d

    kurylo3d

    Joined:
    Nov 7, 2009
    Posts:
    1,123
    I used to be all about wanting things to work for dx 9, but now i dont mind dx 11 only at all.
     
  9. brilliantgames

    brilliantgames

    Joined:
    Jan 7, 2012
    Posts:
    1,937
    Are you sure 3d textures require pro? I did a quick test on my laptop which has free and generated a 3d texture and it worked.. However I didn't apply the texture to anything. Can anyone confirm this? I thought only 'Render textures' required pro?

    Edit: Just went over all the textures in documentation. All the textures that require pro, say so. 3d textures say no such thing. ;)

    The whole system works on a single 3d texture currently. Setup is extremely simple. You add a light propagation volume, and whatever light you want to use gi just add the 'reflection capture' script to it. The light propagation volume can be scaled to whatever resolution you want. Cascading is definetly something I want to happen to allow 'seamless' and gi for large open environments.

    Also, it can be more than one bounce of GI. It's not a complete twin of Cryteks system so lets not get away with speculation just yet. ;) 'GILights' come with the current version on the asset store, they are not used for this new system, there are no individual lights. The GI lights were pretty much a cheap circular area light which you can use to efficiently fake GI.

    The resolution of the reflections is all down to what texel size you use combined with high res reflection capture. The smaller the size, the higher the res.
     
    Last edited: Oct 22, 2014
  10. brilliantgames

    brilliantgames

    Joined:
    Jan 7, 2012
    Posts:
    1,937
    No that is voxel cone tracing. You may be confused with Unreal engine. They implemented that technique but it ended up being too slow for production(From information I have gathered it actually looks like Unreal may be adopting LP because a game studio integrated it). When I really decided to dive into light propagations, I began to really understand why it works so well for current hardware. In my mind, it seems like the only logical way to do GI properly now days. Even in the future, just improve on it.

    As something to note. The system is beyond perfect right now. There is light bleeding and a few problems with the diffuse approximation. Like I mentioned it's in rough shape currently, but I am showing it off cause it is now working. This is probably one of the only function light propagation systems on Unity that I have seen so far.
     
  11. brilliantgames

    brilliantgames

    Joined:
    Jan 7, 2012
    Posts:
    1,937
    Directional light and a clear view of both diffuse and specular reflections. Scene runs 300fps.

    Don't forget to right click and open in new tab for high resolution. :)

     
    jcarpay, Baldinoboy and blueivy like this.
  12. Baldinoboy

    Baldinoboy

    Joined:
    Apr 14, 2012
    Posts:
    1,524
    My word man that is beautiful:D. I mean. Wow. This is a realtime scene? You rotate the directional light and the reflections will change?

    Does this still require custom shaders? Would not be a problem for me but I am working on the terrain and as many might know messing with the terrain system is quite difficult. I so badly want to test my jungle scenes with realtime gi.

    3D textures were pro only. I am 100% sure when they came to Unity it said pro only. The Unity team must have put it in at some point. Cool:)

    My specs are not up to UE4s' standards but it is still usable. When I enabled the lp a tiny scene becomes unplayable. I have also used Cryengine and its system is more usable. I know it is early to ask but what do you expect the performance to be with small and large scenes using this new method? 300fps in your latest shot is a good sign.

    By the way. Send loads more screenshots. Love to see them;).

    Edit - One more question:rolleyes:. Can this system deal with 0 ambient light and still light up a scene? Can not wait for the day where I can walk in a lit forest and go into a pitch dark cave without any scripts. Sorry for the rambling. This thread makes me droolo_O.
     
    Last edited: Oct 22, 2014
  13. blueivy

    blueivy

    Joined:
    Mar 4, 2013
    Posts:
    615
    This + Jove would look godly.:eek: The specular reflections do look a little "off" though.
     
  14. brilliantgames

    brilliantgames

    Joined:
    Jan 7, 2012
    Posts:
    1,937
    @Baldinoboy This is as real time as it gets. Move the light, the reflections will change, move that sphere, the reflections will change, the walls, anything.. It may likely require custom shaders, however, since this is so incredibly easy for the video card to process, it can be done in a single pass, so adding it to any other custom shader should be done very easily.

    As for performance, like I mentioned the video card makes short work of it.. However because there really isn't any way to generate textures on the video card(Except maybe with compute shaders), the 3d texture has to be generated on the CPU. It is still fast, but the higher resolution, the more CPU, if this system continues to require the CPU I will try to implement some threading to allow room for scripting(Though we know it will be handled much faster in Unity 5 with 64 bit).

    As for ambient light, of course. This is what it's built for. The screen shot you see here has zero ambient lighting.

    @blueivy You can't expect to use this system for mirror like reflections(Unless you use VERY high resolution volumes). And the specular reflections still have a ways to go. You may notice you can see through the bottom of the sphere in the reflection, that is because back-facing occlusion has not yet been accounted for. Do not fear though, I have solutions for most of the current problems. One step at a time though! ;)
     
    Baldinoboy likes this.
  15. Baldinoboy

    Baldinoboy

    Joined:
    Apr 14, 2012
    Posts:
    1,524
    Awesome. Thanks for the info. Do not forget. More screenshots;).
     
  16. JecoGames

    JecoGames

    Joined:
    Jan 10, 2013
    Posts:
    135
    I'm not too sure... I tried using 3d textures in unity free....didn't work,tried same set up in the 30 day pro trial(just to test) they did work. Maybe that's changed but I'm doubtful.
     
  17. blueivy

    blueivy

    Joined:
    Mar 4, 2013
    Posts:
    615
    Is there going to be an option to control the intensity of the GI? Like boosting or lowering it. Also a nice Sponza demo would be cool.
     
  18. brilliantgames

    brilliantgames

    Joined:
    Jan 7, 2012
    Posts:
    1,937
    Unfortunately, you are correct. I did further testing on this. Though Unity free does allow you to create and modify 3D textures in C#, when you bring it into a shader, it's non existent. I will continue to investigate other methods of going about this but it's pretty unlikely a giant 2dtexture would suffice. This method highly relies on 'texlod' with trillinear/bilinear filtering on all 3 dimensions.

    @blueivy Your wish is my command. I can't yet give you guys a real time demo because it is too rough at this point. but I can give more screenshots. :)

    Don't forget to right click and open in new tab for high res!

     
    blueivy and Baldinoboy like this.
  19. brilliantgames

    brilliantgames

    Joined:
    Jan 7, 2012
    Posts:
    1,937
    A another shot of Sponza. Close up of pillar.

    3D texture resolution 64x64x64.

     
    Baldinoboy likes this.
  20. Baldinoboy

    Baldinoboy

    Joined:
    Apr 14, 2012
    Posts:
    1,524
    Once again beautiful shots. Just amazing.

    So this probably will not work in Unity free? If you can get it to work with 2d textures will it look anything like this?
     
    Last edited: Oct 23, 2014
  21. kurylo3d

    kurylo3d

    Joined:
    Nov 7, 2009
    Posts:
    1,123
    When can i give you my money for this? lol
     
  22. brilliantgames

    brilliantgames

    Joined:
    Jan 7, 2012
    Posts:
    1,937
    @Baldinoboy At this point it's too far along to go back to the drawing board. This is functioning far too well to restart. I promise once in this is release I will make a huge effort to get this functioning on Unity free.

    @kurylo3d When it's released. :)

    Later today I will be starting a new thread completely focused on the GI. This GI is valuable enough to be its own package. Of course BG light engine will get it as well, but from my understanding, many people are more interested in GI than custom lighting.
     
    blueivy likes this.
  23. kurylo3d

    kurylo3d

    Joined:
    Nov 7, 2009
    Posts:
    1,123
    Curious, if this package will come with the GI, then what is the other package that is GI based for?
     
  24. brilliantgames

    brilliantgames

    Joined:
    Jan 7, 2012
    Posts:
    1,937
    The one that is only GI will be less expensive cause it contains only the GI.
     
  25. chiapet1021

    chiapet1021

    Joined:
    Jun 5, 2013
    Posts:
    605
    Will you release the GI-only package simultaneously with the full light engine, or will it come sooner?
     
  26. kurylo3d

    kurylo3d

    Joined:
    Nov 7, 2009
    Posts:
    1,123
    I see well im definetnly down for spending more money for every thing ;)
     
  27. Baldinoboy

    Baldinoboy

    Joined:
    Apr 14, 2012
    Posts:
    1,524
    I understand. Hopefully free users will get 3d texture support in 5. If not there is always Cryengine. Not to make a game but to try out my scenes with decent lighting;).
     
    Last edited: Oct 23, 2014
  28. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    12,992
    Is the GI in Cryengine viable from a performance standpoint ? I mean for a game that is already very loaded and for the optimization level an indie developer can achieve in general.
     
  29. Baldinoboy

    Baldinoboy

    Joined:
    Apr 14, 2012
    Posts:
    1,524
    It is pretty good. My pc is pretty old and I can get 20-25 fps on the forest scene. On a similar scene in Unity with one directional light and normal ambient light I get around 30 fps. I do notice some problems with Cryengines' GI. Everything is lit. Even things that should not be.

    I think brilliantgames' GI sounds like it is going to be better for quality and performance.
     
  30. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    12,992
    That is nice performance, i guess could be useful for outside as well.
     
  31. brilliantgames

    brilliantgames

    Joined:
    Jan 7, 2012
    Posts:
    1,937

    I've estimated the totally computational GPU cost to be the equivalent of 5 point lights.... How does that sound? Though the main performance draw backs are actually updating the texture volume, which is all done on the CPU at the moment.
    Remember this system was created as a fully usable system for real time games in 2011. Crysis 2 ran beautifully on the PS3 and 360. I honestly can't think of a faster way to compute real time GI, I just don't think there's any other way to do it better with the current state of hardware.

    @Baldinoboy I think someone needs a new compy. I payed 300 dollars for my laptop 3 years ago and it runs Crysis 2 fine. ;)
     
    Baldinoboy likes this.
  32. blueivy

    blueivy

    Joined:
    Mar 4, 2013
    Posts:
    615
    You say updating the texture volume is done on the CPU "at the moment". Do you plan on changing that?
     
  33. brilliantgames

    brilliantgames

    Joined:
    Jan 7, 2012
    Posts:
    1,937
    It depends if I can find a way. Unity doesn't exactly let you create or modify textures in CG. I am aware compute shaders could likely solve this, however I want that to be a last option. From what I've gathered, render textures can be rendered to a 3d volume. However, I have not found a way to modify the pixels within a rendertexture. I need to be able to make modifications to the volume in real time to correct things like occlusion as well inject other things like area lights and occluded skylight. On the CPU I can do all of these things, and it runs fast as long as the resolution stays somewhat low.
     
  34. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    12,992
    The GPU costs seems perfect. I guess you could release for DX9 (which is great, since i will use it right away :)) and then have a DX11 calculation option for better performance, if a game is very heavy. That should be the best of both worlds i guess.
     
  35. Baldinoboy

    Baldinoboy

    Joined:
    Apr 14, 2012
    Posts:
    1,524
    That is incredibly good.

    I do need a new PC. It still works but it is getting old. Although with Crysis 1 and 2 I get good performance even at high settings. It is with the latest version Cryengine with the Crysis 3 updates that my PC acts up.
     
  36. brilliantgames

    brilliantgames

    Joined:
    Jan 7, 2012
    Posts:
    1,937
    Ah yes makes sense. Though we are talking about the LP GI performance specifically. The forest demo is filled with every effect imaginable, from tessellation, to water and screen based reflections. Crysis 2 was the first to use their real time GI. Long time ago, they have been laughing at everyone for a while.. :)
     
    Baldinoboy likes this.
  37. brilliantgames

    brilliantgames

    Joined:
    Jan 7, 2012
    Posts:
    1,937
    This screenshot shows multiple bounces. I simply placed a probe facing the opposite way of the light source to capture the extra bounces. The bouncing is infinite, and it can be difficult to work with. You turn the GI multiplier to an unrealistic amount and everything can quickly go white.. If a surface gave off more light than it received in real life, the same thing would happen.

    Note: the reflections of the lions head on the floor and sphere, this is only possible with multiple bounces. Don't forget to right click and open in new tab for HD.

     
    Baldinoboy and blueivy like this.
  38. Baldinoboy

    Baldinoboy

    Joined:
    Apr 14, 2012
    Posts:
    1,524
    That is beautiful. Are you integrating this new system into Warland?
     
  39. SteveB

    SteveB

    Joined:
    Jan 17, 2009
    Posts:
    1,451
    How come I can see some screenshots and not others? (Post #337)

    I see Post #319 just fine for example...
     
  40. blueivy

    blueivy

    Joined:
    Mar 4, 2013
    Posts:
    615
    Is the new thread still coming today?
     
  41. brilliantgames

    brilliantgames

    Joined:
    Jan 7, 2012
    Posts:
    1,937
  42. Hrothvitnir

    Hrothvitnir

    Joined:
    Apr 26, 2013
    Posts:
    109
    Dare I get my hopes up about GI again? ... Yeah, you've got pretty pictures... so Kudos.

    If it could run faster by taking advantage of dx11 features, I'd definitely want to take advantage of that.

    My other (and main) concern is that it's shader based. You say it should be simple to integrate into a custom shader, but as someone who knows nothing about shader programming, but uses lots of complicated 3rd party shaders, this makes me a bit nervous. Hopefully you can give a short tutorial on how to do that. I can't really see any good in having GI that effect some objects and not others.

    Do you plan on integrating IBL to your system, or is that even necessary at this point?
     
  43. BenKurdziel

    BenKurdziel

    Joined:
    Nov 9, 2012
    Posts:
    8
    So first off, it looks amazing, and seems to serve all of my needs for a game project I'm working on.

    However, I'm getting a crash with Unity Web Player on the demo every time. Wondering if that's something with the webplayer build, or something with the plugin not working properly in the current version?

    Just wondering what to expect before I shell out the money. If it works and looks as good as the pictures show, and it does what I need, I have no problem paying for it. But I just wanted to check in and see what the state of things are on this. Thanks! :)
     
  44. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    12,992
    Shader based means changing all shaders in a project to use it ? I though it was calculated using a shader and applied with a post effect.

    Are Enlighten and Livenda solutions using shaders as well ? For example will i have to change all of my 200+ pre-Uniy 5 shaders to get GI working with Enlighten ?
     
  45. Hrothvitnir

    Hrothvitnir

    Joined:
    Apr 26, 2013
    Posts:
    109
    Enlighten is being integrated into the engine by Unity themselves, so I don't think so, I can't say for sure, but why would they? It makes no sense.

    I asked Livenda in their thread about workflow and whether it was shader based months ago, and again recently, and they never gave an answer. Kind of why I don't think they are making anything, how could they not know at this point? Anyway I don't want to drag that into this thread.

    Brilliant Games lighting project has always said it was shader based, which is one of the reasons I haven't ever been able to consider it, but if it's truly easy to add into existing shaders, or BG can help us integrate it that's another story.
    At the very least I'd need it to work with Amplify Texture 2, maybe Skyshop if BG doesn't totally supplant Skyshop functionality (Amplify has Skyshop integrated shaders, so those two could possible be considered just one thing to do), Suimono 2, and possibly RTP (I can't remember if RTP is shader stuff, but that seems logical so I'll list it for now).
     
  46. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    12,992
    I see. I dont have the asset, so did not know about its shader only nature. Now is totally clear, thanks for the detailed info.
     
  47. JecoGames

    JecoGames

    Joined:
    Jan 10, 2013
    Posts:
    135
    From who this system worked before it should be pretty easy,it was literally only one line of code to get it to work.
     
  48. Frpmta

    Frpmta

    Joined:
    Nov 30, 2013
    Posts:
    479
    Can I achieve the same look as that video with this?
    And does it require environment probes?
     
    Last edited: Oct 25, 2014
  49. aliens9889

    aliens9889

    Joined:
    Nov 21, 2014
    Posts:
    6
    Hi everyone,

    I'm very interested about this plugin of Unity, I want to know if this plugin (BG Lights) works on Android's Devices(Smartphones and Tablets) and IOS's Devices(Iphones, Ipads), I ask about that because I'm working with gameObjects and 3D models and I want to do something that looks so well as your screenShots. the 3D models will be architecture models(houses, apartments, etc). The point is if this works as I expect on these kind of devices. I will buy this Unity package. please answer me as fast as you can, it's something that I want to show to the team and if they like it we will use it. Thanks for Everything!!!
     
  50. IanStanbridge

    IanStanbridge

    Joined:
    Aug 26, 2013
    Posts:
    334
    aliens9889 I don't think it would suitable for mobile. Firstly I think the screenshots you are referring too are from a wip version that is not ready yet. I think the BG Lights package on the store is an older version. Secondly you should look at the newer thread from brilliantgames as there is more information and some demos about how it is progressing. If you look at those demos though it looks like even if they could run on a mobile device they would be too slow. I think the package is mainly targeting fairly high end desktop machines.

    For mobile devices you would be better off trying to use the proxy GI package for dynamic GI and bake the reflections into reflection probes. Proxy Gi combined with enlighten and PBR shaders in Unity 5 would probably make more sense on mobile.