Search Unity

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

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

  1. brilliantgames

    brilliantgames

    Joined:
    Jan 7, 2012
    Posts:
    1,937
    Version 0.2 Now Available!

    Asset Store Link: http://u3d.as/content/brilliant-game-studios/bg-light-engine

    TRY NEW DEMO THATS INCLUDED WITH PROJECT! https://dl.dropboxusercontent.com/u/65183439/BG IncludedDemo/test_Data.html


    Documentation Thread: http://forum.unity3d.com/threads/236946-BG-Light-Engine-Help-amp-Tutorials


    Version 1.0 is finally on its way! With COMPLETELY real time GI with diffuse specular reflections using light propagations!

    Some early previews of what's to come.










    Release Notes For Version 0.2:


    New Fixes Features:


    - Light shaders are now organized into fragment shader 'Passes'. Simply specify 'UsePass' for each light type at the end of any shader and let there be light!
    - Random crash bug fixed.
    - Compatible with transparent shaders.
    - Control over max rendered lights for spherical and rectangular for both specular passes and diffuse passes in real time!
    - Slow import compilation time dramatically reduced.
    - Rectangular area light accuracy has been further improved. Now approximately 99% physically accurate.
    - Maximum lights rendered increased.
    - Skylights now conserve energy. However still no specular reflections yet(remember cube maps work just fine).



    Included With Beta 0.2:

    - Rectangular Area Lights with specular reflections and surface roughness.
    - Spherical Area Lights with specular reflections and surface roughness.
    - GI lights (An optimized square area light designed for manually faking gi)
    - Directional Skylights (No specular reflections yet. Reflections were low priority because of cubemaps and image based lighting).
    - Open source code!
    - Energy conserving physically based shaders with image based lighting and surface roughness with reflections on cubemaps, BG lights Unity lights.
    - Lovely demo scene.


    Limitations Bugs For Beta 0.1:

    Highest priority issues

    - Mac compatibility issues(We are working on it).
    - Real time GI not yet implemented.

    Other issues

    - Roughness in rectangular area light reflections have some artifacts.
    - Lights are limited to 35 of each type(35 closest lights are displayed). Looking to increase maximum amount.
    - Slow import to project caused by many multi-compiled branches(The only known way to ensure lights that don't exist are not processed).
    - No shadows for BG Lights (shadows still work the same for Unity lights though)






    Release Video(Demo included with package)






    Try The New Demo Featuring, BG Area Lights, Point Lights SkyLights!(This demo is temporary, a more detailed one is coming soon)


    https://dl.dropboxusercontent.com/u/65183439/BGLightDemo/BGLightDemo.html





    Videos


    NEW Real Time Area Lights Demonstration




    Real Time GI






    Beta Version Available Very Soon!


    Brilliant Games Custom Lighting Engine For All Versions Of Unity



    With Brilliant Games Custom Lighting Engine, nothing is missed when it comes to true next gen lighting. This system contains everything from Real Time Global Illumination, to pixel perfect Area Lights as well as physically based shading with image based lighting, all while blending seamlessly with Unitys lighting(All versions of Unity). All light types have full control over attenuation, range, intensity and color. BG Light Engine also contains more simple lights like Point lights and directional lights, which are faster than Unitys. It has been a massive journey getting to where we are now. In fact there is still much work to do yet (However, we will be releasing a beta very soon). This engine first started with a very simple goal, fast Global Illumination. It eventually escalated into an entire lighting engine.


    Real Time Global Illumination

    The Global Illumination has been through many changes since it started. Right now local real time probes are required in order to properly update lighting changes. The probes contain a low resolution camera that creates cube maps of its surroundings in real time which is then used for GI. Because the lighting is image based, bounces are practically infinite, which creates very convincing lighting all in real time. This is all the info I can give on the GI at this time, it is still in development and we cannot guarantee it will make the first beta release of this package.


    Screenshots of GI






    Area Lights

    After we had developed a working Global Illumination system, we decided we should pursue real time Area lights. When we started doing research, we noticed there wasnt much out there. We began testing other Area Light Solutions (Including Cryteks) and noticed something consistant. No one was doing it properly. Most solutions looked like a directional light going through a window(Its a bit more complicated than that but thats the basic idea).

    After being fairly disappointed with the research, and seeing that no one seemed to be doing it properly, we set out to make a physically accurate solution that was efficient and completely usable in games. Easier said than done. After 2 months of development and creating at least 10 different algorithms, we finally created the right one. Nearly by chance.. The algorithm is technically an approximation, but impossible to tell. It works on all axes, as well as below the horizontal line of the light. However we are still working on other solutions.


    Below are 2 diagrams. The first one shows how Area lights are usually done, the second shows how Area lights should behave(which is what our approximation accomplishes). With the first diagram, the faked algorithm finds the closest point on the area light relative to the current pixels position and uses that point to determine the amount of light. This is a clever trick. However, it has many downfalls and it is very unrealistic. The affect this faked method gives, is like a directional light going through a window.

    Faked Closest Point




    BG Area lights successfully replicates and approximates the full area of the light in view to all pixels.


    True Area Light Attenuation



    Lovely shot of our Area lights in action










    Physically Based Shading Image Based Lighting

    During development, we figured, "We have come this far, might as well make image based lighting and physically based shading", and so we did. These shaders include, specular reflections, image based diffuse lighting and surface roughness and roughness maps. I do not want to bash other solutions out there, but I assure you this was the least complex part of the project for us, and most solutions out there are way over priced. So, you are welcome. :)

    Screen shots of real time image based lighting and physically based shading with surface roughness.



     
    Last edited: Oct 23, 2014
    mattmanj17 likes this.
  2. bac9-flcl

    bac9-flcl

    Joined:
    Dec 5, 2012
    Posts:
    829
    Great to see it's nearing a release.

    First and foremost I'm wondering about performance/optimization. Are the days of GI adding 4000 drawcalls to a tiny scene over?

    Second question would be about PBS shaders you're including and compatibility of existing shaders to your system. Let's say I need to use a complex triplanar shader in my project. Is it possible to integrate it for use within your lighting system? How many texture samplers do I need to reserve for it? Are there particular issues with some shader types like offset decals, semi-transparent sorted surfaces, etc?

    And a third one - how well the tech scales to environments of varied size? Is the new probe-based GI algorithm procedural, i.e. generates the probes around the player camera automatically and therefore has flat cost no matter the environment? Or it requires manual probe placement around the levels? Hopefully the former.
     
    Last edited: Mar 13, 2014
  3. brilliantgames

    brilliantgames

    Joined:
    Jan 7, 2012
    Posts:
    1,937

    Shader compatibility should be pretty simple. There will be a blend version of all the shaders so you can simply blend whatever shader you are using with a shader of choice.

    Currently the GI probes are manual. there is alot of room for improvement on the system.
     
  4. eskovas

    eskovas

    Joined:
    Dec 2, 2009
    Posts:
    1,373
    Looks amazing Brilliant. This lighting system creates a very realistic look for the scenes,

    I have a few questions :) :

    1: How many draw calls will this system add in comparison with a normal Unity lighting scene?
    2: Have you guys decided the price of this package?
    3: Could you also show the process of getting the system to work?
    4: Does it work on Deferred Rendering?

    One great comparison, would be to have some screenshots with and without this system if you guys have the time for that :)

    Anyway, i've been following the development of this since the beginning and i'm looking forward to the release.

    Edit:
    On the comparison thing, obviously not area lights (since unity doesn't have them). The global illumination video has the comparison, but it's from 3 months ago, so maybe the system might be a little different.
     
    Last edited: Mar 13, 2014
  5. bac9-flcl

    bac9-flcl

    Joined:
    Dec 5, 2012
    Posts:
    829
    Is there any kind of precomputation involved or the probes capture all the data during runtime? If it's the latter, then it's feasible to make a manager script that will populate the space around the player with the probes and unload them as necessary - making the tech suitable for procedural environments or just large environments where placing probes manually is completely impractical.
     
  6. brilliantgames

    brilliantgames

    Joined:
    Jan 7, 2012
    Posts:
    1,937
    There is some yes. The probe does a series of raycasts in order to map out the geometry around it. It is possible to do it in real time though. As I have mentioned, there is much room for improvement for the GI. Which is why it might not make the first release. But don't worry, there will be real time GI. We just want to make sure its the best it can be, and to be completely usable for all scenarios. We did that with the area lights and I'm sure we can do the same for GI. :)
     
  7. AccidentalCube

    AccidentalCube

    Joined:
    Nov 1, 2013
    Posts:
    14
    A global illumination solution is what started this whole project...
    "we cannot guarantee it will make the first beta release of this package"
    :/

    EDIT: I would like to add something; I would like to point out something that really frustrates me:

    There have been countless "GI solutions" for Unity on these forums and elsewhere on the internet. So far, only ONE [EDIT2: Sorry, make that two] has actually been released. So many Unity users, hobbyists and developers alike, have been waiting for someone to make a GI solution for the past few years, and only a couple have done it (and they're somewhat expensive).

    Why? I understand you're still working on the package and improving it, but why did you have to add so many other things that people aren't really looking for as much? I think I've said this before in the old thread, and I'm sorry to burst your bubble, but you know why people want this package to be released; people want the GI. Releasing the beta without the GI is a big slap in the face to everyone who's been supporting this project, because the GI is what everyone wants. I know you've put a lot of work into this, and I appreciate it, but it feels like you're pulling some kind of scheme with this..
     
    Last edited: Mar 13, 2014
  8. bac9-flcl

    bac9-flcl

    Joined:
    Dec 5, 2012
    Posts:
    829
    Because proper GI is not a standalone feature you just drop onto a camera in an arbitrary project to pimp the frames up, and because base Unity lighting is lacking too much stuff to warrant an effort of making a GI compatible with it. Just a guess, you know.

    I have a hard time imagining a project that has an absolute need for GI while settling for otherwise mediocre lighting without any image based and physically correct additions. I am sorry to say this but I think many people are too caught up in the hype surrounding the words "real-time global illumination" and wanted this asset just to get their hands on some UE4-inspired next cool thing, without considering how it would work and what place that tech has in real projects.

    CryENGINE would not be able to deliver it's image based lighting without it's HDR and uber shader implementations being there first, it's GI without it's deferred lighting tech and variety of optimizations being there first, and so on. It's the same deal here, you don't create the tech in vacuum.

    They seem to be building a well-rounded lighting solution instead of focusing on nearly impossible task of providing GI that works well for arbitrary lighting setups, which is great in my book. Half a year ago I considered this project a dead end asset with niche use and slim chances of a good release. Now I consider purchasing it because I see developers that seem to have a realistic vision and better understanding of what's appicable to real projects.
     
    Last edited: Mar 13, 2014
  9. brilliantgames

    brilliantgames

    Joined:
    Jan 7, 2012
    Posts:
    1,937
    @bac9-flcl partially answered the question. I know its been taking a long time. But GI is not the answer to everything. Unitys lighting and shaders as a whole are simply not usable for next gen games.

    Are you aware how few truly working solutions there are out there? Crytek is the only engine that actually uses completely real time GI. The rest are STILL either completely static are partially computed, or simply not usable for the current generation in complex games. I don't want to release a GI solution that only works for a few situations, and takes a Nasa computer to run. Many developers have made that mistake(including Unreal engine). I want to do this properly.

    The GI in this project is already a working beautiful solution. But trust me, I'm not stopping until I feel comfortable using this in my own games/projects. Some people might be okay with settling, but I'm not. :)
     
    Last edited: Mar 13, 2014
  10. brilliantgames

    brilliantgames

    Joined:
    Jan 7, 2012
    Posts:
    1,937
    Hey, almost missed this post. :) At the moment I don't have an answer to questions 1 and 2. We are heavily in to the optimization stage at this point so I can't give any numbers just yet. A tutorial will be released on the day the project is submitted, we are working as hard as we can to make the setup process as simple and seamless as possible. Trust me when I say its not an easy task. :) Yes it works with all rendering with identical performance!

    That said, more screenshots and examples are coming soon, including some shiny new demos. :)
     
  11. Licarell

    Licarell

    Joined:
    Sep 5, 2012
    Posts:
    434
    Sorry to ask the same question but I'd like to know if this will work with the Pre-Integrated Skin Shader?

    Thanks again and looking forward to the release!

    Lic
     
  12. brilliantgames

    brilliantgames

    Joined:
    Jan 7, 2012
    Posts:
    1,937

    I've never used that shader but it should be fine if its blended. Cannot guarantee anything though.
     
  13. AccidentalCube

    AccidentalCube

    Joined:
    Nov 1, 2013
    Posts:
    14
    I know that GI isn't the answer to everything, that's kinda obvious. It's just frustrating how many people come out and say "Hey, I made this GI for Unity, look at it!" and it looks great, but then they simply never release a usable version. I know your GI wouldn't be as good without your point lights and all of that, but I bookmarked your threads for the same reason many others did; for the GI.

    EDIT: Again, the most frustrating part is that you say the GI might not be released with the first beta version, when it's probably the thing that's been worked on the most - not only that but we've seen the images so many times, it really doesn't look like it needs any more work.
     
  14. brilliantgames

    brilliantgames

    Joined:
    Jan 7, 2012
    Posts:
    1,937
    Well if GI doesn't make it to the first release, you shouldn't see that as a problem. While waiting for the GI you have area lights, skylights, physically based shading with image based light. You can fake excellent GI with all of those features for the time being. And if you are that worried, wait until the GI is implemented. :)
     
  15. Baldinoboy

    Baldinoboy

    Joined:
    Apr 14, 2012
    Posts:
    1,526
    Hey brilliantgames. The area light vid was awesome. I know you still have a way to go but have you decided how you are going to sell the pack? Real-Time GI seperate or together?

    More excited about the skylighting than anything else. Is there still a major performance boost with pointlights in Unity free? That will be another great bonus.
     
  16. ronjart

    ronjart

    Joined:
    May 16, 2013
    Posts:
    101
    Looks fantastic! Definitely on my top list.
     
  17. brilliantgames

    brilliantgames

    Joined:
    Jan 7, 2012
    Posts:
    1,937

    I have decided to make it one large package. If anyone disagrees and would rather have separate packages now is the time to speak. :)
     
  18. carl010010

    carl010010

    Joined:
    Jul 14, 2010
    Posts:
    140
    One large package sounds great.
     
  19. Axel59

    Axel59

    Joined:
    Feb 28, 2013
    Posts:
    37
    One large package too :D
     
  20. brilliantgames

    brilliantgames

    Joined:
    Jan 7, 2012
    Posts:
    1,937
    Good to hear. :)
     
  21. Olafson

    Olafson

    Joined:
    Aug 7, 2012
    Posts:
    255
    I would not mind your area lights either, they are pretty sweet. But in the end, what I really care for is your GI solution :p
    I just have no use for area lights in my game at the moment... (I should find one, so I can use your area lights)
     
  22. brilliantgames

    brilliantgames

    Joined:
    Jan 7, 2012
    Posts:
    1,937
    You know there are probably far more uses for area lights than you might think. Some examples include, large windows, sky light(A very large scale one), ground light, faked GI. These are just some examples. Basically, any large source of light you want coming from the source rather than an infinitely small point in space.

    In real life, everything is an area light, even light bulbs.
     
  23. angelodelvecchio

    angelodelvecchio

    Joined:
    Nov 15, 2012
    Posts:
    170
    any ETA to release something brother? i am really anxious !!!! unity needs better looking for sure ! i am done of lightmapping !
     
  24. Olafson

    Olafson

    Joined:
    Aug 7, 2012
    Posts:
    255
    Well problem is, my lights (handheld gas or candle lamps) have to throw shadows. The skylight idea is pretty brilliant though...
     
  25. bac9-flcl

    bac9-flcl

    Joined:
    Dec 5, 2012
    Posts:
    829
    Speaking of which, CryENGINE area lights supported shadow casting which was immensely useful. Do your area lights support that?
     
  26. brilliantgames

    brilliantgames

    Joined:
    Jan 7, 2012
    Posts:
    1,937
    I see no reason why it wouldn't be submitted within a week. I'm just at the stage of creating a system to make this run as smooth and streamline as possible.

    Important note: Upon the first release, global illumination likely might not make it in. Remember this will be beta. The initial release will cost less. I strongly encourage you to purchase this on the start.

    I have spent probably over a thousand hours on this project and could really use the support to continue!
     
  27. Antigono

    Antigono

    Joined:
    Oct 20, 2013
    Posts:
    63
    Count me in if my wallet can afford at this time.

    Have you decided some price tag for this initial release? considering the proximity of the release
    As for compatibly, SkyShop, alloy, candela, are compatible?

    Sorry for my English
     
  28. bac9-flcl

    bac9-flcl

    Joined:
    Dec 5, 2012
    Posts:
    829
    Sounds reasonable. By the way, what shading model are you using for your PBS implementation and how it compares with existing products like Alloy and Rust, if you have had experience trying them out?
     
  29. Baldinoboy

    Baldinoboy

    Joined:
    Apr 14, 2012
    Posts:
    1,526
    @brilliantgames: I do not remember. Does this support spherical or circular area lights? Can not wait. Hope I can grab it on first release.
     
  30. brilliantgames

    brilliantgames

    Joined:
    Jan 7, 2012
    Posts:
    1,937
    I have decided to release this at $90 USD. This price will only be for a limited time. :)
     
  31. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    Good job, looking great there!
    Is it post effects or a bit of both?
     
  32. ronjart

    ronjart

    Joined:
    May 16, 2013
    Posts:
    101
    Sound like a good introductory price point to me. Once you get some positive reviews and you deliver on the promises, you can definitely raise the price.
     
  33. brilliantgames

    brilliantgames

    Joined:
    Jan 7, 2012
    Posts:
    1,937


    Yes, less than most of the similar packages out there, but offers more. :)
     
  34. brilliantgames

    brilliantgames

    Joined:
    Jan 7, 2012
    Posts:
    1,937
    So spherical area lights have been implemented. The method in which they were implemented is actually very similar to a point light. Performance is identical to point lights, so they are built into the point light pass. So technically nothing is point based anymore.

    'Size' can be implemented on both point lights, and directional lights. Adding size to directional lights replicates skylight or large light sources coming from a direction. Adding size to a point light replicates spherical area lights, and can be used and abused as much as you want. If you have a light bulb, simply make sure the light is the same size as the light bulb to get the most realism possible. :)
     
  35. Mauri

    Mauri

    Joined:
    Dec 9, 2010
    Posts:
    2,665
    Send you an PM.
     
  36. brilliantgames

    brilliantgames

    Joined:
    Jan 7, 2012
    Posts:
    1,937
    Working on fast integration and tools. Tested Unitys stealth tutorial scene, was able to get it up and running in minutes.







     
  37. brilliantgames

    brilliantgames

    Joined:
    Jan 7, 2012
    Posts:
    1,937
    I thought I would take some time to explain what our Area light algorithms are doing.


    Below are 2 diagrams. The first one shows how Area lights are usually done, the second shows how Area lights should behave(which is what our approximation accomplishes). With the first diagram, the faked algorithm finds the closest point on the area light relative to the current pixels position and uses that point to determine the amount of light. This is a clever trick. However, it has many downfalls and it is very unrealistic. The affect this faked method gives, is like a directional light going through a window. This method is used by both Cryteks real time area lights and Unitys baked area lights.

    Faked Closest Point




    BG Area lights successfully replicates and approximates the full area of the light in view to all pixels.


    True Area Light Attenuation

     
    Last edited: Mar 17, 2014
  38. tripknotix

    tripknotix

    Joined:
    Apr 21, 2011
    Posts:
    744
    I'd also like to say im interested in the Global Illumination solution. Your nearest competitor, is also not yet finished with their product, theyve barely released their reflection part of the asset. Its not a race ofcourse to see who gets Real Time Global Illumination out first. But its definitely the feature people most point out when they talk about other game engines entirely, and the games that use them.

    Goodluck to you, i very much am looking forward to the GI solution. but at the moment, im developing on mobile. with an Open GL ES3 version already about to be released, so i'm hoping by the time youve released your GI solution that it might work on ES3.

    I think Area Lights are probably pushing it too far, for what i want to do. i'm already using IBL, but Global Illumination has many benefits of coloring from a directional light, when going from outside, to inside of a house.
     
  39. brilliantgames

    brilliantgames

    Joined:
    Jan 7, 2012
    Posts:
    1,937
    Try to understand our reasoning behind all this. The algorithm for the area lights is unique and is a huge stepping stone. Global Illumination will use this algorithm. Being a team of only two, these things take a long time to perfect. We aren't going to rush to release something that's not ready. No matter what the competition.

    The race for completely real time GI and advanced lighting hasn't been won by anyone yet, for any engine, and won't for many years. I don't believe anyone has found the best algorithm yet. :)
     
  40. Hrothvitnir

    Hrothvitnir

    Joined:
    Apr 26, 2013
    Posts:
    109
    I apologize if I've said this before, but I checked and either the comment is missing or it didn't go through somehow.
    I know you're still at an early stage, but when you are closer to being done please consider integrating/making your system compatible with Amplify Texture 2. Compatibility with Amplify is kind of a requirement for me. They are already integrating Skyshop and Alloy (or have already), so I'm pretty sure they'd work with you if you talk to them.
     
  41. brilliantgames

    brilliantgames

    Joined:
    Jan 7, 2012
    Posts:
    1,937
    We are working hard on compatibility. Though we cannot make any guarantees for the first release.
     
  42. Z43D

    Z43D

    Joined:
    Jan 2, 2013
    Posts:
    100
    +1
     
  43. Z43D

    Z43D

    Joined:
    Jan 2, 2013
    Posts:
    100
    Hey Brilliant,

    If you are willing to wait to get the GI solution in, why not also wait until you can assure some sort of compatibility between other assets? I'm probably not alone in having dropped $125 on Alloy, kinda want to make sure it's still working/integrated properly into my project. I'd wait longer for extra piece of mind (and to have the GI implemented in some fashion at release)

    Otherwise, it's a bit hard for me to swallow (and I'm assuming some others), dropping $90 (even though that's a great price!) on an asset that may or may not work with an awesome solution I've already invested my money in. In short, I'd love to see a more viable solution and am willing to wait for it, as long as it isn't two years from now haha. Just my .02
     
  44. brilliantgames

    brilliantgames

    Joined:
    Jan 7, 2012
    Posts:
    1,937
    Yes I understand. However we have been working on this a very long time, and we need support to continue. Working for free for 6 months is a tough job. :)
     
  45. brilliantgames

    brilliantgames

    Joined:
    Jan 7, 2012
    Posts:
    1,937
    Hey everyone. My main graphics designer is too busy to do the graphics for this package. I am offering a free copy of this package to whoever can create the best graphics for the asset store icon, large image, and medium image.

    PM your results to me for a chance to win a free copy of this package!

    If you need the photoshop formats follow this link: http://blogs.unity3d.com/2012/02/19/how-to-submit-content-to-the-unity-asset-store/
     
  46. Play_Edu

    Play_Edu

    Joined:
    Jun 10, 2012
    Posts:
    722
  47. brilliantgames

    brilliantgames

    Joined:
    Jan 7, 2012
    Posts:
    1,937
  48. brilliantgames

    brilliantgames

    Joined:
    Jan 7, 2012
    Posts:
    1,937
    Keep the wonderful submissions coming everyone! :)
     
  49. brilliantgames

    brilliantgames

    Joined:
    Jan 7, 2012
    Posts:
    1,937
    I wanted to give you guys an update on things that happened today.

    One of the things we have been struggling with from the start, is getting all the data of all the lights into the shaders so the appropriate actions can be taken. As usual, getting all that data into a shader is always easier said than done, especially with the vow of keeping everything compatible with Unity free(Render textures are a no no).

    Before today, we were using uniforms to input all the data of all the lights. Uniforms are a shaders version of 'arrays', but its cheated, its just a bunch of copied variables. Anyhow, this was causing problems with both performance and maxing out registers within the pixel shaders forcing us to do more passes than we would have liked.

    So to the point, what happened today? Today, I had an idea of how to solve all the problems. I decided I would make an algorithm that converts all the light data into one single texture file. And I did it! All light data is now passed through a single texture into the shader! This has dramatically increased the amount of lights per pass as well as a large performance boost!
     
  50. mimminito

    mimminito

    Joined:
    Feb 10, 2010
    Posts:
    780
    Hi,

    So, now that Unity have announced GI in Unity 5, what can you offer above Unity's solution? I believe Area Lights is still something Unity does not support, so thats a bonus, and maybe something you would offer in a separate package?