Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

SEGI (Fully Dynamic Global Illumination)

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

  1. fherbst

    fherbst

    Joined:
    Jun 24, 2012
    Posts:
    353
    In case anyone wants to use SEGI with custom shaders that are emissive (e.g. created with ASE or ShaderForge), you'll have to take care that your property names for emissive stuff conform to the default Unity names for emissive stuff. SEGI voxelizes with Shader Replacement, meaning it just looks for specific names.

    These are the parameters/names the voxelizer is using:
    Code (CSharp):
    1. half4 _Color;
    2. sampler2D _MainTex;
    3. float4 _MainTex_ST;
    4. sampler2D _EmissionMap;
    5. half4 _EmissionColor;
    6. float _Cutoff;
    7. float _BlockerValue;
     
  2. chiapet1021

    chiapet1021

    Joined:
    Jun 5, 2013
    Posts:
    604
    For folks who are working on their own improvements to SEGI, I noticed this post in the Beautify thread today, where the developer created a tool to write transparent objects to _CameraDepthTexture. I wonder if this would help with forward-rendered objects being incorporated into the GI?

    CC: @nasos_333, since I know you are working on your SEGI enhancements for SkyMaster Ultimate.
     
    RB_lashman likes this.
  3. Abuthar

    Abuthar

    Joined:
    Jul 12, 2014
    Posts:
    91
    RB_lashman likes this.
  4. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    4,582
    I think it's a forward vs defered situation, search the thread for the proper explanation. It's been ask before.
     
    RB_lashman and chiapet1021 like this.
  5. Abuthar

    Abuthar

    Joined:
    Jul 12, 2014
    Posts:
    91
    But that skin shader works in deferred.
     
    RB_lashman likes this.
  6. chiapet1021

    chiapet1021

    Joined:
    Jun 5, 2013
    Posts:
    604
    Working in deferred mode is not the same as it being a deferred-rendered shader. Given some of the features of that skin shader (translucency, SSS), I'd assume it's a forward-rendered shader that just happens to work out-of-the-box if your game runs in deferred.
     
    RB_lashman likes this.
  7. Abuthar

    Abuthar

    Joined:
    Jul 12, 2014
    Posts:
    91
    I see. With no real knowledge on shaders, i wonder if it's something i should take the time to learn. Though it is frustrating, having learned virtually everything else i need to know, as a one man team. thanks!
     
    RB_lashman likes this.
  8. Oniros88

    Oniros88

    Joined:
    Nov 15, 2014
    Posts:
    47
    i have a problem with SEGI reflections.

    When a material is under the influence of light, it reflects the environment well.

    But when its under some shadow, it looks like it's too glossy, like if the surface was wet.



    This is how surfaces look under direct lights. it looks good and materials behave nicely.


    This is when under no direct light. Everything including skin or metal looks like its completely wet. This didn't happen with screen space reflections + reflection probes, but I don't want to fall back to them since I love how SEGI reflections behave. Any idea on how to solve this?
     
    RB_lashman likes this.
  9. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    The hype is no more and no one is working on SEGI ?
     
    chingwa, RB_lashman and Abuthar like this.
  10. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    2,050
    segi was a good deam, lexie dostal is working on his own realtime gi, he may finish it, he may even sell it
     
    RB_lashman likes this.
  11. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    This is so long he is working on it, this reminds me SEGI unfortunatelly.
    Unity could come with a Svogi like solution before he would get something available.
     
    RB_lashman likes this.
  12. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    2,050
    not happening because of the F***ton of lame gpu that can't handle it but they are working on a replacement to enlighten, if they're intelligent about it, it will only require baking at import time
     
    RB_lashman likes this.
  13. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    Cryteck did it. I suppose Unity is focused on mobile, to they are not interested in Svogi and other real time GI with no baking.
     
    RB_lashman likes this.
  14. chiapet1021

    chiapet1021

    Joined:
    Jun 5, 2013
    Posts:
    604
    SRPs may make the dream of fully dynamic GI possible, maybe even within the standard HD pipeline, but all that remains to be seen and even the base HD SRP is still at least a few months out from being considered production ready.
     
    Flurgle and RB_lashman like this.
  15. Zuntatos

    Zuntatos

    Joined:
    Nov 18, 2012
    Posts:
    522
    I was about to say the above - if Unity itself would add any kind of fully dynamic GI, they'd do so after the SRP is mostly done.
     
    Flurgle and RB_lashman like this.
  16. isshak

    isshak

    Joined:
    Feb 12, 2018
    Posts:
    1
    Hello guys :)
    i'm a new Unity user and i would like to use This awesome future, i had downloaded it but i don't know how to apply it in my project. any help?
     
    RB_lashman likes this.
  17. N00MKRAD

    N00MKRAD

    Joined:
    Dec 31, 2013
    Posts:
    204
    Add the SEGI component to your main camera.
     
    RB_lashman likes this.
  18. McDev02

    McDev02

    Joined:
    Nov 22, 2010
    Posts:
    633
    RB_lashman likes this.
  19. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    2,050
    it's a nice roadmap, no more devlopment though so you're on your own, be aware of that before you get too excited and start using SEGI.
     
  20. Abuthar

    Abuthar

    Joined:
    Jul 12, 2014
    Posts:
    91
    Saddest like i've ever given, that hurt.
     
    RB_lashman likes this.
  21. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    2,050
    Cheer up mate, Unity is working on another type of GI. Also you need to start doing sports because it's not healthy to be sad for something like this.
     
    zenGarden and RB_lashman like this.
  22. chiapet1021

    chiapet1021

    Joined:
    Jun 5, 2013
    Posts:
    604
    Wait, what? They are? This isn't OTOY Brigade you're talking about, is it?
     
    RB_lashman likes this.
  23. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,385
    Unity forum is sport. :D
     
    RB_lashman likes this.
  24. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    2,050
    Not OTOY, no details yet on the tech used, it's not going to be full real time for sure but it will suck less than currently.
    let's dance to that
     
    chiapet1021 and RB_lashman like this.
  25. thelebaron

    thelebaron

    Joined:
    Jun 2, 2013
    Posts:
    311
    Where are you getting this info from?
     
    RB_lashman likes this.
  26. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    2,050
    take a wild guess
     
    RB_lashman likes this.
  27. Zuntatos

    Zuntatos

    Joined:
    Nov 18, 2012
    Posts:
    522
    Where are you getting *this* info from? They're messing with OTOY and their progressive lightmapper, but both are useless in procedural scenes
     
    SteveB and RB_lashman like this.
  28. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    2,050
    I spoke with a woman from Unity research (not RnD, i think it means more marketing or user relation) who asked me tons of questions about GI and why I stopped using it. She said the engineers have been working on a completely new GI but it's not RT in the sense of SEGI, it still needs some baking, how much she didn't know. I told her about procedural sets and how important it is that the baking be absolutely the minimum so we can do that, but that's all I got. Oh and she had no idea about OTOY so probably not the best source when it comes to details. Still they are listening and working on something better, let's hope they understand that we don't want to deal with baking and that a lot of games need on the fly GI, not that fake crap we got from enligthen.
     
    Elecman, chiapet1021 and RB_lashman like this.
  29. McDev02

    McDev02

    Joined:
    Nov 22, 2010
    Posts:
    633
    Realtime/dynamic GI ist not state of the art but your comment sounds like it is. Enlighten is a great API and powers Battlefield 3 for instance, why should it be crap? Also you should consider that there are hardware requirements as well and prebaking as much as possible is important to keep a game efficient. Not just speaking of mobile or VR but there it is crutial.

    Not saying that I also like to have dynamic GI but as long as it doesn't benefit a lot while costing too much performance I am going to ignore it. SEGI shows that there is great potential but also many many issues that have to be solved other than just by increasing quality.
     
    Last edited: Mar 8, 2018
    RB_lashman likes this.
  30. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    I'm not sure they are exactly the same, for Battlefield they must have their own branch version.

    CryEngine Svogi works well, while it has a cost in performance it runs good enough.
    Open worlds or procedural ones, need something different that does not need baking.
     
    RB_lashman likes this.
  31. McDev02

    McDev02

    Joined:
    Nov 22, 2010
    Posts:
    633
    True they might have some custom properties, but it is the only game I know which has such a feature and that is a high end AAA production, that should speak for itself.

    My point is that we shouldn't take all the stuff for granted. One generic engine cannot serve everybodies needs.
     
    RB_lashman and zenGarden like this.
  32. Kusras

    Kusras

    Joined:
    Jul 9, 2015
    Posts:
    129
    OK tell me what to do, when I have a sandbox game, where players build everything. And I want to have room without windows dark. And open areas under open sky bright. There is no possibility to do that :( at least as far I know. Only hope are SEGI and other realtime GI, which will just perform better. Best would be if Enlighten could mark areas to rebake and bake on some not used much thread in background... unfortunately there is no way how to bake lights in runtime
     
    RB_lashman likes this.
  33. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    2,050
    thread officially derailed, well done guys
    Sandbox means you can do anything in the game's world, FarCry 3 is a good example of sandbox. They don't bake the GI but what they do is calculate sort of light probes and relight the environment with that. You can do this with reflection probes, set them to super low resolution and every object bathed in their volume will have a bounce from the direct lit surfaces. That's what I do.
     
    RB_lashman likes this.
  34. jjejj87

    jjejj87

    Joined:
    Feb 2, 2013
    Posts:
    317
    has anyone tested SEGI with the beta HD? I wonder if it is even working...
     
    RB_lashman likes this.
  35. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    2,050
    hahahah that's a good one, nothing works with the HD pipeline, but you should try it, just for fun
     
    RB_lashman likes this.
  36. Abuthar

    Abuthar

    Joined:
    Jul 12, 2014
    Posts:
    91
    Is There a tutorial for setting up these SRP's with 2018 (2017.3.1p1 too would be amazing)? I'm having a hard time figuring it out :oops:
     
    RB_lashman likes this.
  37. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    4,582
     
    zenGarden and RB_lashman like this.
  38. TimothyThomasson

    TimothyThomasson

    Joined:
    Jan 25, 2017
    Posts:
    9
    I am having very weird issues using SEGI. I am making an art project with procedurally generated rooms and want the lighting to look good...and it seems this is the only option for global illumination in that case. The first image is with real-time global illumination checked in the lighting window. The second is with it unchecked and SEGI applied to the main camera. (all the settings are done up to be as described in the SEGI user guide) As you can see, odd blue patterns are all over. I have tried all presets, and messed with the settings. Any help would be verrrry much appreciated!

    unityRealtimeGIEnabled.JPG Segi.JPG
     

    Attached Files:

    Martin_H and RB_lashman like this.
  39. TimothyThomasson

    TimothyThomasson

    Joined:
    Jan 25, 2017
    Posts:
    9
    Any ideas why this could be?
     
    RB_lashman likes this.
  40. Lex4art

    Lex4art

    Joined:
    Nov 17, 2012
    Posts:
    172
    Feels like very sparse voxel grid here producing huge light leaking because of huge voxel unit size - e.g. lighting distance for SEGI set to 400+ m.
     
    RB_lashman and Martin_H like this.
  41. one_one

    one_one

    Joined:
    May 20, 2013
    Posts:
    495
    Are you using substance? I've had an issue where global illumination assigned a blue albedo color (that looked quite similar to what you're seeing) to a substance material that was not properly initialized.
     
    RB_lashman likes this.
  42. TimothyThomasson

    TimothyThomasson

    Joined:
    Jan 25, 2017
    Posts:
    9
    Yes I am using substances for a lot of my rooms -- however that wood floor material in the pictures above is not. Where would I go about reducing the lighting distance for SEGI ? Is it the "Voxel Space Size" parameter you're talking about?
     
    RB_lashman likes this.
  43. TimothyThomasson

    TimothyThomasson

    Joined:
    Jan 25, 2017
    Posts:
    9
    Could it have anything to do with the geometry of the room I created in Blender?
     
    RB_lashman likes this.
  44. Lex4art

    Lex4art

    Joined:
    Nov 17, 2012
    Posts:
    172
    Yes, it is. Plus "Voxels resolution" parameter - on "Low" it will make 2x larger those voxels as I remember.
     
    RB_lashman likes this.
  45. TimothyThomasson

    TimothyThomasson

    Joined:
    Jan 25, 2017
    Posts:
    9
    Thank you! I seem to be getting much better results now.. I think that when individual rooms were placed close together there were weird bleeding issues.. Also helped to bring the cone trace bias down to 0.
     
    RB_lashman likes this.
  46. CGSpc

    CGSpc

    Joined:
    Feb 19, 2014
    Posts:
    8
    Is it possible to change attenuation for emissive lights?
     
    RB_lashman likes this.
  47. nxrighthere

    nxrighthere

    Joined:
    Mar 2, 2014
    Posts:
    542
    Since people are still asking me about how things are going with my fork, I want to let you know that after some thought I sold it to an indie company earlier this year with long-term support. Sorry, but yea.
     
    RB_lashman likes this.
  48. CGSpc

    CGSpc

    Joined:
    Feb 19, 2014
    Posts:
    8
    Is there anyone else working on it?
     
    RB_lashman likes this.
  49. Mauri

    Mauri

    Joined:
    Dec 9, 2010
    Posts:
    1,595
    Nope.
     
  50. mrbdrm

    mrbdrm

    Joined:
    Mar 22, 2009
    Posts:
    510
    it was a dead project since the maker left it.
    but its not in a bad shape, its usable
     
    CGSpc and RB_lashman like this.