Voxel Cone Traced Lighting - DX11 Contest

Discussion in 'Showcase' started by kurtloeffler, Jan 19, 2013.

  1. kurtloeffler

    kurtloeffler

    Member

    Joined:
    Mar 26, 2009
    Messages:
    206
    Heres my entry for the DX11 contest. Its an implementation of realtime radiosity using voxel cone tracing.

    I'm kinda disappointed because I spent over a week making art for an environment, which was supposed to be the main part of the entry, but about 12 hours before the contest was over I realized I wasn't going to have enough time to finish the environment so I used the Sponza scene instead. So I only spent about 3 days on what actually got submitted :(.

    Standalone build:
    http://www.keenleveldesign.com/miscunity/voxelconetracing/builds/VoxelConeTracing01.zip

    Heres a video:


    And some screenshots:
    [​IMG]
    [​IMG]
    [​IMG]
    [​IMG]
    [​IMG]
    [​IMG]
    [​IMG]
     
    Last edited: Jan 20, 2013
  2. FlorianSchmoldt

    FlorianSchmoldt

    Member

    Joined:
    Jul 2, 2012
    Messages:
    334
    Wow ! Looks like the contest was mostly about tesselation and particles but finally ! :D
    I was hoping that somebody would do realtime GI and your results are great !

    any chance to get an executable ?
     
  3. n00body

    n00body

    Member

    Joined:
    Dec 17, 2010
    Messages:
    164
    So someone actually went ahead and did it. So let's see what we have now:
    Voxel Cone Tracing
    Procedural Terrain
    Procedural Water
    Crazy Particle Systems
    Physical Materials

    What is left on the checklist before UE4 is moot? :p
     
  4. I am da bawss

    I am da bawss

    Member

    Joined:
    Jun 2, 2011
    Messages:
    2,367
    WOW. AMAZING.
    Are you going to put that on Asset Store?

    Please say yes please pretty please please please....


    [​IMG]
     
    Last edited: Jan 19, 2013
  5. brilliantgames

    brilliantgames

    Member

    Joined:
    Jan 7, 2012
    Messages:
    1,819
    Oh....Wow.. Hahah. Best one I've seen yet. Real Time GI is a huge step towards photorealism. It can make any scene look good.

    Amazing work. :)
     
  6. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Messages:
    11,342
    Impressive. I would expect a lot of asset store solutions / and unity to pop up with native versions :)
     
  7. nipoco

    nipoco

    Member

    Joined:
    Sep 1, 2011
    Messages:
    1,563
    My jaw dropped to the floor. Dang that is awesome! Even without your own environment.

    Yeah not much, I think.
    I really didn't expect such great stuff from that contest. Hopefully you guys make it available for everyone. I'd be happy to throw my wallet at you.
     
    Last edited: Jan 19, 2013
  8. Aras

    Aras

    Graphics Plumber Unity Technologies

    Joined:
    Nov 7, 2005
    Messages:
    4,239
    Nice! Did you run into any feature set limitations (i.e. DX11 stuff that's not "properly" exposed in Unity 4.0)? I was wondering whether what we have in 4.0 is enough for voxel cone tracing, or not... looks like it is ;)
     
  9. cemnahit

    cemnahit

    Member

    Joined:
    Dec 26, 2012
    Messages:
    29
    Looking so nice. Unity4 is pushing the limits.

    Any chance that you can share executable demo for this?
     
  10. p v loon

    p v loon

    Member

    Joined:
    Oct 5, 2011
    Messages:
    418
    Holy.. ! Awesome you were able to pull this off! Can't believe how much talent there is in the community!

    Are you doing a specular cone as well? Seems so in some part of the videos, but I'm not sure. Great work man, and best of luck in the competition!
     
  11. kenshin

    kenshin

    Member

    Joined:
    Apr 21, 2010
    Messages:
    689
  12. Thinksquirrel

    Thinksquirrel

    Member

    Joined:
    Feb 8, 2011
    Messages:
    904
    Actually, I wouldn't say it's Epic at all... =P

    Looks amazing.
     
  13. elias_t

    elias_t

    Member

    Joined:
    Sep 17, 2010
    Messages:
    432
    Wow! I was waiting for this!!!
    Well done.

    You're gonna make me upgrade to unity4 earlier then I planned!

    How is it performance wise?

    And please put it on the asset store.
     
  14. bngames

    bngames

    Member

    Joined:
    Jul 3, 2012
    Messages:
    52
    please please put it on the asset store.
     
  15. n00body

    n00body

    Member

    Joined:
    Dec 17, 2010
    Messages:
    164
    Have you tried doing metallic specular on anything? I would like to see how blurry the reflections look. ;)
     
  16. Wolfos

    Wolfos

    Member

    Joined:
    Mar 17, 2011
    Messages:
    657
    Get over here so I can throw wallets at your head.
     
  17. Temporaro

    Temporaro

    New Member

    Joined:
    Dec 21, 2012
    Messages:
    27
    Simply amazing.

    How would this work in a sandbox game? Is it possible to have the voxels decrease in resolution along the horizon in an "infinite" environment?
     
    Last edited: Jan 19, 2013
  18. RC-1290

    RC-1290

    Member

    Joined:
    Jul 2, 2012
    Messages:
    585
    Yeah, cutting content is painful :(. I think you'll see that has happened with other entries as well. Experimental products not being completely predictable and all that ;)
    Still, interesting to see you casually implementing Voxel Cone Traced Indirect Lighting in 3 days ^_^.
     
  19. mlacay

    mlacay

    Member

    Joined:
    Apr 9, 2010
    Messages:
    3
    Very cool! :-}
     
  20. oks2024

    oks2024

    New Member

    Joined:
    Oct 10, 2012
    Messages:
    1
    Amazing !

    I'd love to see some implementation details.
     
  21. 511

    511

    New Member

    Joined:
    Nov 18, 2012
    Messages:
    40
    Stupid question but where do I get this demo level? I have seen this level 1000 times but I still have no clue where I can get it :)
     
  22. Mauri

    Mauri

    Member

    Joined:
    Dec 9, 2010
    Messages:
    552
  23. kurtloeffler

    kurtloeffler

    Member

    Joined:
    Mar 26, 2009
    Messages:
    206
    Heres a standalone build:
    http://www.keenleveldesign.com/miscunity/voxelconetracing/builds/VoxelConeTracing01.zip

    Its definitely not as optimized as it could be.

    Here is some performance stats:
    Full res = 1639x922 (because thats what resolution I get when maximizing in editor)
    Half res = half that
    Video card = Nvidia GTX 660

    As a point of reference with everything turned off and no lights, only with additional post process (bloom, dof, AA etc.) I get about 150 fps at full res.

    With everything on at full res I get about 30-35 fps depending on number of shadow casting lights (mostly unrelated to the indirect lighting). At half res I get 100-200 fps.

    At full res without the GI (and SSAO which is part of the GI process) I get about 80 fps.

    The GI effect is applied at full screen resolution, and probably could/should be rendered at half or quarter screen resolution, which would obviously make it much faster. A lot of the shaders are not very optimized and have things in them that don't need to be there from doing various tests.


    I'm not sure. It would need a lot more work before its really usable in a game.

    I think the biggest issue was not being able to access 3d RenderTexture mipmaps. I ended up using separate RenderTextures for each mip level and accumulating them with multiple passes.

    Another thing was not being able to blit directly into 3d RenderTextures from pixel shaders. For projecting the lighting into the volume texture random read/write wouldn't work because the colors had to be accumulated additively so I used a geometry shader to render a triangle at the correct pixel. But since I couldn't write directly into the volume texture (I guess this is done by specifying a slice to render into normally) I created a flattened buffer for the volume and rendered into that and then transferred it to the actual volume with a compute shader.

    Yes in the standalone build after the cutscene plays there is a slider to change the specular/gloss level so you can make everything shiny.

    Right now there is just a single volume. The next step would be to use 3 cascaded volumes so you could use it with very large environments.

    Well not really casually :p. It was very rushed and can use a lot of optimization as I said above.
     
    Last edited: Jan 20, 2013
  24. gbxentertainment

    gbxentertainment

    New Member

    Joined:
    Jan 20, 2013
    Messages:
    2
    Nice work!

    So I imagine that you rasterized the scene (projected to voxel space) from 6 directions into 6 3D textures, then mip-mapped these textures using the new dx11 compute shader, and the final lighting pass done using deferred rendering to include the indirect lighting sampled from the 3D textures?

    Are the shadows cone traced as well? or are they Unity native soft shadows?

    You might be able to also implement a second bounce by revoxelizing the final scene and repeating the process.

    Are you using octrees as well?
     
  25. nipoco

    nipoco

    Member

    Joined:
    Sep 1, 2011
    Messages:
    1,563
    When this is 'rushed', what would this looks like if you take your time?

    I really hope this gets developed further. By Kurt, or by UT itself. This really something Unity games can benefit from.
     
  26. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Messages:
    11,342
    I think this is something UT should take a close look at integrating, particularly with some strong optimisation. It does seem to be a killer feature.
     
  27. rea

    rea

    Member

    Joined:
    Oct 10, 2009
    Messages:
    981
    +1 on this, or maybe UT can Hire Kurt to Integrate this in Unity
     
    Last edited: Jan 21, 2013
  28. I am da bawss

    I am da bawss

    Member

    Joined:
    Jun 2, 2011
    Messages:
    2,367
    Totally agree. GET KURT NOW! HIRE (or KIDNAP) HIM OR WHATEVER! Since UT's own team couldn't even pull it off with their own pathetic attempt at Ninja Camp! (I am looking at you Kuba, Robert and Rej... hang your heads in shame!) :D
     
    Last edited: Jan 21, 2013
  29. bngames

    bngames

    Member

    Joined:
    Jul 3, 2012
    Messages:
    52
    +1 on this, Hire Kurt to Integrate this in Unity or UT just do it!
     
  30. kenshin

    kenshin

    Member

    Joined:
    Apr 21, 2010
    Messages:
    689
  31. Metakid

    Metakid

    New Member

    Joined:
    Nov 24, 2012
    Messages:
    36
    +1, pretty much everybody wants this thing working yesterday.
     
  32. RC-1290

    RC-1290

    Member

    Joined:
    Jul 2, 2012
    Messages:
    585
    January the second, actually ;)
     
  33. rea

    rea

    Member

    Joined:
    Oct 10, 2009
    Messages:
    981
    UT guys you're reading all of those request right??right??right?? :D
     
  34. ZJP

    ZJP

    Member

    Joined:
    Jan 22, 2010
    Messages:
    1,671
    This...
     
  35. nipoco

    nipoco

    Member

    Joined:
    Sep 1, 2011
    Messages:
    1,563
  36. Julian89

    Julian89

    New Member

    Joined:
    Jan 21, 2013
    Messages:
    2
    This gets my votes. Very nice implementation. If it could be done in a scalable way it would be a great option for games as long as the player has decent hardware.

    I'd pay for something of this quality if it was on the asset store for sure.
     
  37. ilu29

    ilu29

    New Member

    Joined:
    Jan 21, 2013
    Messages:
    4
    can you upload the source code? I dont want to use it in my project, just want to know how you implemented it.
     
  38. ronan.thibaudau

    ronan.thibaudau

    Member

    Joined:
    Jun 29, 2012
    Messages:
    1,734
    Add me to the list of those who want to see this in the asset store, even at a high price point (500$ + if well optimized).
    Also please contact me if you're making a beta! :)
     
  39. p v loon

    p v loon

    Member

    Joined:
    Oct 5, 2011
    Messages:
    418
    I'm looking forward to seeing this tool being developed! It's already looking great :)

    Great as it is, I do see some issues in the current version: I see some artifacts in the demo, I'm intrested to know what's happening there. Also, I'm intrested in regard as to what you did to integrate this with unity? Questions like: How does this integrate with unity? Does it support directional lights? Do we have to modify all our scenes to make this work? Is there a proper fallback?

    You've already adressed some of these questions yourself though, so I'm sure it's going to be great!
     
    Last edited: Jan 23, 2013
  40. Chaoss

    Chaoss

    Member

    Joined:
    Jul 8, 2011
    Messages:
    327
    You should optimize it and sell it on the asset store, I know I'd get it
     
  41. techmage

    techmage

    Member

    Joined:
    Oct 31, 2009
    Messages:
    1,899
    I think this is perfectly appropriate here.

    [​IMG]

    Pretty much have an instant, marketable use for this if it were implemented. Even if the performance was poor. (Not for a game, but for a serious game application)
     
  42. DanteDetlev

    DanteDetlev

    New Member

    Joined:
    Sep 20, 2012
    Messages:
    8
    Hi,
    I downloaded the executable and tried to run it in order to see the beauty. Regretfully all I and a colleague got was a black screen...
    I presume it is the videocard of our labtops that doesn't want to coorporate?

    Initialize engine version: 4.0.0f7
    GfxDevice: creating device client; threaded=1
    Direct3D:
    Version: Direct3D 11.0 [level 10.0 TODO.dll]
    Renderer: NVIDIA Quadro FX 2800M
    Vendor: NVIDIA
    VRAM: 1005 MB
    Begin MonoManager ReloadAssembly
    [...]
    D3D shader create error for shader vs_5_0
    [...]
    Unsupported: Custom/ShadowBufferBlur
    D3D shader create error for shader vs_5_0
    [..]

    any thought?
     
  43. 3agle

    3agle

    Member

    Joined:
    Jul 9, 2012
    Messages:
    188

    Your GPU does not support Shader Model 5
     
  44. virror

    virror

    Member

    Joined:
    Feb 3, 2012
    Messages:
    1,863
    This seems to run pretty smooth on my 560GTX card, but hard to know without any way of watching the fps, maybe you can add a fps counter? Also, a way to shut it down is always a good idea as well ; )
     
  45. Wolfos

    Wolfos

    Member

    Joined:
    Mar 17, 2011
    Messages:
    657
    Performance is pretty balls on my mid-end GeForce 650M (around 12FPS on 1920x1080 I think). How much do you think you can optimise this? Would a lower quality (lower resolution, less bounces) version make a huge difference?
     
  46. Fishypants

    Fishypants

    Member

    Joined:
    Jan 25, 2009
    Messages:
    367
    Damn Unity, you getting crazy!

    In all seriousness, this is impressively bad ass! Great job man!
     
  47. Neptune_Imaging

    Neptune_Imaging

    Member

    Joined:
    Jan 5, 2010
    Messages:
    2,706
    This is FREAKING AWESOME... and this would serve as a compliment to Beast, which I use very often... I would DEFINITELY pay for something like this... :)
     
  48. illinar

    illinar

    Member

    Joined:
    Apr 6, 2011
    Messages:
    89
    I hope UT implementation of this technology will look as Epic as this:





    And yes GO AND VOTE!
     
  49. SteveB

    SteveB

    Member

    Joined:
    Jan 17, 2009
    Messages:
    1,007
    ^icwutudidthar :D
     
  50. wrstscrnnm6

    wrstscrnnm6

    Member

    Joined:
    Jan 31, 2011
    Messages:
    8
    Congrats man. Looks really great.