Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Fully Dynamic Diffuse Global Illumination

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

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

    sonicether

    Joined:
    Jan 12, 2013
    Posts:
    265
    The Minecraft stuff was just on my free time. I'm still working on this, don't worry. I was also sick for a few weeks, sorry for the silence.

    I'm a perfectionist, which is both a blessing and a curse, and there's been one thing I've been stuck on. So, for both approaches, I'm using temporal sampling with reprojection, which works very well for scenes with minimal movement, but since I don't have access to a per-object velocity buffer, a scene like being inside a moving elevator could give some strange results. Fortunately, there seems to be an alternative, but I haven't quite ironed out the performance and quality of it yet. Optimistically, it seems promising.

    If I were to build a per-object velocity buffer, it would almost completely solve this issue. Interestingly enough, an added benefit of a velocity buffer would be that you wouldn't have to take this step again for per-object motion blur, so both the GI and motion blur would share this cost. I just don't know if rendering a per-object velocity buffer is the right way to solve this problem...

    This issue is pretty much the only sore thumb left--the only thing that has been postponing the release of the non-voxel based approach, and the beta testing of the voxel based approach. I'm considering at this point just moving on with the beta testing of voxel GI and the non-voxel GI. I think having this tested in a variety of situations and getting opinions will help me decide what's best.

    Real-time GI is no trivial feat. I wish this project had progressed faster. I'm doing my best, thanks for sticking with me.
     
    one_one, SAOTA, FPires and 5 others like this.
  2. Howard-Day

    Howard-Day

    Joined:
    Oct 25, 2013
    Posts:
    137
    Would it help if there was an existing asset that generated a velocity buffer already? Amplify motion blur does - and I imagine that you could link into that?
    In addition, I am seriously eagerly awaiting this. I understand the drive for perfectionism - and I'm sure it'll be worth it.
     
  3. sonicether

    sonicether

    Joined:
    Jan 12, 2013
    Posts:
    265
    Yep, that could possibly work.
     
    RB_lashman likes this.
  4. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    Some projects does not need Motion blurr.

    Will you post some test demos for both , i would like to try it on my computer and see how it runs.

    I would see this real time GI well on some Zelda Wind Waker game.
     
    Dreamaster likes this.
  5. Zeblote

    Zeblote

    Joined:
    Feb 8, 2013
    Posts:
    1,102
    The ideal ammount of motion blur in a game... is no motion blur.
     
    SAOTA and FPires like this.
  6. IronDuke

    IronDuke

    Joined:
    May 13, 2014
    Posts:
    132
    @sonicether Glad you're feeling better. I'm not going anywhere, so take your time! I also understand the perfectionist thing. I think all developers are probably perfectionists to an extent...

    @Zeblote I disagree. I've seen games where very judicious use of motion blur greatly enhances the game. Like an anti-aircraft artillery game, motion blur could be used for the planes whizzing by (but not the terrain or rotating the gun would get sickening.) Or a space game when you're in warp. Heavy motion blur adds to the effect of warping space to travel FTL.
    Besides, any image effect by sonicether will look awesome regardless.
     
    one_one likes this.
  7. Nyt0x

    Nyt0x

    Joined:
    Feb 3, 2014
    Posts:
    18
    The velocity buffer can be used for Temporal anti aliasing too tho.
     
    RB_lashman likes this.
  8. 5LS-Brent

    5LS-Brent

    Joined:
    Sep 17, 2013
    Posts:
    14
    I sent you an email but we're desperately searching for realtime GI solutions for our next game after Satellite Reign. Happy to help out where we can testing for you as your solution seems to be the most promising so far.
     
    DMeville and RB_lashman like this.
  9. RB_lashman

    RB_lashman

    Joined:
    Aug 15, 2013
    Posts:
    92
    totally off-topic, but I really love the way you guys used Sonic's bloom in SR :D
     
  10. Howard-Day

    Howard-Day

    Joined:
    Oct 25, 2013
    Posts:
    137
    I'm doing cinematic-level rendering in Unity, as I've gotten tired of the time overhead in normal rendering, and I'm trying to see how far I can push it.... With what else? Star Wars. :D I've already altered your SSAO to provide some very fake Bounce lighting in corners, but it's not working near as well as your *actual* solution!
    Unity 2015-10-29 03-25-44-89.png
    Obviously this could greatly benefit from some bounce lighting.
     
    rebit likes this.
  11. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    I think it is vaporware like many some other past threads i have seen until you have a real demo available to test, but they just faded away after some time.
     
  12. one_one

    one_one

    Joined:
    May 20, 2013
    Posts:
    621
    Criticism is great and necessary, but it feels like you're being negative here just for the sake of it, @zenGarden .
     
  13. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    I am not negative.
    You have realtime GI that is downloable and you can test it in UE4 forums, this is not vaporware or just long conversations tchat :rolleyes:
    https://forums.unrealengine.com/showthread.php?44278-Realtime-Dynamic-GI-Reflections-AO-Emissive-plugin-AHR
    And i don't need real time GI in Unity, because i don't use Unity to target big hardware, but instead a large range of hardware.
     
  14. 5LS-Brent

    5LS-Brent

    Joined:
    Sep 17, 2013
    Posts:
    14
    Thanks!, I'm actually using Sonic's SSAO in our new prototype stuff as well :)
     
    RB_lashman likes this.
  15. RB_lashman

    RB_lashman

    Joined:
    Aug 15, 2013
    Posts:
    92
    ooooh ... exciting news :D keep up the good work!!!
     
  16. Tokam

    Tokam

    Joined:
    Aug 30, 2014
    Posts:
    2
    I must say, this is looking absolutely fantastic. If there's any way I can possibly help out, please let me know!
     
  17. Glader

    Glader

    Joined:
    Aug 19, 2013
    Posts:
    455
    Is that really constructive? You're not paying them to develop this so don't expect anything from a WIP thread.

    Also, for the many other posts I see you make all over forums... Just why?
     
    Pecek, chiapet1021 and IronDuke like this.
  18. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    Like it or not , what i think about real time GI previous people same threads in Unity.
    I won't use real time GI, if i needed it today, it would be in Unreal 4, i won't pay attention anymore to this thread, so just forget it.
     
  19. FuzzyQuills

    FuzzyQuills

    Joined:
    Jun 8, 2013
    Posts:
    2,871
    Still though, SonicEther's efforts are proving impressive, IMO.
     
    RB_lashman likes this.
  20. Licarell

    Licarell

    Joined:
    Sep 5, 2012
    Posts:
    434
    Not a lot of Zen in that garden....sheesh....
     
    Pecek, Martin_H, HemiMG and 5 others like this.
  21. Misciagno

    Misciagno

    Joined:
    Jul 27, 2013
    Posts:
    88
    I'm sensing very high sodium levels in this thread.
     
    SteveB likes this.
  22. IronDuke

    IronDuke

    Joined:
    May 13, 2014
    Posts:
    132
    Guys? Can we tone it down a little? It'd be awful if a mod had to close this thread; bad publicity for sonicether!

    --IronDuke
     
  23. smetzzz

    smetzzz

    Joined:
    Mar 24, 2014
    Posts:
    145
    There is a very rare ability when a developer not only excels in code but also in art. Sonic Ether is one of those devs. We should all pay attention and not underestimate his efforts.
     
    ArthurT, IronDuke, RB_lashman and 2 others like this.
  24. sonicether

    sonicether

    Joined:
    Jan 12, 2013
    Posts:
    265
    So I figured it's time for an update.

    I did a performance test on a GTX 660 TI and was pleased to see 45-80 fps depending on the scene and quality settings. When voxelization is not running (just keeping the previously voxelized information), all the effect has to do is the actual cone tracing itself, which is surprisingly fast--quicker than some robust SSAO algorithms. This could be exploited for static scenes/geometry.

    Since updating the voxels is the most expensive part of this effect, perhaps there could be a happy medium between voxelizing every frame and not voxelizing at all. I've got a few ideas to more gradually update the voxels (perhaps in "chunks") to spread the cost of voxelization across multiple frames. For a lot of games, it would seem redundant to update the entire voxel volume every single frame.

    I've fixed probably the biggest eye sore, which happened when multiple fragments (from overlapping geometry) would attempt to write different values to the same voxel. The result was similar to z-fighting, since the pixel shader was doing non-atomic writes--sometimes one surface would win the fight, sometimes the other. The fix requires a bit of overhead, but it solves the problem completely. I'm really hoping that I can mitigate the costs of this fix, since it adds about 3.5 ms to the cost of updating voxels. It'll definitely be an optional thing when this is released, since some scenes don't need it.

    The next big step is to implement cascades for more efficient use of limited resources for larger scenes. This could play into what I mentioned before about not all voxels needing to be updated every frame, as farther away objects could be voxelized less often. I'm hopeful that implementing cascades will provide a significant boost to quality/cost.

    I'm still a little worried about light leaking, but any fixes would just make the effect more costly or impact other aspects of visual quality in other ways negatively. I've tried one fix, and it was just way too hefty. I've got another fix in mind that I'll give a try at some point. I'll let you guys know how that goes.

    Finally, I've been working more on reflections. Check out the screenshots I tweeted to see how they look https://twitter.com/sonic_ether/status/669312689471012864

    Now that I've got all the negative stuff out of the way, I must say it's awesome to load up a scene, setup the materials, throw a few emissive objects for lighting and watch the GI take care of the rest. It's no exaggeration when I say that my current #1 goal in life is to make the joys of using this tech a reality for game developers so they can dazzle their audiences with beautiful lighting.

    One more thing. Someone put together a demo for CryEngine's new Sparse Voxel Octree Global Illumination (you can check it out here: http://www.cryengine.com/community/viewtopic.php?f=309&t=131851 ). I checked it out, and without having the details of the exact time required for rendering GI, it seems that my solution and CryEngine's seem at least on-par with each other in terms of performance vs quality in this particular scene/lighting setup. Again, I'm not totally sure what else is running in the demo (looks like motion blur, tonemapping, bloom, and post-AA) but at 1080p I was running the demo at high quality settings around 35-45 fps. In Unity with my GI in the same scene at 1080p (with bloom, tonemapping, and post-AA), it was running at about 75 fps with re-voxelization of all objects every frame (with the new costly fix I mentioned above which is optional). The noteworthy difference here is that, as far as I've read of their implementation, voxelization is not dynamic--the scene is pre-voxelized. The crytek sponza scene is fairly heavy for voxelization, if I disable voxelization on every frame, my frame rates skyrocket to around 200. Again, it's not necessarily a scientific comparison, but looking at the surface it's pretty encouraging.

    And of course, I just had to compare the two visually. Here's CryEngine's SVOGI:


    And here's my GI (a bit grainy, filtering was disabled when I took the screenshot)



    I apologize for the long post. I hope it's clear that I'm trying to be as transparent and honest as possible. If this project doesn't see completion, it wouldn't be for lack of trying. :)
     
    TerraUnity, Trunka, rebit and 14 others like this.
  25. P1st3ll1

    P1st3ll1

    Joined:
    Dec 13, 2012
    Posts:
    69
    OMG Cody... *0*
     
    RB_lashman likes this.
  26. SteveB

    SteveB

    Joined:
    Jan 17, 2009
    Posts:
    1,451
    Hmmm either I'm crazy, but your shot looks better. Noting the color bleed and the quality of the indirect bounce of the first floor versus the second (more light energy would be available on the second floor than it would be on the first).

    Wow...

    ...and I'll be the first to ask, but how far along the 'release path' does this take you? :D

    Cheers Sonic and bravo

    -Steven
     
    RB_lashman likes this.
  27. zugsoft

    zugsoft

    Joined:
    Apr 23, 2014
    Posts:
    453
    Your GI system is better than CryEngine's, amazing.
    Congrats
     
    Trunka and RB_lashman like this.
  28. sonicether

    sonicether

    Joined:
    Jan 12, 2013
    Posts:
    265
    I got around to putting some PBR goodness into the reflections. Just a slight change in how roughness is handled coupled with some roughness maps really gives a great result. Metallic fabric is a thing, right?


     
  29. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    It can be when it looks that good. If you ever came to us with 'sorry guys i cant give it to you, it simply didnt come through to completion' i for one will hulk smash. This is looking great and given i do love my procedural stuff youre making my day with the screenshots. Needless to say its looking a bit essential - im targeting the proposed VR minimum spec of a gtx 970 with fairly small scenes (for now) so im pretty pleased with the figures youre giving
     
    Martin_H and RB_lashman like this.
  30. mangax

    mangax

    Joined:
    Jul 17, 2013
    Posts:
    334
    this is amazing.. these screens are so realistic , i mean if you used higher poly models and i didn't see the model before... i wouldn't tell easily if it is real or cg..
     
    Last edited: Nov 26, 2015
    RB_lashman likes this.
  31. SAOTA

    SAOTA

    Joined:
    Feb 9, 2015
    Posts:
    220
    This is awesome SE.

    Let me test it in my scenes!!
     
    RB_lashman likes this.
  32. elias_t

    elias_t

    Joined:
    Sep 17, 2010
    Posts:
    1,367
    Ahem... Release it already!
     
    chiapet1021, RB_lashman and Mauri like this.
  33. jcarpay

    jcarpay

    Joined:
    Aug 15, 2008
    Posts:
    561
    Absolutely brilliant!
     
    RB_lashman likes this.
  34. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    Better and faster than Cry Engine o_O, Cryengine is fast optimised engine ... it's really hard to believe. Give us a webplayer demo.
     
  35. one_one

    one_one

    Joined:
    May 20, 2013
    Posts:
    621
    You know you've done a good job when even zenGarden isn't being dismissive. Nice going, @sonicether .
     
    Tiny-Man, Misciagno, SteveB and 4 others like this.
  36. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    Each time i hear relatime GI, i always want a demo before saying it is good.
    Last Unity real time GI i downloaded for Unity was good , but it was too slow for some medium to good hardware, it was too much GPU intensive and i don't make games targetting top hardware.
    Pictures don't talk for me, only demos i can tests on a computer are valuable, i was just wandering how fast this new system could be ? But without a download it is not possible to even compare that with Crysis solution.
     
    DMeville likes this.
  37. timsoret

    timsoret

    Joined:
    Apr 9, 2015
    Posts:
    16
    Stop behaving like a child, zenGarden.
    You're not entitled to anything. Anyone serious about gamedev knows that SonicEther is trustworthy. If you don't, that's your problem, but please don't pollute the topic anymore. Thanks. You said "i won't pay attention anymore to this thread", so act as you said instead of bringing down SonicEther's motivation.
     
    Pecek, TooManySugar, Nyt0x and 5 others like this.
  38. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    Yep, i let you guys deal with realtime GI , it's not something that interest me.
     
  39. Trunka

    Trunka

    Joined:
    Dec 3, 2014
    Posts:
    17
    you raised the bar, cody.
     
    RB_lashman likes this.
  40. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,269
    Looks incredible :)
     
    RB_lashman likes this.
  41. TooManySugar

    TooManySugar

    Joined:
    Aug 2, 2015
    Posts:
    864
    Pretty awesome. Recently unity released a gi showcase project on the store with a futuristic fashioned building. You should try your system with that environment and see how it goes.
     
    rebit, Martin_H and RB_lashman like this.
  42. rebit

    rebit

    Joined:
    Nov 13, 2014
    Posts:
    133
  43. SteveB

    SteveB

    Joined:
    Jan 17, 2009
    Posts:
    1,451
    Actually that's a great idea Rebit!
     
    RB_lashman likes this.
  44. DivergenceOnline

    DivergenceOnline

    Joined:
    Apr 19, 2015
    Posts:
    244
    "If this project doesn't see completion". Cody, if you aren't even willing to guarantee to people that after teasing them with media for such an incredibly long time that you are going to give it to them, then I don't think you should keep showing it off like you do. There's only so long you can keep showcasing all these incredible still images on twitter, basically saying "look what i can't do, bet you wish you could also, but I'm not allowing that" before people start calling shenanigans.
     
    zenGarden likes this.
  45. CWolf

    CWolf

    Joined:
    Oct 24, 2011
    Posts:
    106
    I understand some people are getting frustrated by the whole real runtime G.I situation (along with the multiple failed attempts by other developers) but I think some of the harsher comments starting to show up are off the mark. You must remember how complex an issue this is and how transparent Cody is being.

    Developers are damned if they don't release information and damned if they are too transparent. Give Cody a break and concentrate on your project for a while. Come back and you may be surprised. He's allowed to show off his progress and you're not entitled to anything until the product is released and you've paid for it.

    I'm happy to see the progress shots and, as people who have been following real runtime G.I for a while should know, you take these things with a pinch of salt. Hope for the best and prepare for the worst =).

    @sonicether: You've made some great progress. Good luck for trying to finish it.
     
  46. Martin_H

    Martin_H

    Joined:
    Jul 11, 2015
    Posts:
    4,434
    What he said was basically "the only reason this will not get completed is if it is not technically feasible.". He ows you nothing, he can show and post whatever he wants. The tech he is working on is obviously bleeding edge and pushing the boundaries. How could you ever expect anyone to make any guarantees when working on something like that? Not making promises he can't keep 100% imho is quite professional here. He is risking his time investment for something that may or may not be possible and all you have to contribute is unconstructive whining. If I was in his shoes I'd be super frustrated reading your comment and frankly I consider it disrespectful.
     
  47. DivergenceOnline

    DivergenceOnline

    Joined:
    Apr 19, 2015
    Posts:
    244
    I'm sorry that you're in that phase where you think constructive criticism means giving automatic praise to every single thing that comes down the pipe, and people who don't do that are big meany heads. My advice would be to make sure you yourself don't try to sell people a product in the future if this is what you consider to be super frustrating and disrespectful. The reality is that he's a big boy with two launched products and can speak for himself. If the words of someone like me, someone who's bought everything he's ever sold and supported him (actual financial support, not just lip service) when he needed it are worth refuting, he'll comment on it. Misplaced fanboism benefits no one.
     
    Mauri likes this.
  48. S_Darkwell

    S_Darkwell

    Joined:
    Oct 20, 2013
    Posts:
    320
    @sonicether: I deeply hope that your project sees completion. Whether or not it does, however, thank you for sharing your efforts with the community. Whatever projects you may be working on now or in the future, please don't stop sharing. It is inspiring to see those in the community taking on even the largest beasts.

    Thank you!
    - S.
     
  49. TooManySugar

    TooManySugar

    Joined:
    Aug 2, 2015
    Posts:
    864
    THis is a WIP thread. If you can do better then start coding or go the the Asset Store thread to grab finished stuff.
     
    RB_lashman likes this.
  50. SemaphoreStudios

    SemaphoreStudios

    Joined:
    Jan 14, 2010
    Posts:
    111
    I understand that this is a such a complicated are and Cody is doing a great job sharing what is happening (what works and what doesn't and what he will try next).

    My suggestion is simply something akin to (Steam Early Access), divide the project into multiple milestones, deliver milestone 1 (sell it to the users on the asset store while saying this is an alpha like Final IK does for example) and keep building on it to deliver milestone 2 and so on.

    This way people see the actual product, get to test it on a wider range of hardware and use cases and Cody gets some revenue stream going which will help his development efforts.
     
    RB_lashman likes this.
Thread Status:
Not open for further replies.