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

Voxel Cone Traced Lighting - DX11 Contest

Discussion in 'Made With Unity' started by CorruptScanline, Jan 19, 2013.

  1. CorruptScanline

    CorruptScanline

    Joined:
    Mar 26, 2009
    Posts:
    217
    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:






     
    Last edited: Jan 20, 2013
  2. FlorianSchmoldt

    FlorianSchmoldt

    Joined:
    Jul 2, 2012
    Posts:
    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. Deleted User

    Deleted User

    Guest

    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

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

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


     
    Last edited: Jan 19, 2013
  5. brilliantgames

    brilliantgames

    Joined:
    Jan 7, 2012
    Posts:
    1,937
    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

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

    nipoco

    Joined:
    Sep 1, 2011
    Posts:
    2,008
    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

    Unity Technologies

    Joined:
    Nov 7, 2005
    Posts:
    4,770
    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

    Joined:
    Dec 26, 2012
    Posts:
    39
    Looking so nice. Unity4 is pushing the limits.

    Any chance that you can share executable demo for this?
     
  10. pvloon

    pvloon

    Joined:
    Oct 5, 2011
    Posts:
    591
    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

    Joined:
    Apr 21, 2010
    Posts:
    940
  12. lilymontoute

    lilymontoute

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

    Looks amazing.
     
  13. elias_t

    elias_t

    Joined:
    Sep 17, 2010
    Posts:
    1,367
    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

    Joined:
    Jul 3, 2012
    Posts:
    67
    please please put it on the asset store.
     
  15. Deleted User

    Deleted User

    Guest

    Have you tried doing metallic specular on anything? I would like to see how blurry the reflections look. ;)
     
  16. Wolfos

    Wolfos

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

    Temporaro

    Joined:
    Dec 21, 2012
    Posts:
    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

    Joined:
    Jul 2, 2012
    Posts:
    639
    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

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

    oks2024

    Joined:
    Oct 10, 2012
    Posts:
    1
    Amazing !

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

    511

    Joined:
    Nov 18, 2012
    Posts:
    55
    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

    Joined:
    Dec 9, 2010
    Posts:
    2,662
  23. CorruptScanline

    CorruptScanline

    Joined:
    Mar 26, 2009
    Posts:
    217
    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

    Joined:
    Jan 20, 2013
    Posts:
    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

    Joined:
    Sep 1, 2011
    Posts:
    2,008
    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

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    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. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    +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

    Joined:
    Jun 2, 2011
    Posts:
    2,574
    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

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

    kenshin

    Joined:
    Apr 21, 2010
    Posts:
    940
  31. Metakid

    Metakid

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

    RC-1290

    Joined:
    Jul 2, 2012
    Posts:
    639
    January the second, actually ;)
     
  33. Reanimate_L

    Reanimate_L

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

    ZJP

    Joined:
    Jan 22, 2010
    Posts:
    2,649
    This...
     
  35. nipoco

    nipoco

    Joined:
    Sep 1, 2011
    Posts:
    2,008
  36. Julian89

    Julian89

    Joined:
    Jan 21, 2013
    Posts:
    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

    Joined:
    Jan 21, 2013
    Posts:
    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

    Joined:
    Jun 29, 2012
    Posts:
    1,722
    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. pvloon

    pvloon

    Joined:
    Oct 5, 2011
    Posts:
    591
    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

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

    techmage

    Joined:
    Oct 31, 2009
    Posts:
    2,133
    I think this is perfectly appropriate here.



    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

    Joined:
    Sep 20, 2012
    Posts:
    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

    Joined:
    Jul 9, 2012
    Posts:
    508

    Your GPU does not support Shader Model 5
     
  44. virror

    virror

    Joined:
    Feb 3, 2012
    Posts:
    2,963
    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

    Joined:
    Mar 17, 2011
    Posts:
    948
    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

    Joined:
    Jan 25, 2009
    Posts:
    444
    Damn Unity, you getting crazy!

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

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,458
    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

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





    And yes GO AND VOTE!
     
  49. SteveB

    SteveB

    Joined:
    Jan 17, 2009
    Posts:
    1,451
    ^icwutudidthar :D
     
  50. wrstscrnnm6

    wrstscrnnm6

    Joined:
    Jan 31, 2011
    Posts:
    20
    Congrats man. Looks really great.