Search Unity

VertexDirt - Per vertex Ambient Occlusion baking [WIP]

Discussion in 'Works In Progress - Archive' started by ZFarago, Jun 2, 2013.

  1. ZFarago

    ZFarago

    Joined:
    Aug 13, 2012
    Posts:
    154
    Hi!

    This is my fun work at home.
    The basic idea was to develop a small extension enable to calculate some kind of AO to vertex color data.

    Asset Store Link
    PDF Overview
    Sample Video: Spheres

    Please read the latest posts to get up to date.

    Here are some screenies,
    $shot01.jpg

    $shot04.jpg

    $shot05.jpg
     
    Last edited: Aug 18, 2015
    Farelle, GibTreaty and pottering like this.
  2. FlaxSycle

    FlaxSycle

    Joined:
    Oct 6, 2012
    Posts:
    232
    9.3 seconds in Chrome on my alienware x11 r2 (Intel i7)

    I am very interested in this approach, although couldn't figure out a way to move the camera in the webplayer, and would also be interested to see the poly density of the scene.
     
  3. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,318
    4.1 seconds on my Mac (2.8GHz old-ish Xeon of some kind) using Safari.

    --Eric
     
  4. Thomas-Pasieka

    Thomas-Pasieka

    Moderator

    Joined:
    Sep 19, 2005
    Posts:
    2,122
    3.8 seconds on a Mac mini. What I am wondering, will one be able to set the AO distance/density etc?
     
  5. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    28,174
    3.8 on my mac mini too. I wonder why one of the above poster's i7 is performing so badly?
     
  6. pspdude

    pspdude

    Joined:
    Dec 17, 2011
    Posts:
    43
    16 seconds on an AMD Athlon - 2.4 ghz and Nvidia GeForce 6150 SE.
     
  7. Eriks-indesign

    Eriks-indesign

    Joined:
    Aug 15, 2012
    Posts:
    50
    1.237 seconds on a "NVIDIA GeForce GT 650M" - 2.6 GHz i7 - 16gb DDR3 ----- Macbook pro retina / Mac os x 10.8.3 / Safai
     
  8. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    7,204
    ~5.0 - 5.3secs (i7 3.4ghz, gtx580, ie ff)
     
  9. ZFarago

    ZFarago

    Joined:
    Aug 13, 2012
    Posts:
    154
    Thanks to everybody for testing! Macs are quite fast as I see...

    FlaxSycle: Thanks for the interest, sadly you cannot look around this demo, this is only written for speed testing purpose. I uploaded a new shot to show the vertex density. $shot07.jpg

    Thomas Pasieka: exactly theese two parameters needed for setup, thanks for asking!
     
  10. ZJP

    ZJP

    Joined:
    Jan 22, 2010
    Posts:
    2,649
    7.5s
    Firefox, Windows 7 32B, C2Q Q8300 @3.0Ghz, Radeon HD7850

    Edit :
    Same with Chrome
     
    Last edited: Jun 3, 2013
  11. QuantumCD

    QuantumCD

    Joined:
    Dec 15, 2012
    Posts:
    10
    Are you still working on this script? I'd love to see a fast way to bake AO in Unity.
     
  12. ZFarago

    ZFarago

    Joined:
    Aug 13, 2012
    Posts:
    154
    Hi!

    Actually its develop is still alive, but currently I have some other work to do with higher priorities.
    But thanks for asking, Im going to finish it (or at least publish a useable version) soon!
     
  13. SilentDeveloper

    SilentDeveloper

    Joined:
    Jun 5, 2013
    Posts:
    29
    Higher end PCs seem to bake slower than macbooks, humm... Anyways, my stats:

    5.81 seconds @ i7 950 3.06ghz, 770gtx oc, 12gb triple channel using chrome
     
  14. gonzorob

    gonzorob

    Joined:
    Dec 1, 2011
    Posts:
    96
    Hello,

    Just about to write something like this, will hold back if you're anywhere near completion? :)
     
  15. gryff

    gryff

    Joined:
    Apr 17, 2012
    Posts:
    360
    I had four attempts 5.9, 6.1, 5.9, 5.9 secs in Firefox with Blender and Gimp open at the sametime.

    Win XP, I5 @2.6 ghz (first gen), 4GB RAM, NVidia 650 with 2GB RAM.

    cheers, gryff :)
     
  16. dogzerx2

    dogzerx2

    Joined:
    Dec 27, 2009
    Posts:
    3,891
    i7 920 @ 2.67GHz

     
  17. MrProfessorTroll

    MrProfessorTroll

    Joined:
    Sep 1, 2013
    Posts:
    383
    5.3 seconds - 3rd gen intel i7 2.3 - 3.2 ghz, gtx 670m 3gb, 16 gb ram.
     
  18. MickM

    MickM

    Joined:
    Nov 19, 2012
    Posts:
    166
    4.53 - Intel core i5 3570K 3.4ghz, Win 64 bit, 8GB RAM, Titan
     
  19. ZFarago

    ZFarago

    Joined:
    Aug 13, 2012
    Posts:
    154
    Hi!

    The development at in its final stage, works quite well, but i'm still not satisfied with the results of AO calculation in certain circumstances.
    I made some changes, it is not a component anymore but a tool.

    As I see now, I will release VertexDirt until the end of the year, with the current features at a low price or maybe for free.
    And for the future, I have some good ideas for v2.0, but that will be a next year plan :)
     
  20. blaize

    blaize

    Joined:
    Jul 25, 2012
    Posts:
    41
    3,6 sec.
    OSX 10.8.5
    2,3 GHZ i5
    Inter HD-Video 3000 512 MB
    8GB 1333 DDR3
     
  21. ZFarago

    ZFarago

    Joined:
    Aug 13, 2012
    Posts:
    154
    Hi guys,

    I have some bad news. As you may already found, I didnt have enough time to finish VertexDirt last year.
    I had ran into different kind of troubles during the development. Right now, I managing other projects, but I will continue VertexDirt developing ASAP.

    Sorry about that,
     
  22. JamesArndt

    JamesArndt

    Unity Technologies

    Joined:
    Dec 1, 2009
    Posts:
    2,877
    This looks really cool! The same thing can be done in 3ds Max and Maya with pre-lighting. Basically bake all of the shadows and lighting into vertex colors. It's nice to see this working in Unity though, pain in the butt tweaking vertex color AO in the 3d application.
     
  23. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    28,174
    I think it's weird that macs with i5s are faster than i7's. Either it's just mac OS being faster, or people build / buy pcs which are really kind of S***ty made.
     
  24. chelnok

    chelnok

    Joined:
    Jul 2, 2012
    Posts:
    675
    3.2 s

    firefox
    iMac
    Processor 2.7 GHz Intel Core i5
    Graphics NVIDIA GeForce GT 640M 512 MB

    Software OS X 10.8.5 (12F45)
     
  25. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    7,204
    today its 4.8secs

    Unity Plugin version: 4.3.3f1
     
  26. ZFarago

    ZFarago

    Joined:
    Aug 13, 2012
    Posts:
    154
    Brand new approach :)
    $new_ao.jpg
     
  27. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    Looks neat :)
    How was it done, how does it work differently than before?
     
    ZFarago likes this.
  28. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,318
    Compared to last year, the demo now gets 3.4 seconds here instead of 4.1 seconds, same machine but OS X 10.9 now instead of 10.6. So it seems OS X got some noticeable speed improvements in this area at some point after 10.6 (unless of course the demo was improved).

    --Eric
     
  29. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    Ah so this is just a reuse of the old? Good to know :)

    That OSX might indeed have speed up this much (especially the gpu driver side) given Apples ignorance on this end until 10.8 and their relyance on good driver performance in 10.9+ with the new nap capabilities.
     
  30. ZFarago

    ZFarago

    Joined:
    Aug 13, 2012
    Posts:
    154
    The demo the same now, so thanks to Apple that you measured better times :)

    The old version unfortunately can not handle well some situations. But this new one have really good benefits.

    Dreamora: well, the idea came from the one implemented in Wings3D. A hemicube sample rendered in every pixels over there. Fast, accurate, and the scene's comlexity does not affect the rendering time - it is only depends on the subject meshes' vertex count.

    In VertexDirt, the calculating is quite the same, and work with both versions of Unity, with ~4000vertex / sec speed in a i7-4770. If you wish, I may upload a new demo for testing.

    For now, I drawing the UI, writing shaders, arranging sample scenes record videos and stuff like this.
    The codeing part for calculating vertex colors are done for Ambient Occlusion / Indirect lighting (color bleeding) / Mesh thickness (for Sub surface scattering) / Ambient Cube baking.

    Zoltan.
     
  31. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    I'd love to have another go! Want to see how my old workhorse fares after near 3 years in service (And still kicking next gen's arse)
     
  32. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    Good old Wings3D. Has so many nice powertricks that other tools completely lack (Cinema4D can not even write Vertex Colors for example). Its sad that neither Wings3D nor Milkshape really made use of the opportunity it had when it was ahead of many options for game modelling.

    You don't happen to be interested in someone pumping this through a potentially 'evil' setup with 6 and 7 figures of vertices where I can not reasonably use texture baked AO and can neither use PostProcessing (as we have 8 cameras next to each other to achieve a very high FoV without fisheye distortion)?
     
  33. ZFarago

    ZFarago

    Joined:
    Aug 13, 2012
    Posts:
    154
    We can talk about that, sample scenes are never enough.
    Currently, my hardest sample environment is an almost completely closed room with some boxes mounted on the walls, and there is giraffe in it too.
     
    Last edited: Jun 18, 2014
  34. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    Hard to compete with that, a poor giraffe in a closed room ;)

    Our scene would be significantly more complex (we are currently experimenting with
    as a solution), but I can not share any more related to it as it is a heavily NDA covered project unluckily.
     
  35. ZFarago

    ZFarago

    Joined:
    Aug 13, 2012
    Posts:
    154
    Ohh, I know this solution, I ran into this last year, when I have started VertexDirt. :)
    As I remembering, the results were nice, but terrified about raycasting and collider need.
    I will make a bake from theese boxes GMT afternoon.

    I understand that you may not want to share your project, but I can make some test-cases follows a specs you provide, or you may just boxing out some hard-to-AO-models yourself.
     
  36. ZFarago

    ZFarago

    Joined:
    Aug 13, 2012
    Posts:
    154
    Here it is,
    testcase1.jpg
     
  37. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    I don't consider the majority of the models to be hard to AO, not the least bit. But there is quality and 'quality' and I'm as every dev hoping to find the 'holier grail' ;)

    Your results look quite nice, thought it seems that the boxes have much higher detail than their outlines, is that correct? (comparable to the mid quality from the original if not higher subdivision).
    In either case I like the look and if it works with a single pass it sems to work great and I guess definitely faster than the 'trivial ray approach' too :)
     
  38. ZFarago

    ZFarago

    Joined:
    Aug 13, 2012
    Posts:
    154
    Thanks,

    Yes, it was the "CubeMassMedres" object from the sample. This one is subdivided with hard edges yes, but I left the geometry untoched, no additional subdivision added.

    However, not quite sure what you mean under single pass, but I guess my answer is yes :)
     
  39. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    With single pass I meant: Does the result look like this by just executing the calculation once? Or does it converge towards the best result over multiple baking steps.
     
  40. ZFarago

    ZFarago

    Joined:
    Aug 13, 2012
    Posts:
    154
    Ok. I guessed you meant something like this, and yes, single pass.

    You may only going to use it for Ao baking only, or interested in other features?
     
  41. ZFarago

    ZFarago

    Joined:
    Aug 13, 2012
    Posts:
    154
    Some new information so far,

    - I am unable to write a window interface what can handle any possibilities of VD and paired with easy handling.
    So there will be preset utility windows for the main features (AO, Indirect lighting, ambient cube, thickness and so on)
    - to access every aspect of VertexDirt, there will be a balnk template provided for sandboxing.
    - I am planniing a color-packing feature what able to compress 4 RGB colors to the vertex color. Actually this feature is already done. To access theese colors, sample shaders will be provided. I think it is useful for Unity Free because the lack of Light probes.
    - Full source code will be included. VertexDirt itself is one static class with some static variables and the functions for baking. It will be documentet through Natural docs.

    Sample screenies.
    vd_new_01.jpg vd_new_02.jpg vd_new_03.jpg
     
  42. ZFarago

    ZFarago

    Joined:
    Aug 13, 2012
    Posts:
    154
    progress so far:

    code almost ready to publish, all of them commented well, and in a naturaldocs compatible way.
    Almost every features for the first public version are ready.
    I think I can start to model some complex demo scenes for it in the next couple of days.
    Some planned features will slide to the next release, but most of them taken account during the coding.
    I have checked the asset store and places for similar materials to get idea of the price.

    There will be a free version, maybe called 'VertexDirt Lite', equipped only with a quickdirt function. This is something that useful and lightweight enough for quick short projects.

    And also of course there will be the standard full version of VertexDirt. I hope you will like it :)
     
  43. ZappForThat

    ZappForThat

    Joined:
    Aug 3, 2013
    Posts:
    3
    Any estimates on a release date? I love the work you're doing and haven been silently following this thread for a while. I'm hoping to use this on an indie game that I'm working on and would love to know when it'll be available.

    Again great job ZFargo!
     
  44. ZFarago

    ZFarago

    Joined:
    Aug 13, 2012
    Posts:
    154
    Hi,

    Actually Im on vacation, and be back on tomorrow. Im happy to hear that someone want to use my plugin. :) I think a few more days need to finish and after maybe a week or two for asset store validation.
     
  45. macdude2

    macdude2

    Joined:
    Sep 22, 2010
    Posts:
    685
    Sweet, can say I am most definitely looking forward to it as well.
     
  46. TrentSterling

    TrentSterling

    Joined:
    Jan 4, 2013
    Posts:
    83
    Looking forward to this. Free users need better ambient occlusion options. This is an interesting way to do it.
     
  47. ZFarago

    ZFarago

    Joined:
    Aug 13, 2012
    Posts:
    154
    I am glad to hear about you guys, thanks.
    TrentSterling: may be you can check my other plugin, ZF Skylight, as is extends the functionality of AO baking under beast in Unity Free.
     
  48. ZFarago

    ZFarago

    Joined:
    Aug 13, 2012
    Posts:
    154
    VertexDirt Alpha is submitted to the Asset Store :) A week, or maybe two and you can try it :)
     
  49. ZFarago

    ZFarago

    Joined:
    Aug 13, 2012
    Posts:
    154
    Spheres.
     
    pottering likes this.
  50. sjm-tech

    sjm-tech

    Joined:
    Sep 23, 2010
    Posts:
    714
    Awesome ZFarago!
     
unityunity