Search Unity

Graphics HXGI Realtime Dynamic GI

Discussion in 'Tools In Progress' started by Lexie, May 24, 2017.

  1. Mauri

    Mauri

    Joined:
    Dec 9, 2010
    Posts:
    2,665
    Too overpriced wouldn't work out either. Remember that there's SEGI with a price tag of $80 - even though its development process is slow atm, it's still a competitor.
     
    Last edited: May 27, 2017
    Lexie likes this.
  2. Martin_H

    Martin_H

    Joined:
    Jul 11, 2015
    Posts:
    4,436
    Have you considered doing a kind of "enterprise licensing" where you only sell it to studios that can afford to pay for ongoing service contracts?
    I perfectly understand why you are having doubts about releasing on the assetstore. Imho there really should be more options for what kind of support to sell with an asset. I wouldn't mind to see some experimental assets that come with zero support, for people that are either capable and willing to put in some legwork themselves, or who are just curious to look behind the curtains of some bleeding edge tech.
     
    Lexie likes this.
  3. Lexie

    Lexie

    Joined:
    Dec 7, 2012
    Posts:
    646
    We will decide what the best option is once we are closer to completion. I don't feel comfortable licensing this out with zero support unless I'm sure that it can be dropped into a game and give good results while also running fast. I've been pretty disappointed with every implementation I've seen come out of these forums over the years that it would be really hard for me to commit large sums of money and stake my whole game on something with no support with out it working perfectly out of the box. But that's just my honest opinion.
     
  4. Lexie

    Lexie

    Joined:
    Dec 7, 2012
    Posts:
    646
    Not sure on performance yet. Still trying to optimize the reflection shader. it's the slowest part of the calculation.

    The Sci-Fi scene with a 256x64x256 volume and medium update rate rendering at 1920x1080

    GTX 1070
    • 600+fps - reflections OFF
    • 205+fps - Full res reflections ON
    • 1500+fps with the GI turned completely off.
    GTX 970m (laptop GPU, around the same speed as a GTX 660)
    • 180+fps - reflections OFF
    • 85+fps - Full res reflections ON
    • 300+ fps with The GI turned completely off.
    The reflections are pixel bound so I need to get those running faster so reflections can be possible in VR. Also the jump from 600fps to 200 really highlights a bandwidth issue with the reflections. Im going to try constructing a distance field to speed up reflections from needing 100s of samples per pixel to trace the voxel grid to hopefully less then < 10. Probably worth the memory usage.

    I want to make sure there is a lot of head room for other effects and more complex scenes as well. There are a few other shaders I still need to optimize as well.

    Even with my slow reflections my GI + reflections are faster then just unity's screen space reflections on low. So yeah, pretty fast already. Still got a lot of optimization to do.
     
    Last edited: May 28, 2017
    ftejada, buttmatrix, vonpixel and 2 others like this.
  5. brisingre

    brisingre

    Joined:
    Nov 8, 2009
    Posts:
    277
    As a one-man studio who isn't going to be making any money from my games any time soon, anything more than $100 I consider expensive. I would happily buy this even if it were expensive, but there is a point where I'd be priced out. The most expensive asset I've ever purchased was $150 for ProCore Bundle, and I probably bought it on sale. I would pay more than that for this if it solves my problems, but I think in broad terms I think Lexie's right -- it's hard to sell anything for more than $100 on the asset store.

    Lots of assets provide essentially no support. It's not a great sign, and I try to avoid those assets a lot of the time. That said, if something comes with intelligible source code, or works very well out of the box, I'm okay with it. If you were to sell it with the disclaimer that your job was working on your game, not working on this asset, and as such you would probably only be fixing breaking issues, not adding features or answering questions, as long as it worked well out of the box, I don't think people would have very much to complain about.

    I've seen a few people go the route of selling a few very expensive licenses instead of trying to sell more licenses at asset store prices.

    https://forum.unity3d.com/threads/t...hexagonal-infinite-procedural-terrain.174595/ This guy's doing it right now. It doesn't seem to be going incredibly well. This thread's full of potential customers complaining about the price and the occasional paying customer complaining about the level of support they're getting for their money (although they do still feel it's worth the price.) It also isn't going incredibly poorly -- his goal was to make money from his asset without having to support a lot of users, and it appears to be working out. He's sold a few licenses, made some money, and doesn't have a large userbase to support.
     
    Martin_H likes this.
  6. Arganth

    Arganth

    Joined:
    Jul 31, 2015
    Posts:
    277
    would easily buy it for a 100 (or more but i wont tell you :p ):)

    would of course be nice if it works nicely together with your ohter volumetric asset
     
  7. Lexie

    Lexie

    Joined:
    Dec 7, 2012
    Posts:
    646
    Yeah that's the plan, Its pretty simple to add support for volumetric rendering. The cool thing is it a set cost of all the GI volumetric lighting. You could have 1000s of emissive surfaces and its the same cost in the volumetric pass. Although I might make a version that shader model 5 only as there are a lot of ways to significantly speed it up.
     
    ftejada, tapawafo, punk and 2 others like this.
  8. IronDuke

    IronDuke

    Joined:
    May 13, 2014
    Posts:
    132
    I'm really liking the looks of this.:D

    I'm not concerned with how you plan to distribute it. I'm certain you'll use a fair method, and that's all I ask for. I'll get my hands on this thing one day no matter what you do.:cool: Unless I get SEGI. Dunno; need hard data on performance to know which is better for me.

    --IronDuke
     
  9. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,685
    @Lexie - Also consider selling both parts of the dynamic volumetric suite to Unity. See if they'll bite. It would be the most efficient way to go, saving everyone time and trouble. You wouldn't be sucked into a lifetime of support; you'd have just the one customer.

    As a buyer, I can see a parallel to a few years back to when Marmoset, Alloy, and Jove released their PBR solutions, and then Unity came along with their PBR embedded in the engine.

    I owned Jove, which then became the Scion screen FX kit. And then we get the new screen FX suite from Unity, which is to a fair extent replacing Scion.

    I also own NGUI ... which was largely replaced by Unity 4.6.

    I could go on for a bit in this vein ... but would prefer not to. ;)
     
  10. macdude2

    macdude2

    Joined:
    Sep 22, 2010
    Posts:
    686
    You're referring to the volumetric lighting? So you guys are the 6th top grossing right now, SEGI is the 5th top grossing. So its hard to believe that you'll actually make that much more money off of this asset... (Though its hard to say for sure what SEGI is making).
     
  11. brisingre

    brisingre

    Joined:
    Nov 8, 2009
    Posts:
    277
    I could be wrong about this, but I think that "top grossing" list is completely broken. Neither HX Volumetric Lighting nor SEGI appear on the top grossing list for me right now. Either it's bugged and showing different things to different people or it's showing something like the top grossing in the past hour. I sometimes feel like it's biased toward showing me things I've been looking at recently in "top paid", I wouldn't swear I've seen the same behavior in "top grossing" but I feel like it might do the same thing.
     
  12. Lexie

    Lexie

    Joined:
    Dec 7, 2012
    Posts:
    646
    What, where did you get that metric from? top grossing for me is completely filled with audio plug-ins
     
    Last edited: May 28, 2017
  13. brisingre

    brisingre

    Joined:
    Nov 8, 2009
    Posts:
    277
    I think he's probably looking at the "Top Grossing" list on the front page of the asset store.
     
  14. Lexie

    Lexie

    Joined:
    Dec 7, 2012
    Posts:
    646
    So am I, its all audio plug-ins, If I'm on the top grossing list for my volumetric plugin then we are all doomed, or for some reason we just had a massive spike in sales.
     
    brisingre and Martin_H like this.
  15. brisingre

    brisingre

    Joined:
    Nov 8, 2009
    Posts:
    277
    upload_2017-5-27_23-22-9.png

    For me it's totally different -- neither audio plugins nor HX Volumetric Lighting and SEGI. I think the list's just broken.
     
  16. Zuntatos

    Zuntatos

    Joined:
    Nov 18, 2012
    Posts:
    612
    Getting slightly derailed here, but that's the same list I see.
     
    brisingre likes this.
  17. macdude2

    macdude2

    Joined:
    Sep 22, 2010
    Posts:
    686
    My bad, should have specified, I meant on the shader page sub-store... Anyway, not trying to derail, just thought it was interesting.
    Capture.PNG
     
    Last edited: May 28, 2017
    brisingre likes this.
  18. Ogdy

    Ogdy

    Joined:
    Dec 26, 2014
    Posts:
    21
    Same here ! ;)

    According to my very advanced computational skills thats makes a computation time of :
    Reflections OFF / ON
    1 ms / 4,2 ms on GTX 1070
    2.2 ms / 8,4 ms on GTX 970m

    The results are amazingly low without reflections :)
     
    Last edited: May 29, 2017
    brisingre likes this.
  19. mtf20

    mtf20

    Joined:
    May 30, 2017
    Posts:
    1
    Hey Lexie, Congrats on this super awesome work.It really is a fascinating job and so much can be done with it. I second what so many people already said, please consider putting this on the asset store. This would be an immediate buy for me.
    Now I have a question. I assume this is a variation of Light propagation Volume algorithm that uses a progressive voxelization approach. I remember seeing an article that describes a similar topic in GPU pro 4.
    My question is how were you able to eliminate light leaks. They have always been there in each and every LPV and VCT implementation I heard of.
     
  20. Ogdy

    Ogdy

    Joined:
    Dec 26, 2014
    Posts:
    21
    Correct me if I'm wrong, but I don't think that light leaks were eliminated in this solution, or just partially. Take a look at the screenshot Lexie shared last week :
    Untitled-2.png
    Unless there are two more lights pointing up, the light is not supposed to be as intense in this cavity. I have the exact same issue with SEGI.
     
    Last edited: May 30, 2017
    DasBiot and Martin_H like this.
  21. Zuntatos

    Zuntatos

    Joined:
    Nov 18, 2012
    Posts:
    612
    To me it looks like the result of having voxels transmit in all directions equally. Imagine having voxel that emit 1 or 0 light, and then make a plane emitting light to 1 side and not to the other. If this plane is 1 voxel thick, it'll emit light towards both sides.

    It's like... light source leaking? Not so much light transport leaking like in SEGI. Fixing it would be moving light sources such that there is some padding towards a corner, or increasing resolution.

    Disclaimer: educated guessing here.
     
    scvnathan and brisingre like this.
  22. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    6,493
    NO solution will be perfect, they rely on approximation so that frame don't take twelve hour like in movie. The point is that you must compensate and adapt, it's just a tool.
     
    tapawafo, Lexie, Martin_H and 3 others like this.
  23. shawnblais

    shawnblais

    Joined:
    Oct 11, 2012
    Posts:
    324
    Wow this looks great, and we'd certainly purchase it for use in our VR game, for use w/ HxVolumetics which we're already using. Purchased SEGI, but it's not even close to being performant enough.
     
  24. olavrv

    olavrv

    Joined:
    May 26, 2015
    Posts:
    515
    Looks very interesting. "Real" GI fast enough for VR would definitely be a major step! Looking forward to release. Any ETA?
     
  25. Ogdy

    Ogdy

    Joined:
    Dec 26, 2014
    Posts:
    21
    He sometimes shares his progress with some cool screenshots on Twitter you can follow him @hxLexie
     
  26. Lexie

    Lexie

    Joined:
    Dec 7, 2012
    Posts:
    646
    Because light is propagated per voxel, occlusion blocks the propagated light from traveling through walls. Cone tracing is more of summed approximation of an area and as you sample smaller mipmaps of the average lighting, it introduces a lot of light bleeding.

    LPV based GI limit the bleeding to 1 voxel, the light wont travel through the wall but surfaces very close to the wall can get some lighting from the other side. Offsetting the sampled position based of surface normal can hide most of this effect and I'm exploring Some realtime AO to hide the bleeding that can still occur. The most prominent case is the ground can get some leaking right near a thin wall.

    I spent a little more time then I care to admit trying to figure out the math behind tracing a voxel grid using a 3DD algorithm. It speeds up the reflections more then doing a brute force ray march and also cleans up and banding you normally see from realtime reflections.

    The effect is too slow for me currently, although it is still faster then unity's SSRR. I'm looking into creating a distance field or storing the world in a sparse voxel octree so the reflections can skip large empty areas to reduce the sample count. Distance field is the easiest way, but the SVO would allow me to lower the VRAM requirements. If I could also store the lighting data in a SVO then the propagation step and VRAM usage would be improved a lot. I'm not sure how feasible that is though.

     
    Last edited: Jun 3, 2017
    ftejada, DasBiot, nxrighthere and 3 others like this.
  27. Lexie

    Lexie

    Joined:
    Dec 7, 2012
    Posts:
    646
    If you look at the voxelized version of the world then all those artifacts make sense. The quality of directional lighting is limited to the resolution of the voxel grid. The voxel resolution would have to be extremely tiny to be able to limit those areas from casting lighting into the surrounding area. This can be mitigated by placing emissive surfaces in better positions that leverage the voxelization process. Basically that whole bar has turned into an area light, with no surface above it the light is cast upward.

    Unfortunately we just don't have enough computing power to remove artifacts like this and still be able to calculate GI and render the scene out at 120hz+. There has to be some compromise somewhere, either place the lighting to leverage the voxelization, or incur some omni directional emissive surfaces.
     
    Last edited: Jun 3, 2017
    punk likes this.
  28. nipoco

    nipoco

    Joined:
    Sep 1, 2011
    Posts:
    2,008
    I have high hopes for this one. It looks gorgeous.
    SEGI is simply unusable for a real game.

    So I pray HXGI will eventually hit the Asset Store. I'd pay $100 or more for it.
     
    nxrighthere, Arganth and one_one like this.
  29. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    @Lexie why do i get the feeling that this is almost similar tech that used by Cryengine/Lumberyard? Which is i would like to have in unity tho :D
     
  30. Lexie

    Lexie

    Joined:
    Dec 7, 2012
    Posts:
    646
    I've added half res glossy reflections. speed went from 80fps to 130fps on my laptop. I'm going to do some screen space blurring and create some mipmaps so different roughness are supported, this should also hide the voxel shape in the reflection as well. After that's done ill make a video of it in motion.

    Edit: here is it with the blurring pass. I still need to correctly apply this with the material properties, but here is a test of removing the voxelized reflections.
     
    Last edited: Jun 8, 2017
    ftejada, DasBiot, Ghosthowl and 6 others like this.
  31. Deleted User

    Deleted User

    Guest

    So how does this compare to CE's / LY's SVOTI / SVOGI? Just wondering as I'm testing it out and if nothing else it's quick (2ms + reflections and large scale AO (on a GTX 1080).. I've not digged into the code, just messed around with it and it looks pretty damn good too..!
     
  32. Lexie

    Lexie

    Joined:
    Dec 7, 2012
    Posts:
    646
    No idea, I've never used cryengine.
     
  33. Deleted User

    Deleted User

    Guest

    You don't need to use it to understand the pro's / con's of their techniques.. From what I know of it (without a deeper look) (SVOGI) uses several layers of radiance voxelised with opacity, DL is injected into voxels and then sampled during a ray-tracing pass.

    Downsides AFAIK is it uses 64+MB's of GPU memory, dynamic objects don't actually affect GI they just recieve it.. Which your solution might do it better?

    But the pro's are it works at 2-3ms on a PC (even with large openworld games) and if rendering budget will allow will work happily on console (there is a lower quality version which will speed things up on consoles that doesn't support specular (needs enviro probes)), now I'm not expecting you to be able to match it but I'd expect something pretty close in terms of performance.

    P.S looking good ;)..
     
    Last edited by a moderator: Jun 8, 2017
    Billy4184 likes this.
  34. Lexie

    Lexie

    Joined:
    Dec 7, 2012
    Posts:
    646
    Are you sure its ray traced? I thought they used LPVs for their GI
     
  35. brisingre

    brisingre

    Joined:
    Nov 8, 2009
    Posts:
    277
    Blur pass looks great. Very smooth, nothing in that screenshot that's clearly an artifact of the voxelization.
     
  36. Deleted User

    Deleted User

    Guest

    Years ago they did, now it's SVOGI / SVOTI (Lumberyard uses SVOGI and CE uses SVOTI).. Both slightly different ways of doing it.. SVOGI doesn't require enviornment probes (or light probes) on full settings for specular but only raytraces directionals. It can be used as a multi-bounce, but if you do it's "semi static" if it's a directional with global moving objects (like a dynamic game / minecraft or something) it is limited to a single bounce.

    SVOTI (CryEngine) uses light probes (for specular) but has multiple bounces and cracks off thousands of rays traced through voxels and shadowmaps. Although it is slightly heavier (marked as 4-5ms on Xbox One / 2-3 ms GTX 780 w/ AO)..

    They are both based on voxel raytracing though (in some ways at least)..
     
  37. Lexie

    Lexie

    Joined:
    Dec 7, 2012
    Posts:
    646
    Thanks for the description, My method uses LPV + voxel tracing for specular. I'm looking into using sparse voxels to speed up the voxel tracing, half res + some blurring is giving pretty good results though. I'm looking into doing cascades to increase the view distance. No idea what kind of view distance either of CE GI has.
     
    Deleted User likes this.
  38. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    yeah i think they use cascades voxel
     
    DasBiot and Deleted User like this.
  39. Lexie

    Lexie

    Joined:
    Dec 7, 2012
    Posts:
    646
    I'm cleaning up the specular reflection code now and exposing some control settings. I think I can move onto cascades after that.
     
  40. Elecman

    Elecman

    Joined:
    May 5, 2011
    Posts:
    1,374
    Would this work in a cockpit environment?

    It's a small 3x3m space, full of thousands of small objects (switches, CB's etc). The environment is mainly static in itself but the cockpit does move of course, but relative to the sun it doesn't. Switches move but their contribution to GI is so small it can be ignored. Lighting needs to be updated near-realtime though.
     
  41. Lexie

    Lexie

    Joined:
    Dec 7, 2012
    Posts:
    646
    I'd have to be able to make it so the volume can be parented to the local space of the cockpit. but other then that you could have a pretty small volume like 32x32x32 and fit it to the bounds of the cockpit. with a volume that tiny you could have the lighting update 10-100 times a frame to remove all the artifacts of the light propagating out.
     
    StaffanEk, Elecman, yc960 and 3 others like this.
  42. Elecman

    Elecman

    Joined:
    May 5, 2011
    Posts:
    1,374
    Yes please :)
     
    CWolf likes this.
  43. Lexie

    Lexie

    Joined:
    Dec 7, 2012
    Posts:
    646
    After a lot of testing that method of blurring the screen space reflections just doesn't hold up on small details. I'm trying a Stochastic implementation similar to frostbites SSR, I should be able to leverage my specular approximation to make the transition to rough surfaces a lot better then their implementation.
     
  44. Lexie

    Lexie

    Joined:
    Dec 7, 2012
    Posts:
    646
    I made some good progress on the new reflections. It looks good on none mirror surfaces now. It all based off the materials PRDF now so it should look pretty accurate. Right now its reflecting the voxelized version of the world, I'll look into sampling the screen data where possible. This would give me reflections of reflections and also better contact shadows.

    You can notice the pot in the middle of the scene has a pretty boxy reflections, If i was able to use screen data then cases like that would be hidden.

     
    Last edited: Jun 13, 2017
    ftejada, DasBiot, amasinton and 8 others like this.
  45. ekergraphics

    ekergraphics

    Joined:
    Feb 22, 2017
    Posts:
    257
    Are you any closer to figuring out if or how one might be able to purchase or license this technology?

    And if one wanted to use this for VR, what considerations would you have to take into account regarding the scene? Are potential bottlenecks complexity of meshes, materials or lights, or is the overall overhead rather flat but high, or only near and during animations, etc?
     
  46. brilliantgames

    brilliantgames

    Joined:
    Jan 7, 2012
    Posts:
    1,937
    Very interesting. I'm also working on a solution and it looks like we are using the same method. Where instead of using a bunch of fudged LODs of a grid, light just travels through a detailed grid frame by frame. Creating a very realistic lighting simulation, but slow light travel.
     
  47. Lexie

    Lexie

    Joined:
    Dec 7, 2012
    Posts:
    646
    Still haven't figured out if we are releasing, I need to get all the functionality in to see how well it performs in larger scale games. With out cascades the draw distance is pretty limited, when I get those added in i'll have a better idea if its something other people can use.

    The voxelization process is pretty fast, simpler meshs will speed it up though. It can be worth voxelizing LOD meshs if you have really high poly models. I'm not sure if ill be able to get the reflections working fast enough for VR or not, that effect is pixel bound so I'm not sure if VR would be able to handle it, Ill test it out on my gaming rig once I've cleaned up the code.

    Every unity light that you want to effect GI has an extra cost associated with it, but the number of emissive surfaces has little to no impact on performance. Where possible its best to switch out a unity light for an emissive surface as those are basically free.
     
    S_Darkwell likes this.
  48. Lexie

    Lexie

    Joined:
    Dec 7, 2012
    Posts:
    646
    Yes, that's how the defuse lighting works, The specular is traced per pixel, there is also specular approximation mode if you don't want the cost associated with ray traced specular reflections, It's still pretty fast considering what its doing (faster then any SSR I've seen)

    I remember a forum post of your's ages ago about a GI plugin. I've seen soo many canceled GI plug-in's that I gave up hope and just started making my own. After seeing your success with your crowd sim I figured you stopped working on it, cool to hear you're still going, I remember it looking pretty good.
     
  49. Mauri

    Mauri

    Joined:
    Dec 9, 2010
    Posts:
    2,665
    Please do. The demand for realtime GI (not needing to rely on Enlighten) is high. Compared to SEGI, not only does HXGI look more performance-optimized, your development progress is also way more stable/steady.
     
  50. brilliantgames

    brilliantgames

    Joined:
    Jan 7, 2012
    Posts:
    1,937
    @Lexie Ultimate Epic Battle Simulator is actually using one of my dynamic GI solutions. The game contains both real time diffuse and specular reflections, all built from a single 2d render texture using depth. The specular reflections are raytraced using the one render texture and they are very efficient. I'm actually thinking of combining the 2 systems.