Search Unity

  1. Click here to see what's on sale for the "Best of Super Sale" on the Asset Store
    Dismiss Notice
  2. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

SEGI (Fully Dynamic Global Illumination)

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

  1. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    For better performance, you'll need a heavy modified Segi version or something different like Svogi.
     
    RB_lashman and Crossway like this.
  2. Crossway

    Crossway

    Joined:
    May 24, 2016
    Posts:
    420
    I've tried to use low poly as much as possible but even with GI Culling Mask set to nothing still it reduce my PFS from 250 to 100. and after just adding my low resolution ground (Terrains) it will reduce FPS to 30 with low setup.

    SEGI Helper script helped a lot but there is still a problem. When I move camera after a while I lose GI and should stop camera and don't move it to get GI update again! If I keep moving SEGI Helper won't update GI until I stop camera movement.
     
    RB_lashman likes this.
  3. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    One way to go would be someone making some tech similar to CryEngine Svogi able to run a full outdoor open world game in 3D cards like GTX970 for example.

    You can claim to have a top notch renderer, but if performance is not worked on or try using different tech or solutions, it is still a tech demo only and useless.
     
    Last edited: Dec 4, 2017
    RB_lashman likes this.
  4. homeworld4

    homeworld4

    Joined:
    Apr 10, 2013
    Posts:
    4
    Hey guys, i'm using SEGI in my main game, which is far from release, but i've spent the last 3 days participating in Ludum Dare, for which i've also used SEGI: https://homeworld.itch.io/total-pollination

    It's all untextured materials and emissives, and a subtle non-SEGI realtime light to make some of the meshes pop out; if you feel like it or have the time, let me know what you think!
     
    Last edited: Dec 5, 2017
    DragonmoN, hopeful and RB_lashman like this.
  5. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    Other threads are better place to promote your game.
     
  6. homeworld4

    homeworld4

    Joined:
    Apr 10, 2013
    Posts:
    4
    I'm not sure how to better show off my SEGI thing than giving away a link to the game for free; would a screenshot have been more appropriate?
     
    RB_lashman likes this.
  7. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    We could have same visuals with a directionnal ligh and using emissive textures, there is nothing special in your game graphics (and you said it's a non-SEGI realtime light game, so where is the interest ?).
     
  8. homeworld4

    homeworld4

    Joined:
    Apr 10, 2013
    Posts:
    4
    My bad, i wrote that in a confusing manner: of course it uses SEGI, otherwise there'd be no point in mentioning it here :) and although it doesn't truly tap in the real power of SEGI (as it's a simple untextured cartoony style with no procedural generation), SEGI made it REALLY fast and hassle-free to get that result and iterate on the lighting without constantly rebaking, so it was a godsend in a gamejam scenario :D
     
    amasinton, zenGarden and RB_lashman like this.
  9. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    26,726
    Looks excellent. This thread is a clusterfork anyway, so anything SEGI-related probably should go in here :) it's dead so any life given to it, and support is welcome. Love the look of your game, please post more shots :)


    Regarding paying for wishes:

    I would advise anyone interested in GI not to pay for for realtime GI solutions in general, if they're not very technically savvy because the nature of the problem is that there isn't a one-size-fits-all. It might be some developers want to continue the work and charge for it, but I do predict the same will happen again: it'll get abandoned and people will cry again. GI is an mmo scale rendering problem.

    Would anyone here pay someone to make an mmo and trust them? Well that's the same question to ask.
     
  10. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    Yep i was confused lol
    Segi can be a great ressource for game jams and small games indeed.
     
    Last edited: Dec 5, 2017
    RB_lashman likes this.
  11. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,447
    I agree with these sentiments to varying extents. There are certainly many technical challenges and compromises which make a one-size-fits-all or even one-size-fits-most realtime GI solution beyond reach.

    I disagree with comparing it to paying someone to make an mmo, because realtime GI is at least a single system with fairly well defined scope. It is plausible for one person or a very small team with the right skills and understanding of a particular GI technique to produce a working and sustainable one-size-fits-some solution. How many actually do, and crucially decide to sell their work to the masses is another question and the answer is clearly not too many. But not none, and there are some potential ones I will be only too happy to trust, especially because I can understand the limitations of a particular technique and don't expect the world.

    Plus every success and failure of Unity realtime GI assets will not only be a story relating to the specific challenges of GI. There are always other factors too, and SEGI is no exception. It won't stop me trusting another developer if they release their solution, especially if I already trust them and their ability to deliver updates to other existing assets they've made.
     
  12. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    26,726
    I think it's especially useful for game jam presentation given you might not want to spend a while baking with only 5 mins left on the clock.... :D
     
  13. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    Specially game jam lol
     
    RB_lashman likes this.
  14. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    I tried it , and can say for small scale game, Segi can be usefull and getting interesting results.

    Some scene with no lights and only few emissive materials






    Frame rate is ok in some 1080p.

    Such system i'm not sure will be usable in complex open world until you get something similar as Cryteck Svogi, while it looks very usable in low poly or detailled small scale games.
     
    Last edited: Dec 6, 2017
    RB_lashman and homeworld4 like this.
  15. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    Based on emissive material and not lights, some trick to simulate area lighting lol

    You could make some larger dome following the player , so you get fake directionnal light


    The only concern is that rendering can look noisy until you apply some image filter
     
    Last edited: Dec 6, 2017
    RB_lashman and Lex4art like this.
  16. Arganth

    Arganth

    Joined:
    Jul 31, 2015
    Posts:
    280
    Dont have access to my project right now but i think you have to disable stoachstic filtering (or one of the other checkboxes :D) and the noise vanishes
     
    RB_lashman likes this.
  17. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    It didn't reduced the noise, better keep it "on" to keep good results.
    Checking "bilateral" filtering get rid of the noise.
     
    RB_lashman likes this.
  18. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    5,570
    I'm suspicious that anyone will find a cheap RT GI solution or hacks for open world anyway, unless you precompute data for static first. RT GI seems okay for interior but costly.
     
    RB_lashman likes this.
  19. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,206
    I'm skeptical too, but considering that technology is a moving target, and it keeps getting better, it's safe to say we will eventually have dynamic GI. SEGI is a pioneering attempt, and we'll see more in the years to come.
     
    RB_lashman likes this.
  20. SteveB

    SteveB

    Joined:
    Jan 17, 2009
    Posts:
    1,448
    Of course we will get to fully simulated realtime GI. Same could've been said years ago at the idea of open world, realtime dynamic shadows and now they're the norm and quite sophisticated.

    We're just eager... :D
     
    RB_lashman likes this.
  21. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    CryEngine had real time GI long time ago with Lpv very functionnal, and braught a better solution like Svogi that is great for open worlds keeping good performance on medium PC.
    I don't consider it as pionneer but some Unity lacking feature that could be done, i'm sure they could bring some Svogi like system but this is not Unity priority and main users need.
    It's like terrain they give you the basics, and it's up to each user to look after plugins or solutions for their specific needs.
     
  22. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    5,570
    I meant now, not tomorrow lol, when the 1080ti will be entry card and 10k tv the norm, it will be expected.
     
    RB_lashman likes this.
  23. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    Another good article even i don't consider a small room demo as something able to upscale to a real gameplay level lol

    http://armory3d.org/manual/graphics/global_illumination.html


    Timings performed on GTX 1060. Rendering curio shop scene, 498k tris, 104 objects, 64x64x32 voxel volume.

    1920x1080
    RTGI
    2.2
    VoxelAO
    2.1 / 4.0 *
    VoxelGI
    4.0 / 6.1 *
    Frame (ms)
    5.0 / 11.2 / 13.3 **

    • * Revoxelized per frame
    • ** Base(deferred + temporal AA) / Base + RTGI + VoxelGI / + Revoxelized per frame
     
    buttmatrix, SteveB and RB_lashman like this.
  24. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    For small scale game Segi seems to have almost no impact while chaging a lot how shadowing looks with global illumination.
    Test off and on :
     
    hopeful and RB_lashman like this.
  25. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    4,035
    You guys use ASE with SEGI? I noticed that the toon outline or any non lit material doesn't register with SEGI so the GI lighting bleeds through. Any fix? (in ASE)
     
    RB_lashman likes this.
  26. chiapet1021

    chiapet1021

    Joined:
    Jun 5, 2013
    Posts:
    604
    Are those forward-rendered shaders?
     
    RB_lashman likes this.
  27. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    4,035
    No, that's the outline portion of the shader
    Code (CSharp):
    1.         Tags{ }
    2.         Cull Front
    3.         CGPROGRAM
    4.         #pragma target 3.0
    5.         #pragma surface outlineSurf Outline keepalpha noshadow noambient novertexlights nolightmap nodynlightmap nodirlightmap nofog nometa noforwardadd vertex:outlineVertexDataFunc
    6.         uniform fixed4 _ASEOutlineColor;
    7.         uniform fixed _ASEOutlineWidth;
    8.         void outlineVertexDataFunc( inout appdata_full v, out Input o )
    9.         {
    10.             UNITY_INITIALIZE_OUTPUT( Input, o );
    11.             v.vertex.xyz += ( v.normal * _ASEOutlineWidth );
    12.         }
    13.         inline fixed4 LightingOutline( SurfaceOutput s, half3 lightDir, half atten ) { return fixed4 ( 0,0,0, s.Alpha); }
    14.         void outlineSurf( Input i, inout SurfaceOutput o ) { o.Emission = _ASEOutlineColor.rgb; o.Alpha = 1; }
    15.         ENDCG
     
    RB_lashman likes this.
  28. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    4,035
    I know this thread is pretty dead but maybe someone uses ASE with this. With custom lighting shaders, the GI lighting shows through.
     
    RB_lashman likes this.
  29. chiapet1021

    chiapet1021

    Joined:
    Jun 5, 2013
    Posts:
    604
    I'm fairly certain it's because custom lighting shaders are currently only rendered in forward mode (see this post on the ASE thread), and SEGI only currently works with deferred rendered objects.
     
    RB_lashman likes this.
  30. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    4,035
    Ah thanks, yes I switched this custom shader to deferred only and it looks gray now. I'll bug them :D
     
    RB_lashman likes this.
  31. chiapet1021

    chiapet1021

    Joined:
    Jun 5, 2013
    Posts:
    604
    Good luck! It seems like custom lighting models being forward-only is something you can't get around--in Unity currently, at least. This asset also offers a unique set of custom lighting shaders that also can only be rendered in a forward loop. I have no idea if it will be possible to do custom lighting in deferred with scriptable render loops, once they are an officially implemented feature in the engine.
     
    laurentlavigne and RB_lashman like this.
  32. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    4,035
    I don't understand, is it related to deferred render path in the camera? custom lighting like a wraparound or a toon shader render fine when the camera is in deferred, how is that different?
     
    RB_lashman likes this.
  33. chiapet1021

    chiapet1021

    Joined:
    Jun 5, 2013
    Posts:
    604
    So I am not a graphics guru by any means, but my understanding is that if you are running in deferred and also have objects with something like a toon ramp shader, those objects are rendered in a separate forward loop after the main deferred loop. The same would apply if you wanted to use a shader with alpha fade (partial transparency/translucency) while running in deferred.
     
    laurentlavigne and RB_lashman like this.
  34. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    4,035
    Gotcha, i understand why SEGI wouldn't like that.
    And so, why can't toon be rendered in deferred? I mean lambert coexists with PBR and Phong so it's not the lighting model.
     
    RB_lashman likes this.
  35. Pode

    Pode

    Joined:
    Nov 13, 2013
    Posts:
    119
    @laurentlavigne : in deferred, it's better to render all the geometry with the same shader. Since this shader is basically applied on 4 input maps (normal, albedo, worldpos, depth, etc...), if you want to render a bit of the geometry with another model, that means another pass on top of the previous one.
     
    RB_lashman likes this.
  36. chiapet1021

    chiapet1021

    Joined:
    Jun 5, 2013
    Posts:
    604
    I have no clue why custom lighting shaders can't be rendered in deferred, but it appears to be a more universal limitation--not something specific to the ASE toon ramp example.
     
    RB_lashman likes this.
  37. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    4,035
    The ASE devs are looking into it, it seems possible to do custom lighting in deferred :)
     
    RB_lashman, Arganth and chiapet1021 like this.
  38. UtilXiao

    UtilXiao

    Joined:
    Nov 27, 2012
    Posts:
    19
    Nice!
     
    RB_lashman likes this.
  39. mykillk

    mykillk

    Joined:
    Feb 13, 2017
    Posts:
    59
    Anyone know how the shader could be modified to allow brighter lighting amounts? It seems like the effective brightness on the emissive HDR maxes out around value 20 and this doesn't seem bright enough since the lighting amount is directly tied to the surface area of the emissive object. For realistically sized emissive objects (i.e. light bulbs), there just isn't enough light created. Maybe I'm just using it wrong...
     
    RB_lashman likes this.
  40. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    4,035
    in 2017.3 the hdr value can go to many hundred, maybe 64K even
     
    RB_lashman likes this.
  41. mykillk

    mykillk

    Joined:
    Feb 13, 2017
    Posts:
    59
    But will SEGI be able to take advantage of that? Currently the HDR maxes out at 99, but I don't see any difference in emissive brightness between a value of 99 and a value of 20.
     
    RB_lashman likes this.
  42. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    4,035
    I just tried it using 2017.3 rc2
    emission intensity 10<20<50<100<500<1000
     
    RB_lashman likes this.
  43. mykillk

    mykillk

    Joined:
    Feb 13, 2017
    Posts:
    59
    Great news! That's really going to help with fine tuning lighting intensity without having to go back and change the geometry.

    Thanks for trying that out.
     
  44. ksam2

    ksam2

    Joined:
    Apr 28, 2012
    Posts:
    1,045
    Anybody know if SEGI works with last version of Unity(2017.3.0f3) or not?
     
    RB_lashman likes this.
  45. Rispat-Momit

    Rispat-Momit

    Joined:
    Feb 14, 2013
    Posts:
    232
    Hi there!

    I downloaded SEGI and I tried to use t with Unity 2017. For some reason though the script remains inactive. I try to find a solution but with no luck! Do you know what I am doing wrong?

    Best,

    Rispat
     
    RB_lashman likes this.
  46. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    4,035
    restart unity
    sometimes that works
     
    Rispat-Momit and RB_lashman like this.
  47. N00MKRAD

    N00MKRAD

    Joined:
    Dec 31, 2013
    Posts:
    210
    Make sure you're on DirectX11 (DX12 should work as well), if your graphics backend is not compatible it will disable itself.
     
  48. Rispat-Momit

    Rispat-Momit

    Joined:
    Feb 14, 2013
    Posts:
    232
    Thank you so much! Do you think that Mac will be an issue?
     
    RB_lashman likes this.
  49. Lexie

    Lexie

    Joined:
    Dec 7, 2012
    Posts:
    646
    SEGI uses geometry shaders, They are not suported by Mac, A new 3 pass voxelization shader would need to be made to support mac. There might be other issues, that's just the first one I saw when it came to mac support.
     
  50. Rispat-Momit

    Rispat-Momit

    Joined:
    Feb 14, 2013
    Posts:
    232
    Thank you for the information Lexie!!!
     
    RB_lashman likes this.
unityunity