Search Unity

SEGI (Fully Dynamic Global Illumination)

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

  1. petersx

    petersx

    Joined:
    Mar 5, 2015
    Posts:
    239
    Hi,

    On this video:
    SEGI works in scene view.
    In Unity 2017 / 5.5 only working in game view - where is problem ?
     
    RB_lashman likes this.
  2. rrahim

    rrahim

    Joined:
    Nov 30, 2015
    Posts:
    206
    He says in the video at the end that he uses an asset called Scene View FX for scene view.
     
    buttmatrix and RB_lashman like this.
  3. petersx

    petersx

    Joined:
    Mar 5, 2015
    Posts:
    239
    I tought that was Unity 4.x problem - in Unity 5.x / 2017 image effects are default enabled in scene view
     
    RB_lashman likes this.
  4. Mauri

    Mauri

    Joined:
    Dec 9, 2010
    Posts:
    2,665
    Could a crash.dmp and error.log from an actual Build help, too? (I've also send it to sonicether)
    https://mega.nz/#!4GJmwbwQ!HgEi5NmlQaz52BE07K2gRZN-TmvhIDkIe99tQvGBrNY

    I'll try to get a Editor.log. (Strangely, even though my graphics driver crashes and restores itself, the Editor doesn't always Crash with it. It still runs, but everything in the Editor is white). I'll also try your memory leak fix (kudos for helping sonicether out, nxrighthere!).

    EDIT: The memory leak fix didn't work for me either :( But I got an Editor.log, attached below.
     

    Attached Files:

    Last edited: Sep 21, 2017
  5. BruceBarratt

    BruceBarratt

    Joined:
    Jun 20, 2015
    Posts:
    57
    On mine I can't see or do anything after the crash. If I reboot do you think the crash log might be there?

    I'll give it a go anyway.
     
    Crossway and RB_lashman like this.
  6. nxrighthere

    nxrighthere

    Joined:
    Mar 2, 2014
    Posts:
    567
    Last edited: Sep 25, 2017
    RB_lashman likes this.
  7. BruceBarratt

    BruceBarratt

    Joined:
    Jun 20, 2015
    Posts:
    57
    Here.

    It doesn't look much use to me. It feels like the GPU hangs somehow so maybe that's not producing a proper crash report.
     

    Attached Files:

    Crossway and RB_lashman like this.
  8. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,502
    Asset developers still need to put a flag in their code for their effects to work in scene view. There could be other issues beyond that, including performance, I dont know.

    The flag:

    [ImageEffectAllowedInSceneView]
     
    RB_lashman likes this.
  9. BruceBarratt

    BruceBarratt

    Joined:
    Jun 20, 2015
    Posts:
    57
    It seems pretty hard to debug this kind of thing. Possibly there's a line in a shader file that is causing crashes. Could we have the shader output different colour squares one by one as it completes different functions. Then we could report back which colour we got up to.
     
    RB_lashman likes this.
  10. nxrighthere

    nxrighthere

    Joined:
    Mar 2, 2014
    Posts:
    567
    Unfortunately, it is. But @Mauri logs contain some useful information.

    SEGI is not compatible with it. Maybe I can fix that.
     
    Last edited: Sep 21, 2017
  11. arnoob

    arnoob

    Joined:
    May 16, 2014
    Posts:
    155
    It is so heartwarming to see all these people finally taking part to the project and contributing to fixing the asset in real time. This thread is now my mood improver! :-D
     
  12. AndyNeoman

    AndyNeoman

    Joined:
    Sep 28, 2014
    Posts:
    938
    This is fantastic. So much better than the standard unity lighting options.

    I have had to switch off reflections though as some of my foliage is going a strange red colour with it enabled. Anyone shed any light on this issue? (sorry).
     
    Last edited: Sep 22, 2017
    RB_lashman likes this.
  13. tweedie

    tweedie

    Joined:
    Apr 24, 2013
    Posts:
    311
    Hm- only just considered this, but would it be best to start a new thread for SEGI now it's not an asset and to give a fresh base for the community to get involved? This one might be best left for anybody asking about the deprication / refunds etc, and a new one can be a clean slate for people to share their ideas / understanding of the ongoing project. 30 pages is a decent chunk :) Just a thought.
     
    wetcircuit and RB_lashman like this.
  14. buttmatrix

    buttmatrix

    Joined:
    Mar 23, 2015
    Posts:
    609
    Seems better to keep it all in one place. There is a lot of good information stored on this thread, plus it's the logical first place to look.
     
    wetcircuit, tweedie, IronDuke and 2 others like this.
  15. nxrighthere

    nxrighthere

    Joined:
    Mar 2, 2014
    Posts:
    567
    Added scene view support in Unity 5.4+. Is highly recommended to restart the editor after applying this patch.

    I think I found what causing cascaded version to crash. I'm trying to fix it right now.

    Also, @sonicether has merged all my recent pull requests with the master branch, so feel free to test it.
     
    Last edited: Sep 25, 2017
    nirvanajie, redemprez, elbows and 5 others like this.
  16. nxrighthere

    nxrighthere

    Joined:
    Mar 2, 2014
    Posts:
    567
    It's not crashing anymore for me now. Tested with GTX 950 and GTX 920M using Unity 2017.1.1p2. Please confirm that.

    Project
    Standalone
     
    arnoob and RB_lashman like this.
  17. BruceBarratt

    BruceBarratt

    Joined:
    Jun 20, 2015
    Posts:
    57
    I'm on it

    EDIT: Tried with 2017.1.1f1. Crash on loading project. Same hanging as before. Presumably because SEGI is working in scene view now. Tried with the standalone build too. Crashes as intro screen ends.
     
    Last edited: Sep 22, 2017
    Crossway and RB_lashman like this.
  18. TooManySugar

    TooManySugar

    Joined:
    Aug 2, 2015
    Posts:
    864
    Tested Standalone, Works without issues here, ran it twice, also ran on both monitors.
    upload_2017-9-22_11-15-2.png
    GPU is 1080
     
    RB_lashman likes this.
  19. TooManySugar

    TooManySugar

    Joined:
    Aug 2, 2015
    Posts:
    864
    OK, tested Project too. All ok!
    In runs in scene view and also when I hit play. I can pause and resume without issues.

    Unity versión:
    upload_2017-9-22_11-24-8.png
     
    RB_lashman likes this.
  20. Benedani

    Benedani

    Joined:
    Jul 23, 2017
    Posts:
    1
    I've got an issue with dynamic objects. Basically you can see the object's path which it takes as it moves around a dark area.

    upload_2017-9-22_13-32-3.png
    You can kind of see some bright areas where the guy was. This problem is especially noticeable on a low framerate. (I have a potato :v)
    Edit: More testing. It happens both with a static camera and a follow camera.
     
    Last edited: Sep 22, 2017
    RB_lashman likes this.
  21. nxrighthere

    nxrighthere

    Joined:
    Mar 2, 2014
    Posts:
    567
    All these warnings are now fixed and shaders is a bit more optimized.

    @BruceJRBarratt @TooManySugar
    Thanks for your tests. I don't know what else I can do, on my hardware the cascaded version now works quite stable.
     
    Last edited: Nov 18, 2017
  22. buttmatrix

    buttmatrix

    Joined:
    Mar 23, 2015
    Posts:
    609
    This is a known artifact related to temporal sampling for screen-space voxel cone tracing
     
    RB_lashman likes this.
  23. redemprez

    redemprez

    Joined:
    Aug 14, 2017
    Posts:
    29
    Current reflection steps are limited to 128, can we have 1024 or 2048 as a limit?

    EDIT: I managed to tweak value in Editor but the reflections still are not mirror quality. Anyone knows how to achieve mirror reflection in SEGI? MirrorShader4 does not work with it.
     
    Last edited: Sep 22, 2017
    Abuthar and RB_lashman like this.
  24. yohami

    yohami

    Joined:
    Apr 19, 2009
    Posts:
    124
    Thanks @sonicether! if you set a Patreon to keep working on this I'll contribute, and Im sure many others will
     
    arnoob, RB_lashman and pcg like this.
  25. Nexusmaster

    Nexusmaster

    Joined:
    Jun 13, 2015
    Posts:
    365
    Hi, I fixed the shadow map cascade bug (the shadowmap wasn't updated for all cascades correctly), waiting for Sonic to accept my github request pull :)
     
  26. Mauri

    Mauri

    Joined:
    Dec 9, 2010
    Posts:
    2,665
    Same issue as BruceJRBarratt. I got an Editor.log for you, though...
     

    Attached Files:

  27. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,502
    These contributions by others are making my heart sing with joy and I havent even tried them yet - thanks for immediately making the github approach bear fruit!
     
    Last edited: Sep 22, 2017
    arnoob and RB_lashman like this.
  28. nxrighthere

    nxrighthere

    Joined:
    Mar 2, 2014
    Posts:
    567
    @Mauri How about a standalone build? It's crashing too?
     
    Last edited: Sep 23, 2017
    RB_lashman likes this.
  29. Mauri

    Mauri

    Joined:
    Dec 9, 2010
    Posts:
    2,665
    Yeah, it's crashing right after the splash screen. Then I tried your project, but Unity crashes right after loading it.
    I've also manually downloaded your patch-1 files from your GitHub, turned "Update GI" back on (in my test scene, I turned it off by default) and it instantly crashes Unity when I go to the Game view - just like before.

    On a side note: nxrighthere thanks, I appreciate your help. I'm sure we all do here.
     
    BruceBarratt and arnoob like this.
  30. greengremline

    greengremline

    Joined:
    Sep 16, 2015
    Posts:
    183
    I would happily contribute to make dynamic GI a reality
     
    RB_lashman likes this.
  31. makeshiftwings

    makeshiftwings

    Joined:
    May 28, 2011
    Posts:
    3,350
    I'm very happy to see this is on GitHub now. Thank you SonicEther for opening the source instead of just letting it languish!
     
    RB_lashman, hopeful and Martin_H like this.
  32. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Well you can all consider this as basically crowdfunding a dynamic GI for the greater good instead of it being just about how much money wasted. Silver linings and all that :)
     
  33. dadude123

    dadude123

    Joined:
    Feb 26, 2014
    Posts:
    789
    Still crashes for me after enabling voxel AA and flying around a bit.
    The standalone worked fine (but i didnt test it for longer than a minute).
    The project version crashes the display driver.

    Here's the log file. Unfortunately there is no useful information inside it from what I can see.
    https://pastebin.com/6cHrWJna
     
    RB_lashman likes this.
  34. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    I would advocate making it so that SEGI can't be resold as a shader or asset (but as you say still fine for games being sold or films). This is so people don't just keep ripping off github and selling it on asset store.
     
  35. Mauri

    Mauri

    Joined:
    Dec 9, 2010
    Posts:
    2,665
    I'd say that is one of the joys of 'open source'. When sonicether was developing alone and more closed, we couldn't give much feedback in time. Now we can give instant feedback by contributing to it, etc. Most thanks to @nxrighthere. Let's say the future for SEGI is becoming (more) brighter :)
     
    AndyNeoman likes this.
  36. TooManySugar

    TooManySugar

    Joined:
    Aug 2, 2015
    Posts:
    864
    Those crashing try to give hardware and OS specs, as it will probably helpf finding what is going on.
     
    RB_lashman likes this.
  37. makeshiftwings

    makeshiftwings

    Joined:
    May 28, 2011
    Posts:
    3,350
    I'm trying to use Megasplat and SEGI at the same time. For some reason, in the voxelization pass, SEGI sees all the splatmapped objects as white voxels instead of picking up the actual color from the splat texture. I looked at the SEGIVoxelize shader but I'm a bit lost trying to figure out how it actually gets the color of a voxel. Could anyone nudge me in the right direction?
     
    RB_lashman likes this.
  38. Vagabond_

    Vagabond_

    Joined:
    Aug 26, 2014
    Posts:
    1,148
    As far as i know (at least i remember Sonic did mentioned it) SEGI only reads the main texture and main color from a shader...I think there is no way to work with Mega Splat just like that ( not sure though ) !
     
    makeshiftwings and RB_lashman like this.
  39. makeshiftwings

    makeshiftwings

    Joined:
    May 28, 2011
    Posts:
    3,350
    Ah! That makes sense... _MainTex and _Emissive are the textures from the material of the object it's voxelizing. Actually I think I can make that work in my case; MegaSplat lets you use a Macro Texture to fade to at a distance which acts like a regular diffuse main texture, it's just named differently. And I'm generating the macro texture anyway, so I can probably figure out how to use that for the voxelization pass.
     
    RB_lashman likes this.
  40. AndyNeoman

    AndyNeoman

    Joined:
    Sep 28, 2014
    Posts:
    938
    Great to see other shader specialists getting involved. Has anyone else had a problem with reflections? Some of my assets from the tropical pack are completely red when reflections are on. go back to usual green when off. This asset is big improvement on standard realtime GI I look forward to how it evolves with git.
     
    RB_lashman likes this.
  41. thelebaron

    thelebaron

    Joined:
    Jun 2, 2013
    Posts:
    857
    are you using lux? theres an issue with the two and reflections(I recall a similar problem when using the lux skin shader and segi).
     
    RB_lashman likes this.
  42. nxrighthere

    nxrighthere

    Joined:
    Mar 2, 2014
    Posts:
    567
    @Mauri @dadude123
    Thanks for the information. It's hard to solve this issue because I can't reproduce it on my PC and laptop. I experienced video driver crashes in some scenarios, but the cascaded version has become stable after I made fixes to the code.

    By the way, @sonicether has merged all the recent pull requests with the master branch, so as always feel free to test it and leave some feedback.
     
    Last edited: Nov 18, 2017
    hopeful and RB_lashman like this.
  43. Mauri

    Mauri

    Joined:
    Dec 9, 2010
    Posts:
    2,665
    @nxrighthere I wish I could do more, but I'm not an expert at this, so Editor logs and alike are the only thing I can offer :(
    I'm currently "out of office", but I'll give it a go later and report back :)
     
  44. redemprez

    redemprez

    Joined:
    Aug 14, 2017
    Posts:
    29
    I am experiencing some strange memory leak when using the latest version of SEGI (not release, but master branch). After couple of minutes my memory usage goes to 12GB for no reason. When SEGI is disabled Unity runs normally. Also SEGI 0.9 release works fine.
     
    RB_lashman likes this.
  45. nxrighthere

    nxrighthere

    Joined:
    Mar 2, 2014
    Posts:
    567
    @redemprez You're faced with this problem because SEGI is now working in the scene view, but the volume textures are not unloaded properly from memory. Now it should be fixed.
     
    Last edited: Dec 17, 2017
    hopeful, RB_lashman and redemprez like this.
  46. Mauri

    Mauri

    Joined:
    Dec 9, 2010
    Posts:
    2,665
    Still crashing my graphic driver and Unity... :(
     

    Attached Files:

  47. redemprez

    redemprez

    Joined:
    Aug 14, 2017
    Posts:
    29
    Thank you, you're the boss! I will test it soon :)

    EDIT: Memory leak is gone, great. But now SEGI is flickering after pressing "play".
    EDIT2: Flickering in 2017.1.1p3 also. It dissapears when "Infinite bounces" are off.
    EDIT3: Flickering still exists, even with infinite bounces off:
    EDIT4: @nxrighthere found the source of flickering: It appears only when the scene view and the game view are opened at the same time. Temporary solution: closing one of views. @nxrighthere is working on a fix.
     
    Last edited: Sep 23, 2017
    TooManySugar and RB_lashman like this.
  48. nxrighthere

    nxrighthere

    Joined:
    Mar 2, 2014
    Posts:
    567
    @dadude123 Downgrading from Unity 2017.2.0b11 to 2017.1.1p3 / p4 should solve your issue.

    @Mauri I'll send an experimental version to you as soon as I finish working on it.

    @redemprez Can you record a short video demonstrating what exactly is happening?
     
    RB_lashman and dadude123 like this.
  49. redemprez

    redemprez

    Joined:
    Aug 14, 2017
    Posts:
    29
    @redemprez Can you record a short video demonstrating what exactly is happening?[/QUOTE]
    I just did it in my previous post. I will record also version with infinite bounces.

    EDIT2: @nxrighthere found the source of flickering: It appears only when the scene view and the game view are opened at the same time. Temporary solution: closing one of views. @nxrighthere is working on a fix.

    EDIT:
    Flickering also exists when clicking on interface buttons even when stopped (for example: buttons on top of the scene view) or dragging sliders.

    Video with inifnite bounces:


     
    Last edited: Sep 23, 2017
    RB_lashman likes this.
  50. Mauri

    Mauri

    Joined:
    Dec 9, 2010
    Posts:
    2,665
    Take all the time you need :) Thank you for your hard work!