Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Fully Dynamic Diffuse Global Illumination

Discussion in 'Works In Progress' started by sonicether, Mar 29, 2015.

Thread Status:
Not open for further replies.
  1. gurayg

    gurayg

    Joined:
    Nov 28, 2013
    Posts:
    232
    I'm getting

    No GI-325
    Preset 1-112
    Preset 2-66
    Preset 3-48
    Preset 4-36

    on GTX 770, 1920x1080 windowed
    with i5 4670 CPU @3.4 Ghz
     
    RB_lashman likes this.
  2. amasinton

    amasinton

    Joined:
    Aug 12, 2006
    Posts:
    131
    Tested it on one of our rather more capable machines here in the office - an 16-core machine with dual Titan Blacks.

    I get a steady 61fps with everything cranked up as high as it will go.

    Exceptionally lovely and extremely exciting.

    Sponza demo, please!
     
    RB_lashman likes this.
  3. Martin_H

    Martin_H

    Joined:
    Jul 11, 2015
    Posts:
    4,146
    I have a GTX 670 @ 1920 x 1200 and I get almost the same FPS with the exception that infinite bounces ON does lower my fps.




    The 29fps I get on max do feel like a lot less though because the movement while flying aroud gets very stuttery and irregular. Maybe that's a spike from voxelizing the scene?

    Overall it looks very interesting and promising, but I'm not sure if it would work for what I'd want to use it for in its current state. The temporal sampling seems to cause a lot of artifacts, especially for fast moving objects. And the perspective I'll have would be similar to an RTS and currently it seems that if I fly high the objects start leaving the voxel volume and the pop in at the edges is very noticable. A feature suggestion that I have would be to be able to move the voxel volume yourself, so that it aligns best with the scene you have. E.g. I'd have a lot of empty space between the camera and the first object that is rendered (think of a drone flying at a fixed height over a city), so that would all be wasted if the volume tries to voxelize the empty space directly in front of the cam.

    For the next testcase that you upload I'd love to see a second object placement button that is set to autofire and shoots really fast moving, very bright but small, emissive objects. I'd imagine that could be problematic, but imho it would be a more realistic usecase for any shooter-type game.

    Thanks a lot for the demo, and keep up the great work @sonicether, I know you can do this!
     
    RB_lashman likes this.
  4. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    It is possible to tweak the distance of GI calculation if we would want to decrease it for long distance scene views ?
    Be able to tweak cones number and cone trace steps would this be usefull ?

    This plugin would be also awesome for other purposes like producing some acceptable lightmaps in some second :cool:
     
    Last edited: Jan 14, 2016
  5. jcarpay

    jcarpay

    Joined:
    Aug 15, 2008
    Posts:
    535
    Demo scene works great, lovely stuff!
    Would be very nice to see a Sponza scene.
    Great work @sonicether !
     
    RB_lashman likes this.
  6. sonicether

    sonicether

    Joined:
    Jan 12, 2013
    Posts:
    265
    Yep, that's already a feature. You can assign a transform for the voxel bounds to center itself on instead of the camera. :)
     
    jcarpay, RB_lashman and Martin_H like this.
  7. sonicether

    sonicether

    Joined:
    Jan 12, 2013
    Posts:
    265
    Sponza is coming soon! Thanks!
     
    jcarpay, RB_lashman and Martin_H like this.
  8. IronDuke

    IronDuke

    Joined:
    May 13, 2014
    Posts:
    132
    Tried the demo.
    HOLY COW SHUT UP AND RELEASE IT ALREADY WOOOOOWWW!!!:D
    A question: not really all that related, but I'd like to know how you did the auto-exposure. I'm still relatively inexperienced with a lot of stuff in Unity, so it'd be helpful to know.
    BTW, changing voxel res with the "R" key seems counterproductive since having it at 128 instead of 256 gives lower framerate.o_O
    Also, as far as I can tell, option 2 is offering the highest framerate with decent looks. 3 and 4 definitely look a little better, but they run a lot clunkier on my GTX 960.
    I also noticed the thing where the bounced light can fade in over a few frames. The only spot where it was really noticeable was when I was moving the sun to shine in the cave. The light bouncing to the roof tended to fade over time, but guess what? It's completely forgivable.:D There'll probably be worse glitches in any game anyone makes. Even when I was seeing it, is wasn't as much of a "arrgh that's ugly reaction as it was a "huh that's odd; whatever" reaction.:)
    One last question: What the heck is a Sponza scene?
    Keep it up!

    --IronDuke
     
    RB_lashman likes this.
  9. jcarpay

    jcarpay

    Joined:
    Aug 15, 2008
    Posts:
    535
    RB_lashman likes this.
  10. Kombiice

    Kombiice

    Joined:
    Jan 20, 2015
    Posts:
    64
    takes a lot of processing power !! but its awesome
     
    TooManySugar and RB_lashman like this.
  11. Ryunis

    Ryunis

    Joined:
    Dec 23, 2014
    Posts:
    18
    My results: https://goo.gl/H0UotE
    Also, there is this "smear" with moving objects (below the blue ball):
     

    Attached Files:

    • Bug.png
      Bug.png
      File size:
      619.1 KB
      Views:
      724
  12. SteveB

    SteveB

    Joined:
    Jan 17, 2009
    Posts:
    1,448
    Okay wow...

    ...I'm on an ASUS ROG lappy:

    • i7 4710Q
    • 16 gigs ram
    • 970m (remember this is a mobile 970)
    ..and I'm getting rather boss-level performance:

    • 1 = 100 fps
    • 2 = 60 fps
    • 3 = 45 fps
    • 4 = 37 fps
    Damn, especially if you say you have further optimizations yet to be done.

    Yes you can release this right his very second :D

    -Steven
     
  13. RockSPb

    RockSPb

    Joined:
    Feb 6, 2015
    Posts:
    111
    Looks Fantastic!
    GTX770

    No GI = 240 fps
    1. = 90 fps
    2. = 55 fps
    3. = 42 fps
    4. = 35 fps

    What about Forwad shaders (Foliage for example). How its work with particles?
    Thanks!
     
    zenGarden and RB_lashman like this.
  14. Shinyclef

    Shinyclef

    Joined:
    Nov 20, 2013
    Posts:
    376
    @sonicether Hi sonic, I don't know how feasible this is, but if the voxelisation requires fully formed mesh data (rather then data to produces meshes via geometry shader) will it be possible to let my objects contribute to the voxelisation themselves? This would allow users to make sure anything can be voxelised, even if the MeshRenderer.Mesh doesn't contain a standard format mesh?
     
  15. DMeville

    DMeville

    Joined:
    May 5, 2013
    Posts:
    401
    Ohhh man. Beautiful stuff

    Runs decently on my iMac when booted into windows.
    3.5 GHz i7, 32GB, GTX 780m.

    Infinite bounces on
    1. 65fps,
    2. 42fps,
    3. 32fps,
    4. 26fps

    When testing on OSX with windows in a VM I get a black screen unless GI is disabled though. Understandably this is an odd setup, but hopefully things work on OSX. :)
     
    RB_lashman likes this.
  16. chiapet1021

    chiapet1021

    Joined:
    Jun 5, 2013
    Posts:
    604
    Okay wow, this demo is gorgeous! I'm running it on my laptop with an i7-6700 @ 3.4 GHz and an NVIDIA GeForce GTX 980M 8 GB at the 1920x1080 resolution in Windowed Mode. (I tried running it in fullscreen, but for some reason, it cuts off the FPS counter.) My FPS stats from tweaking the GI settings without moving at all after loading up the scene:

    GI Off - 250

    Preset 1, no infinite bounces, low voxel resolution - 57
    Preset 1, infinite bounces, low voxel resolution - 59
    Preset 1, no infinite bounces, high voxel resolution - 41
    Preset 1, infinite bounces, high voxel resolution - 42

    Preset 2, no infinite bounces, low voxel resolution - 54
    Preset 2, infinite bounces, low voxel resolution - 56
    Preset 2, no infinite bounces, high voxel resolution - 40
    Preset 2, infinite bounces, high voxel resolution - 40

    Preset 3, no infinite bounces, low voxel resolution - 47
    Preset 3, infinite bounces, low voxel resolution - 48
    Preset 3, no infinite bounces, high voxel resolution - 34
    Preset 3, infinite bounces, high voxel resolution - 34

    Preset 4, no infinite bounces, low voxel resolution - 41
    Preset 4, infinite bounces, low voxel resolution - 42
    Preset 4, no infinite bounces, high voxel resolution - 29
    Preset 4, infinite bounces, high voxel resolution - 29

    For me, the sweet spot of quality vs performance is Preset 2, infinite bounces, high voxel resolution. Artifacts were definitely more noticeable when moving objects in that setting, as we were forewarned, but even the higher presets still had a bit of flickering with moving objects, albeit more subtle.

    I wonder if this happens with objects that are on layers culled out for the GI calculation. For example, if moving characters and NPCs were on such a layer, would they still show such artifacts while moving about?

    Regardless, I am really excited by the possibilities here! I'm eagerly awaiting more demos and the eventual beta release on the Asset Store. :)
     
    TooManySugar, DMeville and RB_lashman like this.
  17. Golesy

    Golesy

    Joined:
    Apr 10, 2013
    Posts:
    33
    Here's a nice old card for ya - GTX 460. Its the last thing I need to update in my rig, good for testing though!

    GI Off ~ 140

    Preset 1, inf Off - 58
    Preset 1, inf On - 54

    Preset 2, inf Off - 28
    Preset 2, inf On - 22

    Preset 3 and 4 hovered between 20 - 24, inf On or Off made little difference.

    setting Resolution to 256 always put it between 20 - 30fps on all presets,
    The sweet spot for me was Preset 2 at 128 res, Inf Off. it would stick around 50fps

    Awesome so far!
     
    RB_lashman and zenGarden like this.
  18. FPires

    FPires

    Joined:
    Jan 5, 2012
    Posts:
    151
    Hi Sonicether.

    I couldn't test it for long, but this is my result, with high Voxel Resolution.

    NO GI: 320
    GI Preset 1: 136
    GI Preset 2: 85
    GI Preset 3: 68
    GI Preset 4: 58

    Setting everything to high causes a lot of flicker from the bouncing objects, especially inside the cave, though I suspect it's because otherwise the voxels are more blurred.

    PC: Core i5 3570k, 16 GB, GeForce GTX 780.
     
    Last edited: Jan 15, 2016
    RB_lashman likes this.
  19. TooManySugar

    TooManySugar

    Joined:
    Aug 2, 2015
    Posts:
    864
    Please consider a GI fall of distance so that we do not take computing power for distant elements. Distance fall off or kind of quality fall of if possible to have a soft transition.
     
    zenGarden likes this.
  20. Vagabond_

    Vagabond_

    Joined:
    Aug 26, 2014
    Posts:
    961
    Res; 1680x1050, Voxel Resolution at 256 - 43 FPS
    Res; 1680x1050, Voxel Resolution at 128 - stable 60 FPS.

    This is on GTX 750TI!

    And looks really beautiful except, there are some artifacts.
     
    RB_lashman likes this.
  21. mkgm

    mkgm

    Joined:
    Apr 10, 2015
    Posts:
    134
    GeForce GTX 860M
    Voxel Resolution: 256
    Infinite Bouncing: On

    (1) Low: 31 FPS
    (2) Medium: 17 FPS
    (3) High: 13 FPS
    (4) Ultra: 11 FPS

    And some odd borders:
     
  22. SteveB

    SteveB

    Joined:
    Jan 17, 2009
    Posts:
    1,448
    ...okay so I think it's safe to say across a range of videocards (thanks guys), we're getting great performance considering this is still bleeding edge rendering technology...one of those final frontier dealies that gets us graphics nerds all hot and bothered.

    This is only a beta huh?

    It's gonna be great :D
     
    jcarpay, RB_lashman and Martin_H like this.
  23. eskovas

    eskovas

    Joined:
    Dec 2, 2009
    Posts:
    1,356
    Looking amazing as always.
    Definitely a big difference between noGI and GI.

    The best preset i think is the medium. You can see a lot of differences between low and medium, but not too much between medium and high/ultra. there is still a huge difference in performance between low and medium.
    Need to test this with a more detailed environment. Will probably look even better :D

    Here are my tests:
    CPU - I7 - 4790K @ 4.00GHz
    GPU - GTX 970
    RAM - 16GB DDR3-1600MHz

    NoGI - 360 FPS
    noGI.jpg
    Low - 102 FPS
    GI-low.jpg
    Medium - 65 FPS
    GI-medium.jpg
    High - 50 FPS
    GI-high.jpg
    Ultra - 42 FPS
    GI-ultra.jpg

    One thing i noticed, maybe the setting is wrong or i'm not thinking right.
    Having the Infinite Bounce disabled decreases performance and makes the scene "darker". Doesn't make sense in my head :p shouldn't it be the other way around?

    Anyway, looking great :)
     
    RB_lashman likes this.
  24. SteveB

    SteveB

    Joined:
    Jan 17, 2009
    Posts:
    1,448
    Also keep in mind you can increase the Sun's intensity. So when in fact you get some darker lighting at different presets, you can bring the levels back up. Personally I like 'hotter' looking Sunlight, so it works wonderfully.
     
    RB_lashman likes this.
  25. eskovas

    eskovas

    Joined:
    Dec 2, 2009
    Posts:
    1,356
    Just tested one part of the environment that really impressed me :D

    GI-1.jpg
    GI-2.jpg

    Ofcourse the first image could be improved to look much better without GI, but the GI really looks good

    *Patiently waiting for release* :D
     
    TooManySugar, CWolf, jcarpay and 2 others like this.
  26. SteveB

    SteveB

    Joined:
    Jan 17, 2009
    Posts:
    1,448
    Yea I was going to mention the cave too. That alone really sells the wonderful warm feeling of the Sun pouring in (if you turn the Sun as such towards the mouth of the cave).
     
    RB_lashman and eskovas like this.
  27. Hexaedre

    Hexaedre

    Joined:
    Jan 23, 2015
    Posts:
    110
    The demo is impressive.

    Because I also want to use it for architectural visualization, I am very curious about seeing the SEGI in an more complex indoor situation. I am also curious to see how blury the reflections are.

    Like others, I have noticed some noisy flickering in the dark areas.

    Do you plan to give us a parameter in order to adjust the indirect light intensity ? I feel it is a little bit too bright for my taste.

    I think that the possibility to bake the lighting and update it on demand would be a great thing.


    Here is my performance feedback.

    GTX 680
    i7-3770K 3.50 GHz
    16 Go RAM
    1680 x 1050

    Without GI : 300 - 400 FPS
    1 : 100 FPS
    2 : 60 FPS
    3 : 47 FPS
    4 : 39 FPS


    I can't wait to try it on my projects.
     
    RB_lashman likes this.
  28. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    Here you loose 200-300 fps :eek:, if you have a real game with detailled PBR textures, effects and not a static polygonal scene this you will loose even more fps.

    This is something to really take time to consider before deciding to use it for a game project because you will target only those with hight end graphic cards.
    You won't make lot of sales :rolleyes:
     
  29. FPires

    FPires

    Joined:
    Jan 5, 2012
    Posts:
    151
    It's not the end of the world, the difference between 400 FPS to 100 fps is 7,5ms per frame, which is not really unexpected. If he was running at 110 FPS without GI then GI would drop it to 60 FPS. It takes abour 4.2ms on my system, which would drop 110 to 75 FPS, and I imagine there's still stuff to optimize.

    Even if there isn't, this is pretty great performance for an experimental technology. The last dynamic GI I tested in Unity took 8-12ms per frame here. The performance from Sonicether's solution is pretty crazy good.
     
    one_one, hippocoder, IronDuke and 2 others like this.
  30. eskovas

    eskovas

    Joined:
    Dec 2, 2009
    Posts:
    1,356
    True.
    Would love to see this GI with this Asset: https://www.assetstore.unity3d.com/en/#!/content/49377

    Would really give us something to compare with Unity's own GI and a more complex scene.
     
  31. McMayhem

    McMayhem

    Joined:
    Aug 24, 2011
    Posts:
    443
    The contrast between dark/light combined with the geometry complexity really makes this a great scene to try it out in.

    EDIT: My system stats: NVIDIA GTX 780ti - SLI(x2)

    My own stats:
    GI Off: 350 - 400 FPS
    1: 90 FPS
    2: 74 FPS
    3: 62 FPS
    4: 50 FPS

    I tested draw distance by zooming way out and it handled itself exceptionally well. You're clearly identifying those fringe cases and addressing them. I'm really hoping you come up with something with enough performance scalability that it becomes usable for games targeting large desktop audiences.

    As usual, fantastic work Sonic Ether.
     
    Last edited: Jan 16, 2016
    zenGarden, Martin_H and RB_lashman like this.
  32. jordan_stevens

    jordan_stevens

    Joined:
    Apr 15, 2014
    Posts:
    9
    Very excited to see the results people are showing. A solution like this could bring GI in procedural scenes to the next level. I myself have been working on alternative GI solutions for quite some time, to no avail. Solutions like this give me hope knowing that people are pushing Unity to its boundaries, and extending its capabilities in meaningful ways. Thanks Sonic, can't wait to be a customer.
     
    TooManySugar and RB_lashman like this.
  33. Misciagno

    Misciagno

    Joined:
    Jul 27, 2013
    Posts:
    88
    You can always make it toggleable in game. It is not as if games are only sold to those who can run it on ultra. It has also been said multiple times that performance will improve.
     
    zoid25, HemiMG, CWolf and 3 others like this.
  34. IronDuke

    IronDuke

    Joined:
    May 13, 2014
    Posts:
    132
  35. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    26,726
    Restored my faith in humanity reading someone offering wisdom about millisecs on these forums :)

    I'll add: People *really* need to stop looking at framerate cost. Beyond your monitor refresh, it is a gibberish statistic for gamers, and nothing to do with developers, who live in a world of practical and accurate millisecs.
     
    FPires, sonicether, Nyt0x and 6 others like this.
  36. ksam2

    ksam2

    Joined:
    Apr 28, 2012
    Posts:
    1,030
    Please release a demo of asset! I mean on the asset store. I need to see how it looks on my own project. thanks

    Edit:
    Is there any indirect light option? for example I have a house with a windows but inside of house are totally dark and black! I can't solve that problem with unity GI and indirect light. as I mentioned your GI makes holes even darker.
     
    Last edited: Jan 22, 2016
    CWolf likes this.
  37. Shinyclef

    Shinyclef

    Joined:
    Nov 20, 2013
    Posts:
    376
    Have you tried the demo? You'll see that there is indirect light. Try going in the cave for example.
     
    RB_lashman likes this.
  38. Dmitry45

    Dmitry45

    Joined:
    Dec 12, 2013
    Posts:
    8
    Is it possible to bake lighting? Improve performance.
     
  39. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    He said the idea is interesting and perhaps he could make something like some very fast lightmapping.
     
    CWolf likes this.
  40. RafBR

    RafBR

    Joined:
    Aug 19, 2015
    Posts:
    3
    Downloaded both scenes. You just got a new fan!
     
    RB_lashman likes this.
  41. Cascho01

    Cascho01

    Joined:
    Mar 19, 2010
    Posts:
    1,193
    If GI already works impressive like this in realtime, what might we expect from one minute of baking? :rolleyes:
     
  42. mkgm

    mkgm

    Joined:
    Apr 10, 2015
    Posts:
    134
    @sonicether
    please don't be cruel ;)
    release your product. Your GI is the one big reason to not migrate to Unreal.
    Please, I'm begging you :)

    PD: I'm trying to be funny.
     
    RB_lashman likes this.
  43. macdude2

    macdude2

    Joined:
    Sep 22, 2010
    Posts:
    685
    @sonicether – the demo isn't working on my boot camped macbook pro. Not sure if care about this configuration, but just thought I'd let ya know!
     
  44. janpec

    janpec

    Joined:
    Jul 16, 2010
    Posts:
    3,520
    Brilliant, couldnt have picked better part of scene to show the strenght of GI :)
     
    RB_lashman likes this.
  45. ksam2

    ksam2

    Joined:
    Apr 28, 2012
    Posts:
    1,030
    Why it just makes holes darker instead or make holes brighter?
     
  46. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,571
    I also wondered why the GI demo was darkening the scene, rather than starting with an already darkened scene with black shadows etc, and adding GI lighting to it.
     
    ksam2 likes this.
  47. jordan_stevens

    jordan_stevens

    Joined:
    Apr 15, 2014
    Posts:
    9
    I imagine that the GI is doing just that chingwa.
     
  48. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,571
    @jordan_stevens When you turn the GI off, you would expect the ambient GI contribution to disappear, the result of which would normally be a darker scene with less lighting. However in fact the scene is actually becoming quite a bit lighter so the GI (at least the way it's setup in this scene) is adding both light and shadow to the scene, which is a bit unintuitive for demo purposes.
     
    ksam2 likes this.
  49. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,571
    I'd also add that the static scenery looks quite nice even on the lowest GI detail level, but when you click on an object to move it around the scene it's very apparent that the GI contribution on dynamic objects still needs work. Unless you crank the GI detail up to the highest there are some hard to ignore artifacts while objects are moving. It's possible this is made more obvious by the untextured assets, and that normal texture work would hide some of this for many people.

    All in all though I'm very excited about the prospect of realtime GI and am looking forward to seeing how this develops.
     
    one_one likes this.
  50. ksam2

    ksam2

    Joined:
    Apr 28, 2012
    Posts:
    1,030
    Exactly! GI should make dark places brighter!
     
Thread Status:
Not open for further replies.
unityunity