Search Unity

  1. New Unity Live Help updates. Check them out here!

    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. DMeville

    DMeville

    Joined:
    May 5, 2013
    Posts:
    400
    @sonicether That's really too bad, but even the original approach looks crazy awesome, I really can't wait to try it out! I also think you should submit the bug to Unity for sure; worst case scenario nothing happens, best case scenario everyone who's been impressed with your work on this will got vote on the bug and it gets fixed :)
     
    RB_lashman and hopeful like this.
  2. CKahler

    CKahler

    Joined:
    May 6, 2013
    Posts:
    149
    @sonicether: great process so far, I really like to offer you my help with the compute shader issues, therefore I recommend that you make your project public, so other people can help you pushing it forward. You won't make much money with this anyway, because the majority of unity users develop for mobile games or don't need full dynamic GI, like we do.
     
    Last edited: Sep 14, 2015
  3. 8Infinite8

    8Infinite8

    Joined:
    Jul 27, 2013
    Posts:
    112
    I would surely be interested in this and would be glad to vote on the bug submission.

    Also perhaps posting here might help others to vote http://feedback.unity3d.com/ I would gladly put the word out to others I know to vote.
     
    DMeville likes this.
  4. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,670
    If you could submit a bug report using the in-editor bug reporter with your simple cut-down repro scene, that would be great.

    Simply have the project open in the editor and use the in-editor bug reporter, found at the bottom of the help menu.
    Report-a-bug.png

    Give a simple description of the issue and show any of the details that you've discovered. When you're done, you can PM me the bug report number, and I'll try to get some traction.

    If you have any questions, please don't hesitate to ask.
     
  5. sonicether

    sonicether

    Joined:
    Jan 12, 2013
    Posts:
    265
    Thanks, Adam! Just submitted the bug and sent you a PM. I know you guys are very busy, I appreciate your time.
     
    IronDuke, one_one, SAOTA and 3 others like this.
  6. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,670
    Thanks, I'll see what I can do.
     
    IronDuke, one_one, Licarell and 4 others like this.
  7. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,670
    Did you see the reply to the big report? They claim to understand the issue and have proposed a workaround while it's being worked on.

    Let me know if you need anything more.
     
    8Infinite8, Arkade, one_one and 5 others like this.
  8. sonicether

    sonicether

    Joined:
    Jan 12, 2013
    Posts:
    265
    Yep! We've been corresponding. You guys are awesome :)
     
    8Infinite8, blueivy, one_one and 5 others like this.
  9. SAOTA

    SAOTA

    Joined:
    Feb 9, 2015
    Posts:
    220
    Everything is Awesome!!
     
    RB_lashman likes this.
  10. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,670
    Glad to help! (^_^)!
     
    Tim-C, DMeville and RB_lashman like this.
  11. IronDuke

    IronDuke

    Joined:
    May 13, 2014
    Posts:
    132
    This ^^

    --IronDuke
     
  12. smetzzz

    smetzzz

    Joined:
    Mar 24, 2014
    Posts:
    142
    Great to hear things are moving along! Keep up the sweet work @sonicether
     
  13. novello_io

    novello_io

    Joined:
    Nov 22, 2009
    Posts:
    293
    Excited for this :)
     
  14. blueivy

    blueivy

    Joined:
    Mar 4, 2013
    Posts:
    498
  15. Misciagno

    Misciagno

    Joined:
    Jul 27, 2013
    Posts:
    88
    I will instantly buy if it works with Alloy shaders on release.
     
    RB_lashman likes this.
  16. novello_io

    novello_io

    Joined:
    Nov 22, 2009
    Posts:
    293
    I'll instantly buy even if it doesn't :D
     
    Pecek, Licarell, 8Infinite8 and 2 others like this.
  17. blueivy

    blueivy

    Joined:
    Mar 4, 2013
    Posts:
    498
  18. sonicether

    sonicether

    Joined:
    Jan 12, 2013
    Posts:
    265
    Here's a higher quality image :)

    gi comparison.jpg
     
    IronDuke, smetzzz, blueivy and 8 others like this.
  19. FPires

    FPires

    Joined:
    Jan 5, 2012
    Posts:
    151
    The quality is pretty insane.
     
    sonicether and RB_lashman like this.
  20. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,670
    It is nice, innit?
     
    SAOTA, sonicether and RB_lashman like this.
  21. Dreamaster

    Dreamaster

    Joined:
    Aug 4, 2014
    Posts:
    148
    OMG!!! THE TREE BARK IS LIT PROPERLY.... SHUT UP AND TAKE MY MONEY!!!!
     
  22. jcarpay

    jcarpay

    Joined:
    Aug 15, 2008
    Posts:
    520
    From your twitter post I understand the top image (the darker one) is with GI?
     
    TerraUnity likes this.
  23. elias_t

    elias_t

    Joined:
    Sep 17, 2010
    Posts:
    1,204
    This.
     
  24. sonicether

    sonicether

    Joined:
    Jan 12, 2013
    Posts:
    265
    Yep, the top image is with GI.
     
    TerraUnity, jcarpay, Licarell and 2 others like this.
  25. Seith

    Seith

    Joined:
    Nov 3, 2012
    Posts:
    725
    It is! Currently I don't use GI in Unity because of the precalculation requirements (although it was presented initially as real-time). I'll take an imperfect true real-time GI solution over a better one requiring precalc anytime. Then again, I'm not an engine developer, I just see things from a user point of view.
     
    one_one, yezzer, Misciagno and 2 others like this.
  26. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    So when do i start saving my money for? And how do you feel about its performance currently?
     
    RB_lashman likes this.
  27. sonicether

    sonicether

    Joined:
    Jan 12, 2013
    Posts:
    265
    So, I know I said I'd work on the more crude GI I originally showed in the OP, but I'm going to have to wait for the guys at Unity to fix a couple things before releasing this voxel-based GI anyway, so I might as well be spending that time improving it. The original approach is fine, but it's a one-trick pony far from the full lighting system that the voxel-based GI approach is.

    Performance-wise, the worst part is voxelization, and that is dependent on triangle count of the area within the volume bounds. I would definitely not recommend just slapping it in your scene with no second thought. In a scene with about 900k triangles, voxelizing everything (256x256x256 resolution) takes about 4.7 milliseconds on my 980 TI. I certainly hope that I can speed that up soon, but there's no need to voxelize all those triangles, since the volume is just an approximation of the scene. If you used layers and the culling mask of the main camera and the voxelization pass, you could render the high quality models for on-screen rendering, and have low-poly approximate models in the scene for voxelization. You could also leave out a lot of needless detail models like clutter, grass, etc. For example, you could probably reduce the poly count of those building models (in the screenshot above) by 90% while leaving minimal impact on the look of the GI. Assuming that you could make such a reduction of poly count for voxelized objects in the whole scene, you'd look at around a 90% improvement. If that's not enough, reduce the voxel resolution to 128x128x128 and you'd see an improvement as well.

    I think if it's used in that way, performance will be quite practical for games. The cone tracing itself (at high quality settings--what you've been seeing in my screenshots) costs 3.0 milliseconds at 1080p with a 256x256x256 volume on my 980 TI. Increase the cone angle, reduce the number of samples, or decrease the volume resolution, and you'd see performance improvements. I'm starting to feel confident that this approach could be performant and scalable enough for games.

    Though, of course, ALL of this is subject to change. For example, if for some reason I find a visual artifact that needs to be taken care of, cost could go up. If I find an optimization, it could go down. I do have some worries about the cone tracing and the particular approach I'm using. I'm using stochastic sampling (noise jitter) combined with temporal sampling (reprojecting and combining the result of previous frames) to both reduce discretization artifacts (aka banding) and save on performance by taking advantage of redundancy. In the majority of cases, noise is either unnoticable because of textures in the scene, or can be removed easily with filtering. Though, this approach may end up causing unacceptable issues in certain situations and I might have to find an alternative that people can use if they wish. That's why I'll need beta testers!
     
  28. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    I challenge anyone NOT to ask to be a beta tester (i failed)
     
    RB_lashman likes this.
  29. chiapet1021

    chiapet1021

    Joined:
    Jun 5, 2013
    Posts:
    604
    I want to first ask how to become a beta tester. And when I can become one. :)
     
    RB_lashman likes this.
  30. Razmot

    Razmot

    Joined:
    Apr 27, 2013
    Posts:
    286
    What about procedural environment that are already made of voxels ? in my particular case, it's marching cubes + cubes + various slopes / half blocks mixed with the cubes, and then some prefabs.

    I'm pretty sure I could pass the volume data I already have on the cpu to your GI system instead of re-voxelizing with the gpu.
     
  31. Unreal-Vision

    Unreal-Vision

    Joined:
    May 6, 2013
    Posts:
    58
    Hi Cody,

    I sent you an email to "cody@...." including some interesting reference guide on SSGI and voxel but never received any reply.

    Do you received? What do you think about it?

    Thanks,
     
  32. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    ill go do it myself then i guess
     
  33. Tasmeem

    Tasmeem

    Joined:
    Jan 14, 2010
    Posts:
    111
    Just a suggestion, because I really don't want to see another Unity 100% realtime GI solution with great potential go under (happened four times last year already). How about you release the one in the original post and sell it (me and plenty others are willing to pay for it as it is now) and work as you wish on any new alternatives you have.

    Please, for the love of all that is good, do that. Let's not wait any more! Development on proper GI will never stop but let's take it one step at a time.
     
    Mauri, FPires and RB_lashman like this.
  34. Vadya_Rus

    Vadya_Rus

    Joined:
    Oct 23, 2013
    Posts:
    8
    I would very much like to take part in testing this GI solution! :)
     
    RB_lashman likes this.
  35. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    So a big PC hardware is required, this is the main issue with realtime GI, as your game will only sell for a really small population of gamers.
     
  36. sonicether

    sonicether

    Joined:
    Jan 12, 2013
    Posts:
    265
    That may be possible, though voxelizing with the GPU may be faster anyway, since lighting has to be calculated for each voxel as well. I'm not exactly sure.

    Sorry about that! I checked it out and it seems to be a variation of deferred irradiance volumes, which requires precomputation (check here for an explanation http://codeflow.org/entries/2012/aug/25/webgl-deferred-irradiance-volumes/#sampling-the-scene). So, for 100% dynamic GI, it's not an option.

    I think that if you read that paragraph a little more closely you may come to a different conclusion.

    I feel that both approaches are equally close to being ready for beta testing. Both have their own drawbacks, certainly, which is unavoidable when it comes to real-time graphics, especially when we're talking about dynamic GI. At this point, I really need some outside perspective on what needs to be improved and what is acceptable or not. So, I'd like to start testing very soon, I just need to figure out exactly how I want to do that.
     
    Vadya_Rus, Licarell, Razmot and 4 others like this.
  37. HenriqueGomez

    HenriqueGomez

    Joined:
    Dec 13, 2012
    Posts:
    63
    Hey Cody! Nice work! :D
    I just wanna ask you if there's a possibility for you to post a new demo in the current phase of your project.
    You know, just for testing the unlimited bounce and stuff.
    And if it's not much asking, please, don't use Sponza XD
     
  38. Tasmeem

    Tasmeem

    Joined:
    Jan 14, 2010
    Posts:
    111
    What's wrong with sponza? It is the best GI showcase scene out there.

    At least do sponza + something else :)
     
  39. Mauri

    Mauri

    Joined:
    Dec 9, 2010
    Posts:
    1,698
  40. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    It is some demo ? Or it is another Unity real time GI project that is fading away ?
    Unity is bringing real time GI already i should we use your system ?
     
  41. omarzonex

    omarzonex

    Joined:
    Jan 16, 2012
    Posts:
    156
    wow
    Perfect Engine Environment lighting Realistic
    how highest quality settings lighting GI ???
    parameter perfect this .....
     
  42. Mauri

    Mauri

    Joined:
    Dec 9, 2010
    Posts:
    1,698
    Yep, it's gone a bit quiet recently... :( I really hope it's not. This needs to become a reality. Unity needs this.

    Not quite true, unfortunately. Unity's Enlighten is no where near realtime. You can't modify things in your scene without rebuilding GI, for example...
     
    TooManySugar likes this.
  43. omarzonex

    omarzonex

    Joined:
    Jan 16, 2012
    Posts:
    156
    Slow Animation
    why ????
    graphics card or hardware
    or setting parameter GI
     
  44. omarzonex

    omarzonex

    Joined:
    Jan 16, 2012
    Posts:
    156
    My projects for one Environment but version unity4 not 5


     
  45. rebit

    rebit

    Joined:
    Nov 13, 2014
    Posts:
    133
    IndieAner3d likes this.
  46. rebit

    rebit

    Joined:
    Nov 13, 2014
    Posts:
    133
    @sonicether, i would like to suggest to you do a render multi-pass for Unity, Like the company Hibernum does.

    Did you watch this presentation ? Look to 22:00 minutes, and you will see the Nvidia Iray integration.



    Its possible to you make a integration like this approach ? :)

    Unity is awesome tool to make 3D animations, with uSequencer and Cinema Director, when we need more photoreal detail, another render will be awesome. ( not realtime, but for high quality pipeline animation, realtime maybe is not a requeriment ).
     
    Last edited: Oct 23, 2015
  47. DMeville

    DMeville

    Joined:
    May 5, 2013
    Posts:
    400
    Unless I read that wrong, that image took 10+ hours to render. Not really realtime, still neat though in such a small program.
     
    one_one and rebit like this.
  48. Mauri

    Mauri

    Joined:
    Dec 9, 2010
    Posts:
    1,698
    smallpt is using path tracing and this is a technique you can't use in realtime.
     
  49. pan567

    pan567

    Joined:
    Aug 8, 2015
    Posts:
    7
    i would recommend using a variation of voxel cone tracing called ''Delta Voxel Cone Tracing"more details below:

    Paper
     
  50. rebit

    rebit

    Joined:
    Nov 13, 2014
    Posts:
    133
Thread Status:
Not open for further replies.
unityunity