1. Help us improve the editor usability and artist workflows. Join our discussion to provide your feedback.
    Dismiss Notice
  2. We're looking for feedback on Unity Starter Kits! Let us know what you’d like.
    Dismiss Notice
  3. We’re giving 2017.1 beta testers a chance to win t-shirts and a Nintendo Switch. Read more on the blog.
    Dismiss Notice
  4. Unity 2017.1 beta is now available for download.
    Dismiss Notice
  5. Unity 5.6 is now released.
    Dismiss Notice
  6. Get further faster with the Unity Plus Accelerator Pack, free for new Unity Plus subscribers for a limited time. Click here for more details.
    Dismiss Notice
  7. Check out all the fixes for 5.6 on the patch releases page.
    Dismiss Notice
  8. Learn how you'll soon be able to publish your games to China in four simple steps with Xiaomi. Sign up now for early access.
    Dismiss Notice

SEGI (Fully Dynamic Global Illumination)

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

  1. sonicether

    sonicether

    Joined:
    Jan 12, 2013
    Posts:
    248
    [​IMG]

    SEGI Webpage

    SEGI is a voxel-based Global Illumination effect that aspires to provide 100% dynamic Global Illumination to Unity games and applications. Since it requires no precomputation, SEGI can bring GI to certain situations where precomputed solutions like Enlighten cannot!

    SEGI provides indirect lighting and glossy reflections from a single directional light, the sky, and any emissive materials in the scene. In the future, SEGI will support indirect lighting from point and spot lights. SEGI calculates indirect light visibility for soft indirect shadows, and also calculates soft sky light shadows. It can render either a single bounce or infinite bounces of indirect light.


    SEGI is in beta and still in-development. If you are considering purchasing this asset, please consider the current limitations and plans for future development before buying!

    If you want to report an issue, make sure it's not in the list of known issues below. You can either notify me here in this thread, in a PM, or email me directly (my email address is in Section 5 of the User Guide).


    Screenshots and Demos
    The only additional effects in these screenshots and demos are bloom, tonemapping, and anti-aliasing. No reflection probes, lights, or SSAO are used. The screenshots were taken with a render resolution of 1920x1080.
    [​IMG]
    [​IMG]
    [​IMG]
    [​IMG]
    [​IMG]
    [​IMG]
    [​IMG]
    [​IMG]
    [​IMG]
    [​IMG]
    [​IMG]
    [​IMG]
    [​IMG]
    [​IMG]


    Demos (Windows)

    Sponza Demo

    Low Poly Demo

    Labyrinth Demo




    Compatibility
    As this is the first beta version of SEGI, compatibility is limited. SEGI has only thoroughly been tested on a Windows PC; behavior on other platforms is unknown. Improving compatibility is of high priority. SEGI requires DX11. SEGI is not compatible with mobile devices, and probably never will be.




    Current Limitations and Known Issues

    Known Issues
    -Infinite bounces can be slow in some complex scenes
    -Incompatible with forward-rendered objects (deferred only)
    -Light cookies on Directional Lights do not affect GI
    -Point and spot lights do not contribute to GI
    -Possible stuttering while playing in editor with the camera inspector visible
    -Undefined behavior with VR
    -Undefined behavior with multiple instances of SEGI
    -Does not work with orthographic camera (since deferred rendering is disabled for orthgraphic cameras)
    -Some voxels are black/too dark when voxel AA and infinite bounces are both enabled
    -Slight changes in positions of some objects in the volume can cause large lighting differences​

    Current Limitations

    Light Leaking
    There are two causes of light leaking under the hood of SEGI. The first is an inherent limitation of cone tracing. The premise of cone tracing is that for each traced "ray", instead of simply sampling a point of information, you get to sample an area of pre-combined information. This keeps rays that are traced in different directions more coherent and allows for tracing far fewer rays to get a smooth result. Simply put, cone tracing samples blurred data.

    [​IMG]
    This diagram compares naive ray tracing (left) with cone tracing (right)

    Now, what happens when we have a one-voxel-wide occluder in front of that light data?

    [​IMG]
    As you can see, with naive "brute force" sampling, each ray encounters full opaque black before it reaches the illuminated voxels, so no light gets through. With cone tracing, however, data is blurred which smears the occluder and the light information such that rays do not encounter full opaque black before reaching the illuminated voxels.

    The other cause of light leaking is a lack of directional light information in the voxel data. This means that, instead light bouncing forward off an illuminated surface, it bounces in all directions. This problem is helped with the Inner Occlusion Layers property and GI Blockers (see Section 4.2 of the User Guide), but is not solved completely. In the future, multiple already explored options will be considered regarding storing and reading directional voxel data to resolve this issue.
    Indoor/Outdoor Hybrid Scenes
    Mostly because of the light leaking discussed above, SEGI can struggle with indoor/outdoor hybrid scenes, especially with interiors that have thin bright walls. The use of GI Blockers (discussed in the User Guide) can help.
    Limited Scene Scale
    Currently, SEGI only uses a single voxel volume to store GI data. This means that large scenes or scenes with greatly varying object scales are not handled well. In the near future, voxel volume cascades (akin to shadow cascades) will be used to extend the GI distance and influence whilst keeping high-density data where it counts--near the camera.
    Redundant Voxelization
    SEGI completely revoxelizes everything inside the GI voxel volume every frame. This obviously is not ideal, especially with mostly static scenes, because a lot of redundant work is being done. This issue will be investigated soon in order to find a way to reduce redundant voxelization and improve performance.




    Development Roadmap
    Many things are planned for the future development of SEGI, both specific and general. As well as fixing the known issues and limitations, these things are planned to be worked on in the future. The improvements in this list are roughly in order of priority.

    -Use velocity buffer to eliminate artifacts caused by moving objects with temporal sampling
    -Smarter voxel data encoding for reduced memory usage and faster voxelization
    -Voxel volume cascades for handling large scenes
    -Lazy mipmapping for spreading the cost of mipmapping the voxel volume over multiple frames
    -Smarter voxelization for less redundant work
    -Directional voxel data to prevent light leaking
    -Use Spherical Harmonics during bilateral blur for better results with normal maps
    -Cubemap support for ambient/sky light.
    -Cubemap/reflection probe fallback for reflections instead of uniform sky color
    -Extra occlusion layers to be material-specific instead of globally applied to all voxelized geometry
    -More simplistic and efficient switchable modes
    The general design direction I've taken with SEGI has focused on accuracy, but there are variations that I've played around with that are less accurate but lighter on performance. I'd like to explore these options and include them as options for people who don't need such accuracy and prefer higher performance.​
    -Support for forward-rendered objects
    -Indirect light from point and spot lights
    -Better close-proximity GI by storing voxelized geometry normals
    -Additional dominant cones for soft voxel shadows traced from point/spot lights
    -Improve smoothness of GI when stochastic (randomly jittered) sampling is disabled
    -Voxel data pre-calculation for static objects
    -Baking GI result for super-fast GI baking
    -Separate voxelization from light injection so lighting can be updated on static voxels
    -Fix visual "warmup" (first few frames after entering play mode show incorrect GI)
    -Screen-space tracing for fine-scale indirect shadows (SSAO on steroids)
    -Glossy refraction and subsurface scattering



    [​IMG]
    Did SEGI help your project/scene look awesome?

    If you'd like to share your work, post a screenshot in this thread and mention how you should be credited! The most awesome screenshots will be featured in this thread, on the webpage for this asset, and on the Asset Store page (with credit given, of course)!

    Please share with me your experience with SEGI! The more communicative we all are, the more progress this project will make. Let's make real-time GI a reality for game developers and games!
     
    Last edited: Jan 10, 2017
  2. Brian-Ryer

    Brian-Ryer

    Joined:
    Mar 5, 2013
    Posts:
    33
    Holy S**t you have just made Unity look like Cryengine, :)
    Great job, following this thread and Once you work on the limitations this will be one of those "Must own assets".
     
  3. SteveB

    SteveB

    Joined:
    Jan 17, 2009
    Posts:
    1,396
    Dude yes looks so damn sweet (yea I sound like a broken record but man I'm not even joking)...

    ...instabuy!
     
    RB_lashman likes this.
  4. Crossway

    Crossway

    Joined:
    May 24, 2016
    Posts:
    226
    You said It can't be used for big scenes? I have a big terrain with lots of tree can I use this?
     
  5. SteveB

    SteveB

    Joined:
    Jan 17, 2009
    Posts:
    1,396
    For large, outdoor scenes, objects and the terrain in the distance merely need to appear to be affected by skylighting to look coherent. You wouldn't even really be able to tell there wasn't any bounce lighting or occlusion (bounce could be faked to a degree). Sure large flat surfaces such as buildings could make bounce lighting more apparent, but it isn't a deal breaker.

    I'd compare it to how we really don't have high quality distance-shadows, even with cascades rendering power is limited. Look to GTA 5 is a great example of creating great fidelity yet having to make compromises for the vast draw distances.

    Once GI cascades arrive, large scenes will obviously be less of an issue
     
    RB_lashman likes this.
  6. Unreal-Vision

    Unreal-Vision

    Joined:
    May 6, 2013
    Posts:
    57
    Thanks Sonic for release.
     
    RB_lashman likes this.
  7. christoph_r

    christoph_r

    Joined:
    May 20, 2013
    Posts:
    220
    Sweet baby jesus. This is definitely going to be one of the most important Unity assets.
     
    RB_lashman likes this.
  8. Kombiice

    Kombiice

    Joined:
    Jan 20, 2015
    Posts:
    25
    Ow yes!
     
    RB_lashman likes this.
  9. adamz

    adamz

    Joined:
    Jul 18, 2007
    Posts:
    760
    Looks fantastic! Congrats.
     
    RB_lashman likes this.
  10. yc960

    yc960

    Joined:
    Apr 30, 2015
    Posts:
    198
    I have a question, would it work for emissive material outside of camera view? I am currently using SSRR to simulate realtime emission with obvious drawbacks. I wonder if your post effect can handle emissive material off screen?
     
    RB_lashman likes this.
  11. SteveB

    SteveB

    Joined:
    Jan 17, 2009
    Posts:
    1,396
    Curious Sonic, but what occurs in VR that may or may not be working correctly?
     
    RB_lashman likes this.
  12. sonicether

    sonicether

    Joined:
    Jan 12, 2013
    Posts:
    248
    Certainly. The lighting calculations are not bound to screen-space data. Any emissive material inside the voxel volume (a large volume centered on the camera) will contribute to indirect lighting and reflections (if they're enabled). SEGI can't do sharp reflections, though.

    Well, I don't have a VR headset to do testing and development (I plan to change that soon), which is the primary reason why functionality with VR is undetermined. Simply having two instances of SEGI (one for each eye) would result in a ton of wasteful calculations. I need to look into how to run only one instance of SEGI and simply do all the on-screen shading twice, sharing the same data between both eyes.
     
    RB_lashman likes this.
  13. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    3,243
    Nice, perhaps we will be able to choose "static" or "dynamic" Voxelization.
    Anyway good job to listing all limitations and possible future improvments, so we are not fooled about the plugin.
     
    christoph_r likes this.
  14. Haagndaaz

    Haagndaaz

    Joined:
    Feb 20, 2013
    Posts:
    216
    Even if it was possible to prevoxelize to some extent and only revoxelise new objects, although I know that would be fairly complicated to code up
     
  15. eskovas

    eskovas

    Joined:
    Dec 2, 2009
    Posts:
    1,170
    Awesome, looks incredible Sonic! Congratulations :)
     
    macdude2 and RB_lashman like this.
  16. Skolstvo

    Skolstvo

    Joined:
    Dec 21, 2015
    Posts:
    106
    I notice that mouse movement is lagging terribly even though I get a great refresh rate. Could you release a build with the Standard Package FPSController with bobbing turned off? Is the screen space part of the GI having an effect on the update cycle or something?

    This package is absolutely gorgeous though, I can hardly wait for the release of this asset.
     
  17. jaelove

    jaelove

    Joined:
    Jul 5, 2012
    Posts:
    261
    Damn!!!!
     
    RB_lashman likes this.
  18. paulojsam

    paulojsam

    Joined:
    Jul 2, 2012
    Posts:
    433
    incredible stuff!!! How much will be the price for it
     
    RB_lashman likes this.
  19. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    3,243
    Perhaps like Nottorus plugin ? above 200$ ?
     
  20. sonicether

    sonicether

    Joined:
    Jan 12, 2013
    Posts:
    248
    $80 as long as it's in beta. $100 once it's been improved past the point of being considered beta.
     
    Computerkid23, Ony, macdude2 and 3 others like this.
  21. paulojsam

    paulojsam

    Joined:
    Jul 2, 2012
    Posts:
    433
    the only light will be the directional one right
     
  22. DivergenceOnline

    DivergenceOnline

    Joined:
    Apr 19, 2015
    Posts:
    244
    I hope it doesn't require contributing geometry to be static, otherwise I can't use it.
     
  23. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    1,600
    Now this is not ready for action game but walking simulator just reached a whole new level of visual mindblowingness :eek:
     
    RB_lashman likes this.
  24. FPires

    FPires

    Joined:
    Jan 5, 2012
    Posts:
    139
    That's a fantastic price.
     
  25. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    3,243
    A simple walking simulator can use Enlighten, we already have fantastic GI if you look at Unity PAMELA game and it runs very fast as it is baked.
    Sonicether plugin will benefit procedural generated games mainly i think.
    Still if the plugin was able to bake in some second a complete scene, this is what would really matters for me.
     
    christoph_r likes this.
  26. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    1,600
    But not if that walking generator is procedurally generated:D, For now active element have ghosting so it's almost a no for any action game or heavily animated game (no rotating rotor, no waving vegetation). Architecture is fine though!

    At least with this current state.
     
  27. Skolstvo

    Skolstvo

    Joined:
    Dec 21, 2015
    Posts:
    106
    I noticed that movement speed isn't addressed. Is it simply a case of bizarre custom movement logic, or is the dynamic GI impacting the actual update of camera rotation?
     
  28. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    3,243
    I will be happy when someone will make a SVOGI plugin for Unity, it will run very fast with very good results lot better than plain simple shadows and very good for outdoors and big levels.
     
  29. kenshin

    kenshin

    Joined:
    Apr 21, 2010
    Posts:
    909
    Sponza demo run very fine at 4K resolution... very impressive!
     
  30. Frpmta

    Frpmta

    Joined:
    Nov 30, 2013
    Posts:
    372
  31. sonicether

    sonicether

    Joined:
    Jan 12, 2013
    Posts:
    248
    It's probably my wonky custom movement logic.

    Yeah, that might be a possibility. If the GI can be fully baked into lightmaps, sure.
     
    RB_lashman likes this.
  32. TylerPerry

    TylerPerry

    Joined:
    May 29, 2011
    Posts:
    5,577
    What does that mean?
     
  33. Elecman

    Elecman

    Joined:
    May 5, 2011
    Posts:
    1,049
  34. Kombiice

    Kombiice

    Joined:
    Jan 20, 2015
    Posts:
    25
    What about nature scenes with many trees / much grass aso. ?
     
  35. ita333

    ita333

    Joined:
    Mar 28, 2014
    Posts:
    6
    I would like to use for Archiviz visualization.
    1) Can I use Substance material.?
    2) In the image that you have published interior furnishings that are near the window seem to fly . You could use along with your AO plugin ?
    3) Can I have mirror material or similar?
    4) Image seem a little dark , you can adjust the gamma or other parameters without burning colors?

    Your work is incredibile ..... My compliment?
     
  36. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    1,600
    I don't remember does number of polygon affect performance? I'm interested in low poly aesthetics, not flat shaded like your example, game like ds game.
     
  37. pvloon

    pvloon

    Joined:
    Oct 5, 2011
    Posts:
    507
    Hi Sonic, Congrats on the beta! I've dabbled with some VXGI techniques to see where a naive implementation gets you, and you seem to have squeezed order of magnitudes more out of it than standard techniques. Even low+128 settings look pretty great and runs on a shoddy laptop.
    Ill do some tests in VR when it's out. If you figure out how to share the voxelization & mips per eye this might be feasible for small scenes in VR. Will it come with source?
     
    RB_lashman likes this.
  38. GMM

    GMM

    Joined:
    Sep 24, 2012
    Posts:
    283
    I keep throwing money at the screen and the asset is still not downloading! :)

    I have been following SEGI for quite some time now and i hope that Unity puts it up on the asset store soon, since i would really like to play with it and see how it fits into my projects.

    Keep up the great work.
     
    RB_lashman likes this.
  39. makeshiftwings

    makeshiftwings

    Joined:
    May 28, 2011
    Posts:
    3,036
    Since this doesn't support point lights, would you be able to get a decent-looking torchlight by having the player hold a torch with a highly emissive material? What would be missing compared to a point light?
     
  40. Skolstvo

    Skolstvo

    Joined:
    Dec 21, 2015
    Posts:
    106
    @makeshiftwings

    To add to that question. Would it be possible to force an emissive object to occupy at least one voxel at all times?
     
  41. amasinton

    amasinton

    Joined:
    Aug 12, 2006
    Posts:
    112
    I've been watching this for a long time. SOOO excited it has been submitted to the Assett Store!

    Naive question(s): Would a non-DX11 version ever be a possibility? Why is DX11 absolutely required?

    I'm primarily a Mac developer (although I do a bit of PC too) and I just wanted to know what the main thing is that stands in the way of this running on OS X (I suspect Apple's foot-dragging on OpenGL / OpenGL in general...).

    Thanks!
     
  42. Greenwar

    Greenwar

    Joined:
    Oct 11, 2014
    Posts:
    34
    Hey there,

    This is some really cool stuff. I decided to test the sponza demo out, and this is what it looks like to me:
    [​IMG]
    This is on 1920 x 1080. DX11 on a r9 200 series. "Fantastic" quality settings. Switching to any presents below 4 causes the lighting to flicker.

    I've tried most setting and combinations without much luck.

    Am I doing something wrong?
     
  43. sonicether

    sonicether

    Joined:
    Jan 12, 2013
    Posts:
    248
    Perhaps it would be better to have an invisible sphere of a decent size (big enough to occupy a few voxels) that doesn't draw on-screen but contributes to GI, and perhaps additionally a point light with shadows.

    How many voxels an emissive object occupies depends on your voxel volume size and the size of the object... I was thinking about having special non-geometry voxelized objects for special purposes like virtual GI lights... Maybe I'll explore that in the future.

    Voxelization requires Unordered Access Views and applicable atomic functions which are DX11 only features.


    Hmm, looks like I've gotta look into that. If you do end up buying the asset, please PM or email me and we can work together to solve this bug. Of course, make sure your graphics drivers are up to date as well.
     
    amasinton and RB_lashman like this.
  44. punk

    punk

    Joined:
    Jun 28, 2013
    Posts:
    291
    This looks pretty ;)
     
    RB_lashman likes this.
  45. Zuntatos

    Zuntatos

    Joined:
    Nov 18, 2012
    Posts:
    391
    "Unordered Access Views" are supported by openGL, but not by MAC (they prefer updating metal over a competing openGL). Atomic functions are in openGL too; but I'm not sure how to write them in unity in a crossplatform way.

    @sonicether Are the shaders written in HLSL directly or in unity's shader language?
     
    amasinton likes this.
  46. SAOTA

    SAOTA

    Joined:
    Feb 9, 2015
    Posts:
    218
    So exciting. Thanks SE. Waiting for the Assetstore!!
     
  47. MikeUpchat

    MikeUpchat

    Joined:
    Sep 24, 2010
    Posts:
    775
    This does look amazing, I tried the low poly demo but I am only getting 6fps, is it expected that you need a serious high end 3d card for this to work?
     
  48. sonicether

    sonicether

    Joined:
    Jan 12, 2013
    Posts:
    248
    I simply meant UAVs are not supported by DX9. And they're written in Unity's shader language.

    That's a lot lower than I recall anyone else reporting.. What graphics card are you using?
     
  49. Mad_Fox

    Mad_Fox

    Joined:
    May 27, 2013
    Posts:
    45
    Waiting like a maniac! SE i have a question, we are already using your other two assets in our project, do you plan to make the three work together in a more optimized way, make a suite, or something like that?
    Thanks and really looking forward to this.
     
    RB_lashman likes this.
  50. MikeUpchat

    MikeUpchat

    Joined:
    Sep 24, 2010
    Posts:
    775
    It is a Radeon 6870.