Search Unity

SEGI (Fully Dynamic Global Illumination)

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

  1. Duende

    Duende

    Joined:
    Oct 11, 2014
    Posts:
    200
    I answer you privately so as not to divert the topic of the thread. :p
     
  2. Marcell_04

    Marcell_04

    Joined:
    Mar 9, 2018
    Posts:
    1
    I went frantically searching for my account password just so I could log in and tell you guys about what I found. I haven't really used this account basically since I've made it. Anyway, here's the link to what I found:
    https://github.com/wotatz/sst-demo
    To my un-trained eye this seems like some impressive S*** right here. That is unless I'm misinterpreting and this isn't meant for real-time use.
     
    Zypo likes this.
  3. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    6,493
    Well thanks, it's funny it's similar to one implementation i'm pursuing ("splat" distribution over meshes) I have a system with a hard limit of 65536 splat on surfaces but I render the result on a lightmap at run time using indirection texture
     
  4. JudahMantell

    JudahMantell

    Joined:
    Feb 28, 2017
    Posts:
    476
    Hey, I'm a big fan of your assets! Has there been any update on the urp port? It would be a game changer as the only real contender for global illumination in the universal render pipeline, and I'm sure many people, including myself, would pay a good amount for it!
    Thanks!
     
    nasos_333 likes this.
  5. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,360
    Hi, unfortunately did not have still the time to finish the port, i have done more work on the screen space effect that is generally faster and have ported most of the code of that version to both URP and HDRP, so hopefully will have a first screen space implementation soon, then follow up with the full 3D solution.
     
  6. JudahMantell

    JudahMantell

    Joined:
    Feb 28, 2017
    Posts:
    476
    Even the screen space solution would be hugely beneficial! I can't find any other implementation of it that actually works.
     
    nasos_333 likes this.
  7. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,360
    The current work seems to be nice enough for giving that extra lighting effect needed, i have also managed to implement the temporal AA used in it to reduce the noise in the cloud solution of Sky Master ULTIMATE in all pipeline versions and to Ethereal volume lighting for URP, which also helped in both cases a lot, so the work helps in all departments of my assets and is hugely beneficial.

    Hopefully can have a first fully working and tested version soon.
     
    JudahMantell likes this.
  8. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,360



    Here is some of the WIP on URP SSGI and SSR for Sky Master ULTIMATE, for reference.
     
  9. JudahMantell

    JudahMantell

    Joined:
    Feb 28, 2017
    Posts:
    476
    Awesome! How's performance?
     
    nasos_333 likes this.
  10. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,360

    Here is a sample of it running with medium steps number in my 5 years old DELL XPS (1050GTX)

    Also can potentially use even less steps and go to 6-7ms.
     
  11. Onigiri

    Onigiri

    Joined:
    Aug 10, 2014
    Posts:
    486
    So NVIDIA has opened DDGI repo. Is anyone wants to port it to Unity?:)
     
    Baldinoboy likes this.
  12. DragonmoN

    DragonmoN

    Joined:
    Nov 27, 2016
    Posts:
    26
    Source?
     
  13. Onigiri

    Onigiri

    Joined:
    Aug 10, 2014
    Posts:
    486
    DragonmoN likes this.
  14. valarnur

    valarnur

    Joined:
    Apr 7, 2019
    Posts:
    440
    This is interesting
     
  15. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    6,493
    MMM I may work on an implementation that don't need raytracing for static scene, if I finished my GI
     
  16. JudahMantell

    JudahMantell

    Joined:
    Feb 28, 2017
    Posts:
    476
    ...Would it work for URP?
    That's one of my biggest frustrations right now: No GI for URP. ScreenSpace or otherwise.
     
  17. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,360
    I read a newer Unity version (2022 i think) will have screen space GI real time integrated.

    Is this true ?
     
  18. JudahMantell

    JudahMantell

    Joined:
    Feb 28, 2017
    Posts:
    476
    This is the only video I could find of it, but it's for HDRP only.


    I also found this which looks promising, but also looks like HDRP Only (when it's available)
    https://forum.unity.com/threads/h-trace-global-illumination-and-occlusion.1251273/

    And the developer of this asset is working on a URP version as well:
    https://assetstore.unity.com/packag...fects/sunfall-global-illumination-ssgi-197714
     
    chingwa and AntonioModer like this.
  19. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    6,493
    Assuming it look good enough, probably, I'm experimenting it in build in right now, I'm currently re factoring and I had some gotcha running into non unity way of doing stuff. It's heavily constrain, i don't know yet if it is competitive visually with those other rendering, it's a very agressive approximation solution designed for potato. You can follow my progress there: https://forum.unity.com/threads/exp...on-for-open-gl-es-2-0-and-weak-machine.752600
     
    AntonioModer and nasos_333 like this.
  20. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,360
    Thanks, will check out asap
     
  21. pointcache

    pointcache

    Joined:
    Sep 22, 2012
    Posts:
    579
    If anyone will go for nvidia one, please support legacy. There are a lot of us still on it, using old assets, and we are happy with it.
     
    chingwa likes this.
  22. imDanOush

    imDanOush

    Joined:
    Oct 12, 2013
    Posts:
    368
    Testing on my ATG-Simulator: Pardis project using Unity 2021.3 LTS.
    My project is kinda spacious, it is a huge open-world game that I'm working on since 2018 on my own.
    In these test runs, SEGI uses 2 to 10 fps with these results on a Laptop with nVidia MX150 gpu @ 720p in a customized Low Settings mode using medium graphics settings.
    Note that the game is in debug mode and it is not finished yet! thus, has a lot of overheads which causes the to fps drop significantly.
    ATGSimulatorPardosDebugWithGIUnitySEGI.png

    On a low-voltage RTX3060 laptop system, using the maximum possible settings, SEGI uses 1 to 25 fps @ 1440p - images below.
    SEGI - Off vs Maximum Custom Settings on RTX 3060 Low-Voltage
    1.png
    0.png
    Off vs Custom Low Settings w/ exaggerated illumination on RTX 3060 Low-Voltage 2.png
    3.png


    - Once again, thanks again to the SEGI community for providing such a useful golden asset.
     
    Last edited: May 17, 2022
    chingwa, Baldinoboy, blueivy and 2 others like this.
  23. JudahMantell

    JudahMantell

    Joined:
    Feb 28, 2017
    Posts:
    476
    To clarify, are you using the Built-In Render Pipeline or URP?
    Thanks!
     
  24. imDanOush

    imDanOush

    Joined:
    Oct 12, 2013
    Posts:
    368
    This project is using the Built-In Render Pipeline.

    Speaking of shaders, I had to exclude the player car (the red truck), And CScape's buildings and bus stop game objects (speaking of which, they use a custom shader) from the GI calculation layers, as they leaked lots of light - to the point that the whole screen got their albedo color.

    - Best.
     
    hopeful and JudahMantell like this.
  25. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,790
    After getting fed up with the performance impact and inherent limitations of SSRT GI I decided to take another look at SEGI now a few years later. I was surprised how well SEGI Cascaded works after some tweaking of settings.

    The performance isn't great (it is more or less analogous to the SSRT solution I was using), but the lighting looks so much more realistic and without the obvious limitations of Screen-Space. One of the biggest benefits for me isn't even the light voxelization, but the skylight and occlusion settings, since a lot of my project is "outdoors". SEGI just grounds all these objects with believable ambient, it's great.

    It also does wonderful things for character lighting, which I always struggled with making look realistic with Unity's typical harsh shadowing and lackluster light systems. All in all I'm pretty happy with SEGI now, and once I improve the base performance of my project I think the performance impact of SEGI will be quite manageable.

    My biggest issue currently is that SEGI doesn't interact properly with GPUinstancer objects, which I use for trees and foliage. So all these natural elements feel slightly unrealistic as they don't get the full range of shadowing/occlusion/light voxelization as other scene objects do. Has anyone gotten SEGI and GPUi to work together nicely? I assume somehow rearranging SEGI buffers in the render stack might do the trick, but thought I'd ask in case anyone has already gone down this rabbit hole.
     
  26. TerraUnity

    TerraUnity

    Joined:
    Aug 3, 2012
    Posts:
    1,255
    @chingwa I guess changing SEGI codes to support GPU buffer seems a very hard task to do for the community since no one could - greatly - develop it further in years since OP abandoned it!

    Best bet is to have those GPU instances converted to ordinary gameobjects with MeshRenderer for interactions. This is how TerraWorld's GPU Instanced Renderer system works in runtime where it can take a target (e.g. camera) and convert all GPU instances around it based on distance radius to normal GameObjects for any type of interactions such as physics, collisions, renderer operations and...

    The following video shows this GPU to CPU conversion system in action:

     
  27. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,790
    @TerraUnity Yes that is a good point, and on my to-do list now, thanks.
     
    TerraUnity likes this.
  28. YuriyPopov

    YuriyPopov

    Joined:
    Sep 5, 2017
    Posts:
    237
    I dont get this. Why would the colliders and physics be tied to the GPU instancer in the first place? Our system iterates GO on load and adds the rendering data to be instance while keeping other components intact, if a object moves it updates the buffers as needed. Whats the advantage of taking the data out ?
     
  29. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,790
    Can't speak for @TerraUnity but at least in my case I'm rendering multiple hundreds of thousands of instances (trees, foliage, details) on the GPU, which doesn't seem feasible to do with gameobjects on the CPU, even if you remove the rendering aspect of those gameobjects. So in this case converting just near instances into objects with collision (and proper rendering data for SEGI) seems like the best choice.
     
    TerraUnity likes this.
  30. TerraUnity

    TerraUnity

    Joined:
    Aug 3, 2012
    Posts:
    1,255
    As @chingwa pointed out and to further add to this, we are talking about hundreds of thousands of objects here and GPU Instancing through its API gives you the ability to have a fully GPU based renderer, but if you need those models to be interactable while in game mode - for example colliding with trees - you need to have them back as ordinary CPU gameobjects and in this case having it feed into SEGI's voxelization data through its renderer.

    FYI, having Instanced Drawing option on prefab's material which is placed in scene, does batch model's instances but you still have the gameobjects in place which involve memory footprint, transform calculations, renderer drawcalls, its components and everything else a GO holds which you can't go beyond couple thousands even if it's a simple one.
     
    DragonmoN and chingwa like this.
  31. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,360
    LUMINA with Sky Master ULTIMATE Ethereal URP volumetric lighting, for complete atmosphere and lighting simulation






    HDRP WIP - Voxels and GBuffers all working, plus GI applied to the scene. Remain only to do the correct blending.




    LUMINA URP















    Hi,

    A fully real time voxel based system for URP based on SEGI is now available in the asset store, LUMINA GI: Voxel Based Global Illumination. (currently on -50% Off Initial Release Sale)
    It is for URP and a HDRP version is also almost ready.

    The system is made to work directly with Sky Master ULTIMATE URP Ethereal Volumetric Lighting system, for a complete atmospheric scattering and lighting simulation.
     
    Last edited: Jul 14, 2022
  32. wildsalmon

    wildsalmon

    Joined:
    Jul 18, 2022
    Posts:
    2
    This is crazy !!! The dream come true at last, looks stunning. Cant wait to try this one out :)
     
    nasos_333 likes this.
  33. iamtanmay

    iamtanmay

    Joined:
    Aug 1, 2013
    Posts:
    18
    blueivy, wetcircuit and nasos_333 like this.
  34. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,360
    Hi, thanks for the link.

    Is this an extended version of the original SEGI cascaded version ?
     
  35. iamtanmay

    iamtanmay

    Joined:
    Aug 1, 2013
    Posts:
    18
    Yes, its the most 'ahead' fork on github atm... However, it needs to be updated for Unity 2021 onwards, you will get a

    "Invalid pass number (13) for Graphics.Blit (Material "(SEGI_C material)" with 1 passes)" error,

    probably because how screen space materials are suppose to be initialised... probably 1169 on SEGI_NKLI.cs or 783 where the Graphics.Blit is called

    ...but I haven't worked with screenspace stuff, so I am not sure..
     
    Last edited: Jul 19, 2022
    nasos_333 likes this.
  36. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,360
    Thanks, will check all out, is really useful
     
  37. superMario99

    superMario99

    Joined:
    Apr 21, 2021
    Posts:
    38
    Amazing :), would be great if could post some videos from the HDRP version as well if possible
     
  38. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,360







    Hi, sure, i post a few above.

    Lumina GI HDRP BETA testing is also now available, all users of the current URP system (currently on -50% Initial Release discount) can have access to the HDRP Beta before the store release. The HDRP asset will also be at a deep discount when released for all current users of the current URP LUMINA. Please provide the invoice in a personal message here or in email and will send links to the HDPR beta asap.

    The new system is directly compatible with the Sky Master ULTIMATE URP - Ethereal Volumetric Lighting system and the two can be used together for cutting edge lighting and atmospheric effects (Video).
     
  39. Rensoburro_Taki

    Rensoburro_Taki

    Joined:
    Sep 2, 2011
    Posts:
    274
    SEGI still works great with Unity 2020.3.38f1 LTS if you still need a built in solution!

    edit: Lucky me they didn't canceled the built render pipeline totally, because HDRP is not handy to setup and the management is very poor, and it's super slow! SEGI is much faster when you turn up the quality steps! Tested both with the same scene/project. SEGI is faster!
     
    Last edited: Sep 7, 2022
    Baldinoboy, blueivy and hopeful like this.
  40. Baldinoboy

    Baldinoboy

    Joined:
    Apr 14, 2012
    Posts:
    1,526
    Cool, glad to hear! Are you using a build from GitHub or directly from the Asset Store?
     
  41. Rensoburro_Taki

    Rensoburro_Taki

    Joined:
    Sep 2, 2011
    Posts:
    274
    I never purchased SEGI on the asset store, that's why I downloaded it from Github!
    Btw SEGI definitely has its limitations, made some more tests...but then again it is build quite smart and handy. I still prefer it more than the Unity solution, but you have to make your sacrifices. Especially when it comes to big terrain/world building.
     
    Baldinoboy and blueivy like this.
  42. Rensoburro_Taki

    Rensoburro_Taki

    Joined:
    Sep 2, 2011
    Posts:
    274
    tip/usage:
    Btw the voxel-space-volume where the GI happens can be targeted by an empty, because by default it is centered around the camera, where half of the GI calculations are happening at your back, which can't be seen. So by targeting an empty that is in front of the camera you can move that render-volume as you prefer to have more GI-render depth of the field you are looking to!.

    Are you a good programmer that could enhance SEGI?
    I would love to see some talented programmer to go for it. Because SEGI makes no errors with the latest 2020.3. LTS version and is a wonderful solution that works for Unity's built in pipeline. And with all its limitations it is still a much handier solution than Unity's HDRP version. I like it and I get astonishing results with it.
     
    Baldinoboy and blueivy like this.
  43. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    6,493
    I probably need to have another go at it, I made a break down in the forum already of the shader code. I have been programming my own solution, which is way uglier than seeing but it's for another purpose. Segi don't run great on my computer, if I figure out how to replace the heavy voxelizer using random rw to texture and the geometry stage, it could run faster. But I don't remember where is the repo lol
     
  44. Nexusmaster

    Nexusmaster

    Joined:
    Jun 13, 2015
    Posts:
    365
    Hi guys!
    Before you start wasting your time upgrading SEGI to HDRP (what I already did), check out SuperDrZee work. We are working on a solution that will be even better than SEGI (in speed and quality) and works with all renderpipelines, we almost finished the tracing shadowing part, also Michael already did some great tests with light tracing, which will be faster than voxel tracing and similar to "Lumen" using SDFs!
    https://forum.unity.com/threads/wip...o-and-soft-shadows-hdrp-urp-built-in.1155401/
     
  45. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,360
    LUMINA HDRP - Vulkan - 2060RTX GPU





    LUMINA HDRP (1050GTX GPU - DX11)



    LUMINA URP (1050GTX GPU - DX11)




    Hi,

    The new LUMINA HDRP system now implements SEGI with a port to HDRP, is only for DX12 and Vulkan atm though, since DX11 gets some strange swapchain bug in DX11 in 20xx and 30xx Nvidia GPUs.

    Note that the LUMINA for URP is faster than the HDRP counterpart, since URP base is far more optimized on Unity side and is globally compatible with all GPUs in Windows in all modes.

    In URP i get around 60fps with voxelizer with a minimal time step delay, while HDRP is at 30fps (both tested in a 1050GTX GPU 5 year old DELL XPS Laptop, at the same settings and 1080p resolution)
     
    Last edited: Sep 12, 2022
    Baldinoboy likes this.
  46. Oniros88

    Oniros88

    Joined:
    Nov 15, 2014
    Posts:
    150
    I read the whole thread and looks like a dream come true.

    if it can be made performant enough trough settings (I don't care much about realism but a working GI solution) we could in our game open the possitibility of fully procedural maps.

    Segi (and it's many variants-modifications that were implemented in other assets) all caused serious performance issues and crashes in our project. We ended switching to Enlighten for this reason.

    Does this solution include reflections? So we would not have to rely on reflection probes either.
     
    DragonmoN likes this.
  47. Nexusmaster

    Nexusmaster

    Joined:
    Jun 13, 2015
    Posts:
    365
    Yes it does include reflections, and the reflections are better than any SEGI or other voxel GI implementation (sorry LUMINA) because it uses SDFs, which you also might know from shadertoy.com

    SDFs can create more details, that is why Unreal's Lumen also uses them!
    Here is an example from Lumen:
     
    DragonmoN likes this.
  48. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,360
    Lumina URP




    Lumina HDRP





    Indeed is true, LUMINA is just implementing the possible voxel reflections, so can mostly be used for blurred reflections.

    I mostly use it with a screen space reflection layer to get more detail locally, which is generally an acceptable solution.

    The upside is that this just works and does not require any preprocessing of the scene and applies directly to any dynamic objects etc.
     
    Last edited: Sep 13, 2022
  49. Baldinoboy

    Baldinoboy

    Joined:
    Apr 14, 2012
    Posts:
    1,526
    Have played around with Lumen in UE5 a lot and it is impressive but it relies so heavily on Screen Space GI and Reflection that it is not the best solution I have seen. Not saying anything on Erebus as it might handle things better.

    In the Lumen example shot shared it is SSR that is handling the reflection, SDF GI reflection is of simplified geometry and not going to be clean if the reflected source is not in the screen space. In my opinion Raytraced Reflections are really the only good solution for reflections currently.
     
  50. Oniros88

    Oniros88

    Joined:
    Nov 15, 2014
    Posts:
    150
    Absolutely insane. Not relying on reflection probes (and the performance hit of updating said reflection probes), not lightprobes would be a dream come true for our use case. Just a couple more questions:

    Which kind of lights does it support? Does it also support emissive bodies?

    Is it compatible with HDRP fog? For example some AO solutions like HBAO render on top of volumetric fog from HDRP.