Search Unity

SEGI (Fully Dynamic Global Illumination)

Discussion in 'Assets and Asset Store' started by sonicether, Jun 10, 2016.

  1. Shinyclef

    Shinyclef

    Joined:
    Nov 20, 2013
    Posts:
    505
    Danger is his (and my) middle name.
     
    jefferytitan likes this.
  2. Ninlilizi

    Ninlilizi

    Joined:
    Sep 19, 2016
    Posts:
    294
    Awesome.... I'll send it in a PM in a mo.

    Fiddling with the emissives still.... Got a material shader that writes the emission maps to the gbuffer now..... Which the GI can read without having to do an extra render pass.... So that's a plus, also. I figure that will be easy enough for people to be able to add support to their custom shader. How to handle on the GI side, I'm still undecided... the voxelizer seems to handle emissives badly..... Regular lights fine.. emissives, huge smeary mess... So I'm tempted to pathtrace the indirect.... And pass the emissives off to RSM and mux both pathways in the final blit. That'll give up emissives that pop alongside the super smooth tracing that's going on.
     
    neoshaman and hopeful like this.
  3. Ninlilizi

    Ninlilizi

    Joined:
    Sep 19, 2016
    Posts:
    294
    I'm adding an example, emissive writing out shader to the bundle... that's based on cat like codings spherical harmonic shader. It's a one line modification. So should be easy enough to figure out.... I'll use that mechanism for picking any none unity light related lighting.... So people can just feed anything they like into it.
     
  4. Crossway

    Crossway

    Joined:
    May 24, 2016
    Posts:
    507
    For me SEGI performance on DX11 is a lot better than DX12! is that normal?
     
  5. Ninlilizi

    Ninlilizi

    Joined:
    Sep 19, 2016
    Posts:
    294
    Interesting... I'd not tried it with DX12... But I'd say that shouldn't be normal. I'll add it to my list of things to test against.
     
  6. Ninlilizi

    Ninlilizi

    Joined:
    Sep 19, 2016
    Posts:
    294
    As I'm sometimes pretty chatty, and I'm working on my own from mostly the ground floor frankenGI that's closely related but not entirely SEGI.... I've added a GI channel to my ghost town of a Discord. So if you'd like to be closer to the metal or just chat about GI related schenanigans https://discord.gg/RV4HUD
     
  7. jjejj87

    jjejj87

    Joined:
    Feb 2, 2013
    Posts:
    1,117
    Just getting my dancing clothes...to dance!

    Also, Nin, maybe add a link of your git under your profile so that it is easy to download.
     
  8. Ninlilizi

    Ninlilizi

    Joined:
    Sep 19, 2016
    Posts:
    294
  9. RockSPb

    RockSPb

    Joined:
    Feb 6, 2015
    Posts:
    112
    Hello! I would like to know, why lighting look so bad?
    sonicether has very nice screenshots on first page.
    Is that because low settings or something incorrect?

     
  10. Ninlilizi

    Ninlilizi

    Joined:
    Sep 19, 2016
    Posts:
    294
    It's mostly because I suck tbh.
     
  11. Ninlilizi

    Ninlilizi

    Joined:
    Sep 19, 2016
    Posts:
    294
    If it's any consolation.... My local experimental repo, while currently lacking sunlight injection is much closer
     
    chiapet1021 likes this.
  12. Vagabond_

    Vagabond_

    Joined:
    Aug 26, 2014
    Posts:
    1,148
    What, you seem to be so passionate about GI and graphics and that's the most important thing !
    Learning stuff takes time, just don't give up !
    I am probably even more passionate about GI than you, but i am so about character animation and programming as well, so i can't spend my whole time on 3D graphics. I will leave that to you :)
    I don't actually care about SEGI that much than, " You be happy about reaching the goal of creating something that will make You happy in the GI world ;) "

    I tried creating Compute based lightmapper named POLM but i gave up cause i didn't study 3D graphics and i would need much more time on that, and i am passionate about game development in general not only on graphics.
     
    jjejj87 and chiapet1021 like this.
  13. Ninlilizi

    Ninlilizi

    Joined:
    Sep 19, 2016
    Posts:
    294
    Woo! Think I finally cracked what was baking my noodle in my experimental project.
    I'll port it over to SEGI in the near future.

     
  14. Shinyclef

    Shinyclef

    Joined:
    Nov 20, 2013
    Posts:
    505
    Looks much better than the earlier screens. Still a little weird bright patch on the ground to the right though?
     
  15. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    6,493
    *grumble* I want to participate lol but my time jave shrunken I still need to solve that hair shader first, I'm jelly pardon me
     
    Shinyclef likes this.
  16. jjejj87

    jjejj87

    Joined:
    Feb 2, 2013
    Posts:
    1,117
    that is not true. You know that, right?
     
  17. Ninlilizi

    Ninlilizi

    Joined:
    Sep 19, 2016
    Posts:
    294
    I know, right... It was mostly tongue in cheek. :)
     
  18. sabotage3d

    sabotage3d

    Joined:
    Nov 10, 2014
    Posts:
    5
    I was wondering is it possible to use already baked voxel data from 3rd party software? Have anyone looked into VDB as voxelization library as it provides sparse voxel access?
     
  19. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    6,493
    If you mention a library always post a link
     
  20. sabotage3d

    sabotage3d

    Joined:
    Nov 10, 2014
    Posts:
    5
    Ah sorry. This is the link: http://www.openvdb.org. Currently Houdini can convert geometry to VDBs and can export to the VDB format: https://www.sidefx.com/. If anyone think this might be a viable solution let me know and I can export you VDBs for testing.
     
  21. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    6,493
    Oh okay, when we talk about voxelization we are really talking about 3d textures, so if you can export to 3d texture format, or even in 2d slices, then it's compatible, but then not sure all necessary data will be there. The voxelization inject more than the geometry, it actually inject the light and occlusion data in a specific way, code commentary is available in previous post.

    Edit:
    Also currently no implemengtation of SEGI implement voxel octree or various similar hierarchical structure.
     
  22. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    6,493
    Also vdb don't seem gpu friendly, as in real time friendly
     
  23. glfloat

    glfloat

    Joined:
    Aug 8, 2013
    Posts:
    8
    Hi Guys, new to segi and I want to thank everyone who is contributing. Unity desperately needs a good realtime gi solution . Right now I feel like Enscape is the only really solid production ready real time gi solution. Its quite amazing how fast and accurate it is. https://enscape3d.com/ I have used it and can attest to that. Note this is not unity, this is its own application aimed toward architectural visualization however all of the techniques are totally relevant and doable in unity.

    Anyway the main thing is there is an interesting paper written on the inner workings of enscape.

    https://gpuopen.com/deferred-path-tracing-enscape/

    Im not a graphics engineer but I thought it might be useful for those who are furthering Segi, especially in how they seem to have gone away from cone tracing and seems they are doing some sort of psudo-differed path tracing? Is this fundamentally different than what segi is doing or are there crossovers? I would highly encourage you to download a copy of enscape and try it , its shockingly good and works on very large scenes.

    I would love to hear your thoughts.
     
    Cascho01 likes this.
  24. Cascho01

    Cascho01

    Joined:
    Mar 19, 2010
    Posts:
    1,347
    Right, enscape is really impressive in "Realtime" - GI (still needs a few frames to calculate).
    Thanks for the link!
     
    Last edited: Nov 19, 2018
  25. Vagabond_

    Vagabond_

    Joined:
    Aug 26, 2014
    Posts:
    1,148
    Yeah and it uses the same RadeonRays SKD as the GPU lightmapper - it is visible that it needs a little time to fully converge to final results but actually is really impressive :)
    And this is without dedicated hardware acceleration for BVH construction and traversal like nVidia new GPUs.
    I wonder if this is actually an unbised pathtracer !
     
  26. Cascho01

    Cascho01

    Joined:
    Mar 19, 2010
    Posts:
    1,347
    Could you explain what "unbiased" means?
    Not depending on special hardware e.g NVidia?
     
    Last edited: Nov 19, 2018
  27. Vagabond_

    Vagabond_

    Joined:
    Aug 26, 2014
    Posts:
    1,148
    1. Unbiased means - no matter what algorithm you are using, as soon as it provides results which fit into the "Rendering Equation" it is considered unbiased. Pure ( or brute force ) PathTracing is an unbiased algorithm because it does implement the equation directly and produces the best results that match the real lighting behavior.
    As soon as you start adding some tricks to speed up rendering, you have to be sure the final pixel will have the same value as the pure PathTracing, or otherwise it becomes a biased algorithm ( does not fully match the equation ) !
    For example photonmapping is a biased algorithm.

    2. As it uses RadeonRays, it would work on almost any hardware with OpenCL 1.2 support or even on CPUs if they added a fallback layer !
    As i understand the new tensor cores in the new Turing card from nvidia help improve the BVH construction and traversal and maybe other stuff as well ( not really sure ) , but it's considered to have a dedicated hardware cores for raytracing. nVidia Turing cars seem to be quite impressive even though they receive a lot of hate, i think mainly because not many people currently can appreciate such product and i think this was a good step from nVidia !

    AMD has no such dedicated cores for raytracing, that's why i was impressed how fast it renders - based on the promotional video :)
     
    soleron and Cascho01 like this.
  28. Cascho01

    Cascho01

    Joined:
    Mar 19, 2010
    Posts:
    1,347
    Great explanation, thanks!
     
  29. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    6,493
    Tensor core and the bvh accelerated part are two distinct features.

    The tensor core are used in the AA solution they provide (it's a neural network upscaler that guess the right stuff given a tile input) it's basically just fp16 core because neural network is just a series of mad operation anyway.

    EDIT:
    Enscape is basically SEGI with a BVH instead of voxel, and the bvh is offline constructed.
     
  30. Ninlilizi

    Ninlilizi

    Joined:
    Sep 19, 2016
    Posts:
    294
    A little teaser of my own GI I've been working on alongside SEGI (Using Lexis test scene)... Though it uses a little SEGI code, it's mostly built from the ground up and improves upon many of the problems that are hard to fix in SEGI without a major rewrite.

     
  31. jefferytitan

    jefferytitan

    Joined:
    Jul 19, 2012
    Posts:
    88
    That looks nicer to me. It still seems too bright, but I don't see the major light bleed that SEGI can get.
     
  32. Ninlilizi

    Ninlilizi

    Joined:
    Sep 19, 2016
    Posts:
    294
    The shadow power will be configurable... It can be as bright/dark as people like. It's just boosted for the screenshot so you can see what's going on in the image :D
     
  33. jcarpay

    jcarpay

    Joined:
    Aug 15, 2008
    Posts:
    561
    Nice indeed! Perhaps a bit too much ambient lighting?
     
    PROE_ likes this.
  34. Vagabond_

    Vagabond_

    Joined:
    Aug 26, 2014
    Posts:
    1,148
    Starting from scratch sometimes is best choice !
    Can you build this so we can run it and look around !?
     
  35. Ninlilizi

    Ninlilizi

    Joined:
    Sep 19, 2016
    Posts:
    294
    It will be released under a dual licence.... Free for non-commercial use. So you'll be able to try it out free when it's ready :)

    It's not in a state ready for a demo yet, however.
     
  36. jcarpay

    jcarpay

    Joined:
    Aug 15, 2008
    Posts:
    561
    How is the performance of your new version compared to SEGI?
     
  37. Ninlilizi

    Ninlilizi

    Joined:
    Sep 19, 2016
    Posts:
    294
    Much faster.... Depending on how far you crank up the settings of course... I can't give exact figures yet.. Because still in the heavy part of development. But it runs in VR on my GTX1060 with breathing room for the actual game.
     
    Tenebris_Lab likes this.
  38. Vagabond_

    Vagabond_

    Joined:
    Aug 26, 2014
    Posts:
    1,148
    Be sure to test with moving objects etc..., because this is one of the biggest issues !
     
  39. Ninlilizi

    Ninlilizi

    Joined:
    Sep 19, 2016
    Posts:
    294
    Yeah... That's the downside of caching a lot of data between frames... You can trade performance for slower refresh period... But fast moving emission becomes a problem.... I'm getting round that by having a static function you can call from anywhere that will flush the cache and cause an immediate update..... Which is functionality I will also port to SEGI... I'm going to resume fixing SEGI, when I've perfected all the new stuff. So next time I update it, it will also be much improved upon it's current iteration.
     
  40. Oniros88

    Oniros88

    Joined:
    Nov 15, 2014
    Posts:
    150
    Wow it looks so incredibly cleaner than SEGI. Will it support reflections aswell like SEGI?
     
  41. Duende

    Duende

    Joined:
    Oct 11, 2014
    Posts:
    200
    Hello, I have not read the whole post because there are almost 50 pages, but is there any plan to keep this asset updated and continue its development improving it? Is anyone or a group doing that? It's a shame, because this was the only asset that allowed to have global illumination in runtime in Unity and since September of last year it is not updated.

    Lexie's "HXGI Realtime Dynamic GI" is another possibility but has no plans to market it.
     
  42. Ninlilizi

    Ninlilizi

    Joined:
    Sep 19, 2016
    Posts:
    294
    I've been making small fixes and updates.... And will continue to in the future... But aside from that.... I've come to realise that there are a lot of problems that cannot be fixed without a major rewrite... So I've been working on my own GI, which I expect to release at the end of the year... It outperforms SEGI already. And I plan to release under a duel license, where it's free for non-commercial use.

    For comparison to SEGI.... It's now feature complete as shown in the below image. The only thing that won't likely happen is SEGI style reflections, and it's reflection pass it much more subtle. I'll be starting my own thread for this, very soon. So I don't continue to spam SEGI thread with my own work.

     
  43. Lexie

    Lexie

    Joined:
    Dec 7, 2012
    Posts:
    646
    Good work, I would recommend not using the stats windows FPS, it isn't actually accurate at all. Make a little script that renders it out at the top of the screen or use other software such as Fraps (what i use) or steam overly to get the real FPS from the games window.

    Looking forward to your forum post to follow your adventure.
     
    neoshaman and jefferytitan like this.
  44. Ninlilizi

    Ninlilizi

    Joined:
    Sep 19, 2016
    Posts:
    294
    Heh.... I just tend to have that thing open out of habbit.... For profiling I use the profiler, and watch my gpu utilization and do all the normal things :)
     
    neoshaman likes this.
  45. Duende

    Duende

    Joined:
    Oct 11, 2014
    Posts:
    200
    It is very good news, I will be aware of your work. :)

    The "duel license" means that for non-commercial use it is free, but for commercial use I have to pay? If it is that, then it is very good, because I would like to have your asset for my project that I want to market.
     
  46. Lexie

    Lexie

    Joined:
    Dec 7, 2012
    Posts:
    646
    haha, fair enough. I use it to for somethings as well. I make a habit to close that window when taking screen shots as a lot of people don't know how incorrect that fps counter is, I don't want people to get the wrong idea about the performance from unity's bunk window.
     
  47. Ninlilizi

    Ninlilizi

    Joined:
    Sep 19, 2016
    Posts:
    294
    Yes, you are correct. And that would be fine.... As a 'starving artist' myself, I appreciate that finding money for sometimes essential to a project middlewares is a massive struggle..... Plus, other peoples happiness matters more to me than making money.



    A possibly cheaky request.... But can I have permission to include your test scene as a demo scene in my project? I'd be happy to pay a little for your time in providing it, if that would be required :)
     
    bziemek335 and Duende like this.
  48. Duende

    Duende

    Joined:
    Oct 11, 2014
    Posts:
    200
    Those who are in a state of starvation are the developers of Unity that seek a global illumination in runtime with good performance for our games. Finish your asset and we will buy it en masse. :p

    Cheer up! You and Lexie are doing a great job.
     
    PROE_ likes this.
  49. Lexie

    Lexie

    Joined:
    Dec 7, 2012
    Posts:
    646
    Of course you can use it/distribute it, I'll probably put together some better test scenes later on that you're also welcome to use. It would be great if there was some public unity scenes we could all use to compare GI results.
     
    elbows and jefferytitan like this.
  50. RockSPb

    RockSPb

    Joined:
    Feb 6, 2015
    Posts:
    112
    Oh man! GI is realy hard thing so you should't say such things!)
    May be you need to take a step back and start you work on point when core visual is corret?
    I think it difficult to fix such complex systems when you don't know what went wrong.
     
    neoshaman likes this.