Search Unity

Real Time Global Illumination For All Versions Of Unity! (W.I.P)

Discussion in 'Assets and Asset Store' started by brilliantgames, Oct 21, 2013.

  1. brilliantgames

    brilliantgames

    Joined:
    Jan 7, 2012
    Posts:
    1,937
    This thread has been moved to: http://forum.unity3d.com/threads/233919-BG-Light-Engine-(With-Real-Time-GI-amp-Area-Lights)











    Custom Lighting Engine With Real Time Global Illumination

    This project has come a long way since the start and is nearing completion. It started as a simple cheap global illumination system that used Unity's point lights combined with raycasts to fake gi.

    This project has now evolved into a custom lighting engine. Add custom area lights and point lights(with advanced settings like attenuation adjustment) combined with Image Based Global Illumination while seamlessly blending with Unity's lighting to create perfect and beautiful lighting for your world. Near 100 lights can be processed in a single pass in both forward and deferred rendering, and practically unlimited lights in multiple passes. Efficiency is the name of the game, area lights are still somewhat early but a recent test compared performance of 120 Unity point lights vrs 120 Brilliant Games area lights and the area light performance was about 3/4 the speed of Unity's simple point lights!


    Built In Shaders With This Package Are Now Physically based With Surface Roughness And Image Based Diffuse Lighting!!






    Demonstration Of Surface Roughness On Metal




    Rectangular Area Light(Still in development)





    Circular Area Light With Specular Reflections







    Demos for the new GI system are coming soon!



    Old Demos

    Web Demo: https://dl.dropboxusercontent.com/u/65183439/GIDemoLIVINGROOM/GIDemo.html


    New Sponza Demo! (Unoriginal I know) https://dl.dropboxusercontent.com/u/65183439/SponzaDemo/WarLandsGI_Data.html



    Web Demo Instructions: Press 'R' to toggle sun rotation. Press 'G' to toggle GI.



    Videos


    NEW VIDEO! Conference Room with new Image based GI system





    Official Trailer




    NEW Warland Update!




    Older Warland Update





    Here are some screen shots on progress so far.


    RIGHT AND CLICK OPEN IN NEW TAB TO SEE IN HD


    Mansion Living Room Scene




    Day time area lighting, orange brown walls.




    Sky Light Ambience




    Day time area lighting, green walls.




    Day time area lighting, no gi.




    Night time spot light lighting. Green walls.




    Night time spot light lighting. Glorious redness :)




    Night time spot light lighting. No gi




    Sci-fi shooter Warland, GI on.




    Sci-fi shooter Warland, GI off




    Robot Labs, Real Time GI On



    Robot Labs, Real Time GI Off






    GI on large outdoor scene




    GI off




    Inside Building shot







     
    Last edited: Mar 13, 2014
  2. brilliantgames

    brilliantgames

    Joined:
    Jan 7, 2012
    Posts:
    1,937
    Would really like to know your thoughts on this everyone. :)
     
  3. MaT227

    MaT227

    Joined:
    Jul 3, 2012
    Posts:
    628
    This seems interesting. Can you provide a setup tutorial. What about the perfs ? Like you said, a demo would be very nice !
     
  4. brilliantgames

    brilliantgames

    Joined:
    Jan 7, 2012
    Posts:
    1,937
    Its not far enough along to show tutorials yet, cause it will dramatically change. However, yes I will have an interactive demo soon. :)

    I was also wondering if anyone can give me any insight as to how I could possibly change the light attenuation on the point lights used for illumination. If I could make this more linear, I could make this run 10 times as faster. The fall off is just so huge on unity's point lights.
     
  5. brilliantgames

    brilliantgames

    Joined:
    Jan 7, 2012
    Posts:
    1,937
    Bump! Lets hear some feedback peeps!
     
  6. I am da bawss

    I am da bawss

    Joined:
    Jun 2, 2011
    Posts:
    2,574
    Looks very interesting. Would love to see a Youtube video or a web demo.
     
  7. brilliantgames

    brilliantgames

    Joined:
    Jan 7, 2012
    Posts:
    1,937
    Uploading one right now. ;)
     
  8. mk1978

    mk1978

    Joined:
    Dec 27, 2009
    Posts:
    276
    I would also like to see some example (pictures or video) where there is nature scene including different trees, vegetation, rocks, mountains, etc.
     
  9. brilliantgames

    brilliantgames

    Joined:
    Jan 7, 2012
    Posts:
    1,937
    Last edited: Oct 21, 2013
  10. Cyrien5100

    Cyrien5100

    Joined:
    Oct 17, 2012
    Posts:
    145
    It looks pretty good :)
    I hope it will work for outdoor scenes :)
     
  11. brilliantgames

    brilliantgames

    Joined:
    Jan 7, 2012
    Posts:
    1,937
    Thank you. Yes, I am working on that. Outdoor has definitely proven to be the most difficult. Just in the past few hours though I have dramatically improved cascading for long distance. So thats one step closer, I just won't settle with draw distance, looks horrible having a black background around the player. :p
     
  12. ZJP

    ZJP

    Joined:
    Jan 22, 2010
    Posts:
    2,649
    Hi,

    Nice result and good performance. As i said here, a GI is a very important thing in a project. If I take a look to your competitors, you combine two advantages:
    a) You are on this forum for a long time.
    b) You make a very good "backup service" of your previous products.
    So, if this one is affordable, why not? ;)

    And, +1 for a outdoor demo.
     
  13. EvilFox

    EvilFox

    Joined:
    Jul 23, 2013
    Posts:
    83
    I purchased dynamicGL, but your system may be used as a lightweight-GL (for weaker PC).
    200fps at what resolution and hardware?
     
  14. tripknotix

    tripknotix

    Joined:
    Apr 21, 2011
    Posts:
    744
    is this sm2, sm3, es2 compatible? es3 compatible?
     
  15. kenshin

    kenshin

    Joined:
    Apr 21, 2010
    Posts:
    940
    Nice demo, it works fine also with my home pc with GeForce 7600GT
     
  16. brilliantgames

    brilliantgames

    Joined:
    Jan 7, 2012
    Posts:
    1,937
    Thanks for the feedback everyone. Yes I have been testing in a variety of scenes. If anyone wants to suggest or send me a good 3d scene to use and test this in, I'm all ears!

    One thing I have really failed to mention about this system is it is also possible to bake this GI. Now this offers a significant advange being that it would bake alot faster than Unitys gi, and you could get seamless blending between real time and baked GI.

    Honestly theres really nothing its not compatible with. If it can process point lights its ready for this. Just a matter of how fast it runs now.
     
  17. kurylo3d

    kurylo3d

    Joined:
    Nov 7, 2009
    Posts:
    1,123
    is it on the asset store yet?
     
  18. akabane

    akabane

    Joined:
    Apr 26, 2007
    Posts:
    143
    Is there a way to change the number of pointlights projected in the scene in runtime as well, maybe per-source-light control? Do we also get different algorithms to choose from with different calculations methods? Could be an interesting and different alternative to play with. Price in mind?

    edit: does it also work in the editor? :D
     
    Last edited: Oct 21, 2013
  19. brilliantgames

    brilliantgames

    Joined:
    Jan 7, 2012
    Posts:
    1,937
    Not for a bit now.



    Yes you can change all resolution and quality settings in real time. You can also limit point lights to a max amount. When it reaches the threshold it just recycles them to where they are most needed.

    Currently it only works in game. But it will work in edit mode very soon. I also want to create a 'static gi' creator for combining baked gi with real time gi.
     
    Last edited: Oct 22, 2013
  20. inafield

    inafield

    Joined:
    Feb 26, 2013
    Posts:
    281
    Impressive. Runs beautifully on an Intel 3000 on a dual core mobile i7 (yeah, work gave us the crappy i7)

    I agree. Some of the lighting looks a little bit odd and not as accurate, but this looks like a really fast solution.
     
  21. brilliantgames

    brilliantgames

    Joined:
    Jan 7, 2012
    Posts:
    1,937
    Does anyone know if its possible to get beast lighting to bake cookies on point lights..?
     
  22. FuzzyQuills

    FuzzyQuills

    Joined:
    Jun 8, 2013
    Posts:
    2,871
    Last edited: Oct 22, 2013
  23. brilliantgames

    brilliantgames

    Joined:
    Jan 7, 2012
    Posts:
    1,937
    I was an indie user. But your image effects look awesome. :)
     
  24. brilliantgames

    brilliantgames

    Joined:
    Jan 7, 2012
    Posts:
    1,937
    New screen shots. Showing just how physically accurate this really is!




     
  25. brilliantgames

    brilliantgames

    Joined:
    Jan 7, 2012
    Posts:
    1,937
    Screen shots from the game Warland this is being built for.

    Warland Real Time GI On




    Warland Real Time GI Off

     
    Last edited: Oct 22, 2013
  26. pixelsteam

    pixelsteam

    Joined:
    May 1, 2009
    Posts:
    924
    Really impressive.
    How close until release? How hard to setup?
     
  27. brilliantgames

    brilliantgames

    Joined:
    Jan 7, 2012
    Posts:
    1,937
    Hopefully not too long. Theres still lots to do, while developing Warland. Setup is pretty simple, it depends how detailed you want to go with colouring your surfaces.

    Besides that, its just a matter of tweaking settings to make it look perfect with your scene. :)
     
  28. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    Point light bounce?? hey that's neat, it's remind me of how ND did for their flashlight bounce for The Last Of Us..
     
  29. SteveB

    SteveB

    Joined:
    Jan 17, 2009
    Posts:
    1,451
    This is rather impressive, not gonna lie.

    Can we get, and dare I say it, the Sponza demo to walk around in? Since that's be the de facto environment to demonstrate GI, why not right? :D

    Cheers!

    -Steve
     
  30. janpec

    janpec

    Joined:
    Jul 16, 2010
    Posts:
    3,520
    If i understand correctly it does not work with directional light?
     
  31. brilliantgames

    brilliantgames

    Joined:
    Jan 7, 2012
    Posts:
    1,937
    All of the screen shots and the demo are directional lights. ;) Works with every light.
     
  32. brilliantgames

    brilliantgames

    Joined:
    Jan 7, 2012
    Posts:
    1,937

    Your wish is my command! Sorry everyone, I had to do it. Sponza demo is now up. Contains a rotating green plane to show off dynamic objects.

    Sponza Web Demo: https://dl.dropboxusercontent.com/u/65183439/SponzaDemo/WarLandsGI_Data.html


     
  33. SteveB

    SteveB

    Joined:
    Jan 17, 2009
    Posts:
    1,451
    Haha gracias sir, whomever is lurking behind the mask... :D

    ...and I'm embarrassed to admit that a couple months ago, in Chris's GI thread, I asked for any demo other than Sponza, and here I am asking for you to supply one!

    Thing is, I've been playing with nothing but Sponza GI demo's that for realtime demonstrations, it's a fair comparison to test the different realtime solutions, so I will never speak ill of Sponza again!

    So, I have to say two things stuck out for me:
    • Performance is excellent, and then I realized I was using my old 2009 iMac(8800GTX, 4 gigs ram) to test it...on my Alienware m17xR3 (580m GPU, 16gigs ram) the performance is ridiculous, dare I say in excess of 100 fps. It's CoD smooth with my faux-math addition of 40 frames per second, haha...(it could be 200 fps guys this machine is very fast despite there being superior mobile GPUs)
    • ...and the reason I'm rather impressed by the performance on what you're calling a faux-GI solution is that short of missing a bounce or two here and there (e.g. the floor behind the curtains up to the wall gets no light whatsoever where indeed it would...rotate sun to either lion head to see what I mean) the effect is remarkable. There such a subtle balance of lighting, transitions to and from shadow working in concert with the SSAO, and the 'expectation of color energy' that I buy it (literally and figuratively when you make it available!). This feels good to me that I'm not going to miss the precision when you factor in the sheer speed of this damn thing.

    Why do I feel this is the peanut butter to your chocolate?? Make it happen!!

    Oh, and since you're granting wishes, I'll take an early copy of your asset to help you test? Mmmmm? :D


    Cheers man


    -Steve
     
    Last edited: Oct 23, 2013
  34. brilliantgames

    brilliantgames

    Joined:
    Jan 7, 2012
    Posts:
    1,937

    Haha, thanks for the nice feedback. Yeah, this runs fast because there are alot of tricks behind this system. Its actually really low resolution which is why you can see some bounces are missing. The spots in which it chooses to place the point light sources is pretty precise, in that they are sparsley placed and none too close to occluded corners.

    About no light behind the curtains... Heres the thing, why would there be light? Theres a complete wall blocking all the light. Unless the curtains were transparent there should be very little light behind them. Also remember we still cant dream of having more than one bounce in real time. So yes in real life light would eventually make it back there, but not on the first bounce for the most part. :)
     
    Last edited: Oct 23, 2013
  35. SteveB

    SteveB

    Joined:
    Jan 17, 2009
    Posts:
    1,451
    Oh no I know we can't have the true fidelity afforded multiple bounces, only that the sunlight does make it through the top of the curtains, and it clearly causes the adjacent wall to collect light, and that right there is why it feels incongruent.

    No biggie, just the only real standout thing in an otherwise fantastic solution. :)

    Cheers
     
  36. brilliantgames

    brilliantgames

    Joined:
    Jan 7, 2012
    Posts:
    1,937
    New detailed debug feature showing bounce light reflection directions. Also, note the 'smart' light placement. Lights avoid occluded corners and only place where needed for lightning performance.


     
  37. brilliantgames

    brilliantgames

    Joined:
    Jan 7, 2012
    Posts:
    1,937
    Yeah for sure. Well it really depends how high of resolution you want to go. All the settings are public so you can go as nuts as you want. I am developing this to actually perform in a game, so I need it to have lightning fast performance. So all the demos I make are going to be in lower resolution because its designed to look good in low rez. Though unfortunately things are missed once in a while because of this.

    But of course I give everyone the choice.

    1. Fast performance while still looking good.

    2. Slower performance but more accuracy(Something players are less likely to notice). :)

    Next demo I will have quality settings so everyone can see its true potential when dealing with high performance machines. :)
     
  38. EvilFox

    EvilFox

    Joined:
    Jul 23, 2013
    Posts:
    83
    Please do correct full screen in the demo. Resolution in it is very low.
    I want to see how it will be at 2560x1440.
     
  39. EvilFox

    EvilFox

    Joined:
    Jul 23, 2013
    Posts:
    83
    Sorry, this is a bug in FireFox.
     
  40. brilliantgames

    brilliantgames

    Joined:
    Jan 7, 2012
    Posts:
    1,937
    Here is the official video trailer for Real Time GI. Really proud of this one. :)

     
  41. jcarpay

    jcarpay

    Joined:
    Aug 15, 2008
    Posts:
    561
    Nice video!
    There is a small error though, around 1 minute it says "no real time illumination". This should be 'no real time global illumination".
     
  42. elias_t

    elias_t

    Joined:
    Sep 17, 2010
    Posts:
    1,367
    Nice one and well done.

    Seems believable enough!

    Can you make a demo with an fps counter?

    Also what is the draw call count with and without real time GI?
     
  43. pixelsteam

    pixelsteam

    Joined:
    May 1, 2009
    Posts:
    924
    Wow!!! Insanely impressive....for sure buy!
     
  44. brilliantgames

    brilliantgames

    Joined:
    Jan 7, 2012
    Posts:
    1,937
    I wouldn't be able to give you a valid number. All depends on the scene and settings you have.
     
  45. brilliantgames

    brilliantgames

    Joined:
    Jan 7, 2012
    Posts:
    1,937
    Real Time GI now works in edit mode!
     
  46. SteveB

    SteveB

    Joined:
    Jan 17, 2009
    Posts:
    1,451
    Pics or Shenn!!
     
  47. brilliantgames

    brilliantgames

    Joined:
    Jan 7, 2012
    Posts:
    1,937
    Sorry, Pics or Shenn? :p
     
  48. SteveB

    SteveB

    Joined:
    Jan 17, 2009
    Posts:
    1,451
    Shens!! :D
     
  49. brilliantgames

    brilliantgames

    Joined:
    Jan 7, 2012
    Posts:
    1,937
    So not only is this fully functional in edit mode, you can also choose to sample from the scene camera perspective.
     
  50. brilliantgames

    brilliantgames

    Joined:
    Jan 7, 2012
    Posts:
    1,937
    One of my favourite set of images so far. Cascades are working very well(Theres very little illumination on the backdrop buildings in this shot cause they are completely shaded). :) The scene only dropped 15 fps when GI is turned on.

    GI on large outdoor scene




    GI off




    Inside Building shot