Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

SEGI (Fully Dynamic Global Illumination)

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

  1. ronjart

    ronjart

    Joined:
    May 16, 2013
    Posts:
    100
    I just came across this issue. Thanks for the explanation.
     
    RB_lashman likes this.
  2. semaphore

    semaphore

    Joined:
    Mar 21, 2011
    Posts:
    49
    Hello @sonicether

    In 5.5p2 with the latest Segi I am getting this compile error when putting the component on the camera:

    UnityException: SetTexture failed
    UnityEngine.ComputeShader.SetTexture (Int32 kernelIndex, System.String name, UnityEngine.Texture texture) (at C:/buildslave/unity/build/artifacts/generated/common/runtime/ComputeShaderBindings.gen.cs:74)
    SEGI.OnPreRender () (at Assets/SEGI/SEGI.cs:868)

    How can I fix this?
     
    RB_lashman likes this.
  3. sonicether

    sonicether

    Joined:
    Jan 12, 2013
    Posts:
    265
    Check the SEGI/Resources/SEGIClear.compute compute shader for compile errors (select it in the project window and look at the inspector). Are there any compile errors there? If so, please let me know.

    Also, you can try right clicking this file and selecting "Reimport". Let me know if that helps.
     
    RB_lashman likes this.
  4. sonicether

    sonicether

    Joined:
    Jan 12, 2013
    Posts:
    265
    Well, I just tried out using blue noise instead of white noise for GI tracing. At first, things didn't look quite right, and I wasn't very impressed. I ended up having to adjust how the cone directions are chosen so the directions are more coherent from one sample to the next. The result is pretty exciting!!

    Here's with white noise:


    And here's the same shot with the same number of samples per pixel with blue noise:


    I was generating white noise before with a simple pseudo-random function in the pixel shader. Blue noise can't be generated in real-time, so it has to be sampled from a texture. The additional cost of this thankfully ended up being tiny (about 0.08 ms in this image).

    Not only does it look better unfiltered, but as you can see, there is much less visible structure in the noise, which means it blurs really well too (unfocus your eyes and you can see what I mean)!
     
    ksam2, RB_lashman, ikazrima and 20 others like this.
  5. TwiiK

    TwiiK

    Joined:
    Oct 23, 2007
    Posts:
    1,729
    Looks great! Inspired by Playdead's talk about Inside? They were praising blue noise in nearly every slide. :D
     
    RB_lashman likes this.
  6. Vagabond_

    Vagabond_

    Joined:
    Aug 26, 2014
    Posts:
    1,148
    Is this all about how the random rays are generated ?
     
    RB_lashman likes this.
  7. P1st3ll1

    P1st3ll1

    Joined:
    Dec 13, 2012
    Posts:
    69
    Nice! :D
    Btw Cody, how's your family member? Feeling better?
     
    RB_lashman likes this.
  8. SteveB

    SteveB

    Joined:
    Jan 17, 2009
    Posts:
    1,451
    Wow...as always that looks fantastic
     
    RB_lashman likes this.
  9. Shinyclef

    Shinyclef

    Joined:
    Nov 20, 2013
    Posts:
    502
    That's a massive difference! Nice one!
     
    RB_lashman likes this.
  10. TooManySugar

    TooManySugar

    Joined:
    Aug 2, 2015
    Posts:
    864
    The improvement betwen ther first and second img is simply brutal.
     
  11. rainisto

    rainisto

    Joined:
    Jul 19, 2015
    Posts:
    35
    Thanks for the great asset, having fun trying things out.

    I'm doing some VR experiments - I have a pretty good computer so in theory I should be able to do something with it. With HTC Vive and SteamVR Camerarig, I have trouble getting the left eye to work.

    Even when I do this with two cameras, and set one target eye: left and one target eye: right, things render but the left eye segi lighting texture seems to be 6 cm in the wrong position - i.e. it's not reading/rendering the position of that camera correctly. Anybody got this working?
     
    RB_lashman likes this.
  12. sonicether

    sonicether

    Joined:
    Jan 12, 2013
    Posts:
    265
    Glad to see you guys are as happy with the improvement that blue noise brings as I am!

    Though I'll be getting more in-depth with testing VR soon (when I start working on making SEGI more VR-friendly), I admittedly don't have a whole lot of experience with setting it up with SEGI yet. I'm sure someone else here can help!


    By the way guys, I'd just like to encourage you to share any screenshots you'd be willing to share in this thread! Not only would I love to see what you guys are creating with SEGI, but with your permission, and with credit given, I'd like to feature some screenshots from users on the webpage and Asset Store page for this asset!
     
  13. Shinyclef

    Shinyclef

    Joined:
    Nov 20, 2013
    Posts:
    502
    I'm rewriting a bunch of things to switch from geometry shaders to something SEGI can understand, so will be a while, but will definitely post pics later if I get it working.

    Looking forward to seeing other people's pics too. Also would be good to know what kind of performance people are seeing with their screenshots!
     
    RB_lashman likes this.
  14. Lex4art

    Lex4art

    Joined:
    Nov 17, 2012
    Posts:
    445
    Last edited: Jan 10, 2017
    Baldinoboy, ftejada, SteveB and 5 others like this.
  15. SteveB

    SteveB

    Joined:
    Jan 17, 2009
    Posts:
    1,451
    Quite easy:

    All you need to do is:

    • Select Camera (eye) under [CameraRig] -> Camera (head) and slap SEGI on there.
    • In the Camera settings, make sure the rendering path is Deferred
    • Just below that, make sure Target Eye is set to Both (I'm suspecting you're trying to access the separate eyes here)
    • Finally in Player Settings -> Other Settings, set Stereo Rendering Method to Multi (Slow) (until Cody get's SEGI to play nice with VR, it won't display correctly under Single (Fast))
    That will do it!

    -Steven
     
    RB_lashman likes this.
  16. Vadya_Rus

    Vadya_Rus

    Joined:
    Oct 23, 2013
    Posts:
    9
    Here are a few screenshots/videos of a little scene I whipped up a while back. Lighting was achieved with a mix of SEGI-lit 1m spheres and point lights for shadows.

    https://www.instagram.com/p/BKPeOUdApLD/

    https://www.instagram.com/p/BKWypTtgoK7/

    https://www.instagram.com/p/BKpZqG6AHGg/

    https://www.instagram.com/p/BKz0hKwgEFM/

    Instagram's compression doesn't do the videos justice. But if you'd like I can put together some better screenshots for you to use.

    Also the results from the blue noise implementation look awesome! It's great to see that we can squeeze a little more performance while retaining visual quality! :)
     
    Last edited: Jan 10, 2017
    Lex4art, Baldinoboy, ftejada and 4 others like this.
  17. Shinyclef

    Shinyclef

    Joined:
    Nov 20, 2013
    Posts:
    502
    @Vadya_Rus that looks really nice! How are you finding performance with the settings you're using? Happen to have a little demo scene somewhere?
     
    RB_lashman likes this.
  18. ftejada

    ftejada

    Joined:
    Jul 1, 2015
    Posts:
    695
    Hello Sonic !!!

    I am very interested in SEGI but I have some doubts about whether it will serve me (performance in my scenes, visual results, etc).

    The issue is that I am hesitating between buying your asset or "Global ilumination proxi". I have tested "Global ilumination proxi" and performance is going well but I think the best visual results will give them SEGI.

    Would there be any way to test a trial version in my scenes before deciding to buy yours or the other?
    I'm really interested in SEGI, but I would not want to pay that amount of money so that later I do not meet my expectations or I do not go well in my performance scenes.

    Greetings and thanks in advance
     
    eDmitriy and RB_lashman like this.
  19. Vadya_Rus

    Vadya_Rus

    Joined:
    Oct 23, 2013
    Posts:
    9
    Performance is almost at a playable 60fps at 1080p. In this particular scene I didn't bother implementing any optimizations like occlusion culling or LODs. I sortof just threw everything together and focused more on visual fidelity.

    EDIT: It also doesn't help that each piece of the environment (straight piece, end piece, corner pieces, and props) each had their own unique 2K texture maps that were sculpted and painted.
     
    RB_lashman likes this.
  20. Vagabond_

    Vagabond_

    Joined:
    Aug 26, 2014
    Posts:
    1,148
    On what GPU do you run it ?
     
    RB_lashman likes this.
  21. SteveB

    SteveB

    Joined:
    Jan 17, 2009
    Posts:
    1,451
    Realtime GI for $80...that amount of money? SEGI should cost three times more, easily. The fact you're getting performant, real global illumination that looks as amazing as it does is well worth the price of admission! :D

    Anyway Proxy is not GI inasmuch as it is point light raycast system. The screenshots between the two products should be more than enough to make a decision. The fact that SEGI has a superior visual quality to Enlighten should also tell you a lot.

    Go get SEGI champ you'll be very happy.

    -Steven
     
    RB_lashman and Vadya_Rus like this.
  22. Vadya_Rus

    Vadya_Rus

    Joined:
    Oct 23, 2013
    Posts:
    9
     
    arnoob and RB_lashman like this.
  23. SteveB

    SteveB

    Joined:
    Jan 17, 2009
    Posts:
    1,451
    Oh and as for performance (the whole point to your question), the fact that I'm aiming to use it for VR should also tell you quite a bit. (being that VR is the most demanding thing we're doing now in gaming)

    For non-VR applications SEGI is blazing when you consider its realtime global illumination. (can I stress this enough?! lol)

    Cheers
     
    RB_lashman and Vadya_Rus like this.
  24. ftejada

    ftejada

    Joined:
    Jul 1, 2015
    Posts:
    695
    To see SteveB... I understand and I think the same as you regarding the results that SEGI shows. But I'm not putting that in doubt.
    The question is whether it will be worth to me for the type of scenes that I am developing in my game (interior and exterior). And the exteriors are open world and that makes me doubt if with everything I want to implement I can make everything go at an acceptable rate of fps.

    Apart I think I read some time ago that for large open worlds SEGI had problems of some kind (But I do not remember well).
    Obviously I prefer SEGI. But I do not want to make an expense so that later I do not serve for what I want. I guess that all people have little money lately because of the world economy problems and others, and I am no exception.

    Another question I would like to ask Sonic is the following ...

    What camera effects have you included in the sample scene of "Sponza demo"? If you have any ...
    SEGI.jpg

    And since I'm asking, how does SEGI work in big open scenes?

    Greetings.
     
    RB_lashman and SteveB like this.
  25. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    6,493
    Scene is only lit up to a few meters at incredible quality, I think it depend on the voxel and voxel area size.

    To lit bigger scene completely, you would need to wait for the cascading voxel implementation that is coming soon.

    Meanwhile you can do like all dev and settle for compromise, use SEGI for close shoot and use another approximation for large terrain and far distance

    Notice that segi isn't baked and work with any dynamic scene. SO you might need to bake another solution for large scene static set and use segi for closer dynamic scene. Which, depending on your solution, might allows you to go with faster baking time with lower resolution/fidelity for these far scenes, while keeping segi for the close details.

    DISCLAIMER
    I haven't bought segi yet (money and priority), I'm just closely monitoring what's happening. I defer to actual users for the details of the practicability.
     
    RB_lashman likes this.
  26. JohnSmith1915

    JohnSmith1915

    Joined:
    Apr 21, 2016
    Posts:
    143
    I think that Unity would buy Segi and incorporate this into the engine, Enlighten consume many time and system resources to generate poor results.
     
    RB_lashman likes this.
  27. SteveB

    SteveB

    Joined:
    Jan 17, 2009
    Posts:
    1,451
    ...or why wouldn't Unity have an asset-developer program where they help a select few developers who's assets bring tremendous value and quality to the platform, so they can maintain the asset and continue to improve it?

    Unity doesn't have to hire anyone and the developer is secure in knowing he's being supported financially.

    It's not cut and dry why one asset is a success and another not-so-much, but surely Unity can forecast when an asset demonstrates that it enhances the platform and that said asset may gain traction and be far more successful in the future given enough growth and visibility. (a Unity supported asset would definitely get attention).
     
    one_one and RB_lashman like this.
  28. Baldinoboy

    Baldinoboy

    Joined:
    Apr 14, 2012
    Posts:
    1,526
    Few test shots using SEGI on a WIP update to my environment pack. Did not spend too much time adjusting values but love how it looks. Really want to do a cave system with SEGI :)

    http://imgur.com/a/7OaV3


     
    Malbers, mk1978, Mister-D and 9 others like this.
  29. SteveB

    SteveB

    Joined:
    Jan 17, 2009
    Posts:
    1,451
    Glorious
     
    Baldinoboy and RB_lashman like this.
  30. Lewnatic

    Lewnatic

    Joined:
    Sep 29, 2012
    Posts:
    209
    Hello! This project looks awesome. But i have a quick question. Are the demo scenes in the screenshots included? Since they are shown in the Asset store but seem to not be in the actual asset. Are they somewhere to download?
     
    RB_lashman likes this.
  31. rainisto

    rainisto

    Joined:
    Jul 19, 2015
    Posts:
    35
    Thanks for the answer... I did that, but it resulted in weird artefacts into the left eye. The segi light was ghosting and seemed like 6 cm off, especially if go close enough to objects. (I guess nobody else is getting this problem?) It goes away when I put the Near Light Gain to 0, but it's a shame to lose it completely.

    Anyway, I got it working now the 'old-fashioned' way, i.e. with two cameras, one manually offset 6 cm from the other, both of these cameras on target eye: both mode, rendering onto rendertextures, and then separate cameras that show only those rendertexture contents. A bit cludgy but whatever works.

    I'm getting around 65fps for VR and the timewarp does the rest. Not too bad. :) Looks cool in VR.

    (Edit: Well, looks cool in editor playing in VR. Building doesn't seem to work - complains about deleting the SEGI_VOXEL_CAMERA...)
     
    Last edited: Jan 11, 2017
    RB_lashman likes this.
  32. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    The blue noise trick is really old - we used to do it a couple of decades ago. I mention this because it brings back memories. Basically to improve a bad jpg, you'd distribute noise on the blue channel. It seems like one of those old magic tricks.
     
    chingwa, Vagabond_ and RB_lashman like this.
  33. katoun

    katoun

    Joined:
    Dec 26, 2012
    Posts:
    89
    Hello sonicether,

    I like both your assets (SEGI and Screen Space Shadows).
    I want to ask you a question, thought I am not that of an experienced render programmer, I know Unity and game engine pretty well (11 years exp as a game programmer):
    Is is possible to replace the 2 extra cameras that you use in your code with Camera and Light command buffers and compute directly the matrixes that you need for your shaders? (Like you did in the Screen Space Shadows)
    If it's possible, will there be any gain in doing so, like less CPU and GPU usage?
    I do not know the answers to the questions, but my "intuitions" says that it should work and faster because that is one of the reasons Unity Tech introduced these CommandBuffers for.

    P.S. If these questions were asked and answered before in this forum, I am sorry, I tried to look for it but I might have missed it.

    Regards
     
    RB_lashman likes this.
  34. NERVAGON

    NERVAGON

    Joined:
    Oct 27, 2009
    Posts:
    73
    Here's a SEGI archviz shot for you. Love your plugins. Keep up the good work!
     

    Attached Files:

    P1st3ll1, Baldinoboy, SteveB and 4 others like this.
  35. SteveB

    SteveB

    Joined:
    Jan 17, 2009
    Posts:
    1,451

    Hmmm, the only issue I had with errant SEGI rendering was from:

    • Trying to use Unity 5.5 with SEGI 0.82 (even though I knew it wouldn't work until Cody updated)
    • Trying to use Forward Rendering
    • Using other screen-space assets that were not VR compliant
    • Setting the Stereo Method to Single (Fast)
    • Attempting to get Adaptive Quality to work (this is a Forward only utility)

    As for builds, those worked just fine too.

    So yea, Unity 5.5 and SEGI 0.83 and you should be good to go. Try a fresh scene with no other elements, just SteamVR and SEGI with the correct setup.

    Cheers
     
    RB_lashman likes this.
  36. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,789
    "Lost" Technology! This algorithm was really popular in the early days of computer graphics, but seems to have lost favor in recent years for some reason. Perhaps available resolution has increased to the point it was deemed unnecessary?
     
    hippocoder and RB_lashman like this.
  37. buttmatrix

    buttmatrix

    Joined:
    Mar 23, 2015
    Posts:
    609
    I would be very enthusiastic to share somee WIP screenshots using SEGI, although I feel that I should wait for the blue noise implementation to be deployed before doing so.

    In a similar vein, can you confirm that the attached screenshot from the SEGI webpage is using only a single directional light, or have you included emissive quads as fill lights as well?
     

    Attached Files:

    RB_lashman likes this.
  38. SteveB

    SteveB

    Joined:
    Jan 17, 2009
    Posts:
    1,451
    That feels like emissive quads based on the lack of direct shadowing.

    Unless I'm crazy and/or blind, it looks like it's all ambient occlusion with a very dense voxelization, and btw it's gorgeous! :D
     
    RB_lashman likes this.
  39. Lewnatic

    Lewnatic

    Joined:
    Sep 29, 2012
    Posts:
    209
    Its still sad that those scenes are not included in the asset. Would like to test it on my own.
     
  40. Lex4art

    Lex4art

    Joined:
    Nov 17, 2012
    Posts:
    445
    This interior scene is commercial asset available in store: https://www.assetstore.unity3d.com/en/#!/content/41721 - sharing it with SEGI will be simply illegal... but you can buy it and have some tests )
     
    RB_lashman likes this.
  41. Lewnatic

    Lewnatic

    Joined:
    Sep 29, 2012
    Posts:
    209
    Yeah i know that too by now. But i think this information should be added in the asset store somewhere. I also thinks its a grey area to put images of other assets in the asset store to sell your product. Could get him into trouble maybe.
     
  42. SteveB

    SteveB

    Joined:
    Jan 17, 2009
    Posts:
    1,451
    He's not selling environment's, he's selling a lighting solution and there's no ambiguity there. At the end of the day no one else's assets are included, which I'm fairly certain Unity does it's due diligence when checking out package contents for this exact reason.

    Anyway regarding your need to test, there are a S***-ton of free assets on the store. Funny thing is that many are terrible quality, but when lit with SEGI look F***ing amazing.

    Just go buy it.
     
    RB_lashman likes this.
  43. Lewnatic

    Lewnatic

    Joined:
    Sep 29, 2012
    Posts:
    209
    Then he should write that down in the description. I bought the asset with the assumption it includes the demo scenes. Now i need to ask him for a refund which is annoying for him and me.

    And on a side note the submission guidlines of unity are full of very clear statements. Its not taking long to search.

    Since a submission also includes the asset store images this can be seen as a violation of the submission guidlines.

    Btw im not saying that the asset is bad. Its awesome but there should be statet somewhere that the assets shown in the images are not included at least.

    Edit: Im also not saying that hes doing this intentional. But there should be a sidenode.

    Cheers.
     
  44. chiapet1021

    chiapet1021

    Joined:
    Jun 5, 2013
    Posts:
    605
    Images are not "content" as defined in your asset store terms excerpt. Content would be the actual models/textures/scenes, etc.
     
    RB_lashman and SteveB like this.
  45. SteveB

    SteveB

    Joined:
    Jan 17, 2009
    Posts:
    1,451
    Let me get this straight...you bought SEGI...a Lighting/Rendering Solution...because you wanted the environments?!?\

    What in the world would you even do with them if they were in fact included? At best what, walk around in them on your own? You couldn't reuse them for anything so really they'd serve no other value to you than to look at them to see SEGI doing the very thing you purchased SEGI for...and now you want a refund.

    M'kay, and also what Chiapet said too...he saved me the trouble mercifully
     
    RB_lashman and chiapet1021 like this.
  46. ksam2

    ksam2

    Joined:
    Apr 28, 2012
    Posts:
    1,079
    I think the highest priority should be a better performance.

    The performance is good on sample scene but on my own scene I just get 20 fps with a powerful PC.
     
    RB_lashman likes this.
  47. SteveB

    SteveB

    Joined:
    Jan 17, 2009
    Posts:
    1,451
    Can we dissect your scene?

    Pics, SEGI param's, etc...


    EDIT: ...and of course you know I agree with you completely
     
    RB_lashman likes this.
  48. sonicether

    sonicether

    Joined:
    Jan 12, 2013
    Posts:
    265
    In the Sponza demo, there's just SEGI, bloom, anti-aliasing, and tonemapping.

    That scene was lit with emissive quads. Although I could have gotten good results by using a directional light with "GI blocker" geometry (geometry with the included GI blocker shader) to minimize light leaking, I simply used emissive quads.

    Are you using low-poly proxy geometry for GI voxelization? Having your full quality meshes voxelized can be quite performance heavy.

    As an example, consider the Viking Village scene. The log cabin-ish buildings could be approximated by using flat low poly walls. It's quite slow to voxelize all that high poly geometry, but if low poly versions of the objects in the scene were used during the voxelization step instead, a huge speedup could be had.

    Is anyone here using low-poly proxy geometry for voxelization?


    The point you bring up is precisely why I didn't include those scenes. As @SteveB said, I think it's pretty clear that I'm not selling scenes, I'm selling a lighting solution. If Asset Store publishers weren't allowed to show screenshots for graphical assets of scenes that aren't included in the asset package itself, we wouldn't be able to really show off what our assets can accomplish. I'm sure I'm not the only Asset Store publisher who specializes in graphical assets that isn't much of a 3D modeler/texture artist/environment artist. I put in the extra work to create the low poly scene that is included with SEGI so users can get a sense of how to set it up in their own scenes. The low poly scene serves this purpose and there's no need to include others.

    If you'd still like a refund, just send me an email via the contact page on my website and we can get that going.
     
    Last edited: Jan 12, 2017
    ftejada, buttmatrix and RB_lashman like this.
  49. Lex4art

    Lex4art

    Joined:
    Nov 17, 2012
    Posts:
    445
    Derpville is heavily based on simplified geometry (usually for GI used lowest LOD of each mesh - just duplicate it, rename and put to layer that visible only for SEGI and not visible for player camera; that was described in SEGI manual and really helps).

    But even with simplest GI-casting geometry there is a feeling of a performance cap - light calculations is heavy by themselves (playing with cones radius/amount/width helps a lot but to the some degree; will be good to have something on top of that to boost fps: in cheap Cryengie LPV GI there was a option to set "Update interval" (in frames) - by default there was 7, if I recall correctly somehow this did not give performance hit every 7th frame - seems these LPV calculations was spreaded on each frame in between (?copy GI data of frame 0, split it on 7 parts, calculate 1/7 in each frame, output on 7th? in my magical world of ignorance it it something like that )).
     
    Last edited: Jan 12, 2017
  50. punk

    punk

    Joined:
    Jun 28, 2013
    Posts:
    408
    @sonicether I've just noticed when I enable SEGI, particle billboards stop facing the camera, any idea whats causing that?

    SEGI.png
     
    arnoob, RB_lashman and Lex4art like this.