Search Unity

Nvidia Blast

Discussion in 'General Discussion' started by bocs, May 24, 2017.

Thread Status:
Not open for further replies.
  1. bocs

    bocs

    Joined:
    May 9, 2009
    Posts:
    413
    I don't see any other topic on this, just curious if anyone has messed with it?
    https://developer.nvidia.com/blast-10

    They do have a Unity intergration on github, which seems to work..open it in 5.5+
     
  2. kelfire

    kelfire

    Joined:
    Mar 9, 2017
    Posts:
    9
    that looks pretty cool. Can you make a youtube video showing it off?
     
    Martin_H likes this.
  3. bocs

    bocs

    Joined:
    May 9, 2009
    Posts:
    413
    Sure, The unity sample is just cubes, so I also recorded the SDK sample

     
    Last edited: May 25, 2017
  4. Schneider21

    Schneider21

    Joined:
    Feb 6, 2014
    Posts:
    3,512
    I like the way this looks compared to most dynamic destructible assets I've seen. But it all seems like sorcery to me... Does this work on non-nVidia GPUs? Does it require latest DX or anything?
     
    RavenOfCode likes this.
  5. kelfire

    kelfire

    Joined:
    Mar 9, 2017
    Posts:
    9
    Blast looks really impressive, how many ms does it take for that Unity demo? Anything less than 2-3 ms is a completely usable in a video games.
     
    neoshaman likes this.
  6. bocs

    bocs

    Joined:
    May 9, 2009
    Posts:
    413
    afaik, it doesn't use the GPU or DirectX, blast just handles the sim of parts breaking...it's upto the app to use w/e physics and rendering engine.

    The nvidia page has alot of timing info. any bottle neck would be from physx or rendering. the cube demo is too basic to judge real world performance.
     
  7. kelfire

    kelfire

    Joined:
    Mar 9, 2017
    Posts:
    9
    So Nvidia Blast is APEX Destruction 2.0, I was mistaking it as the PhysX GRB (GPU physic simulation) available in Physx 3.4.
     
  8. enzoravo

    enzoravo

    Joined:
    Jun 25, 2013
    Posts:
    284
    looks very nice, where i can get the unity3d files from the nvidia blast ? i tried to search on google, but didn't found them.
     
  9. bocs

    bocs

    Joined:
    May 9, 2009
    Posts:
    413
  10. enzoravo

    enzoravo

    Joined:
    Jun 25, 2013
    Posts:
    284
  11. tuskake

    tuskake

    Joined:
    Mar 5, 2013
    Posts:
    26
    I'm in the process of developing Unity wrapper and asset for the Blast, stay tuned!
     
    elbows, zyzyx and Martin_H like this.
  12. bocs

    bocs

    Joined:
    May 9, 2009
    Posts:
    413
    I've also been messing with making a wrapper for it.

    They have a external tool to fracture the meshes (.obj/.fbx)...
    I converted the code to a plugin to work directly with unity meshes.

    Still early stuff, but I can now create the fracture meshes inside unity.

    example: cube cut into 25 chunks
    *warning: programmer interface :)
     
  13. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Impressive.
     
  14. Deleted User

    Deleted User

    Guest

    It was already in Unity for the butterfly demo, not a clue why it didn't get fully integrated..
     
  15. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    The usual answer is there's no one available to work on that particular aspect of the engine.
     
    Ryiah, jc_lvngstn and Deleted User like this.
  16. jc_lvngstn

    jc_lvngstn

    Joined:
    Jul 19, 2006
    Posts:
    1,508
    I thought they had like...1400 employees? If even half of those are engineers...and I hope it's mostly engineers....

    Heck, if they are running short, they could shuffle some from other areas.
    Like...the terrain update!
     
    neginfinity likes this.
  17. Player7

    Player7

    Joined:
    Oct 21, 2015
    Posts:
    1,533
    get through all the sign up .. find out the repository only supports win64x? is that right?.. disappointing.
     
  18. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    remind me of RS6
     
  19. tuskake

    tuskake

    Joined:
    Mar 5, 2013
    Posts:
    26
  20. Martin_H

    Martin_H

    Joined:
    Jul 11, 2015
    Posts:
    4,436
  21. tuskake

    tuskake

    Joined:
    Mar 5, 2013
    Posts:
    26
    Martin_H, I think this contains pretty good explanation of the system: https://developer.nvidia.com/blast-10

    Meshes can be cut in realtime, but fracturing takes about 50ms - 5000ms so it's semi-realtime.
    So the fracturing should be done in-editor for maximum performance gain, but it can also be done during scene loading or async during gameplay.

    Blast toolkit seems to handle massive scenes quite nicely, but if there are lots of rigidbody chunks moving around, the physx physics itself can get quite costly.

    First version contains support for in-editor and semi-realtime fracturing, slicing and cutting.
    After the fracturing is done in the Fracture editor, the fractured model can be examined and the generated chunks and bonds can be examined or modified.

    Damage shaders, hierarchial fracturing, stress solver and joints is something that I will be adding in the future.
     
  22. Martin_H

    Martin_H

    Joined:
    Jul 11, 2015
    Posts:
    4,436
    Thanks for the info, that sounds promising! I'll be keeping an eye on this thread. I'm not sure I have the performance budget to really go wild with this, but I could imagine putting it on a few hero assets that would benefit the most from it.
     
  23. AlanGameDev

    AlanGameDev

    Joined:
    Jun 30, 2012
    Posts:
    437
    That's incorrect, it's available on Win/Lin/PS4/One and even ships scripts to generate solutions for both 32 and 64 bit architectures. Did you check the source folder?
    Are you pinvoking it? If so, are you marshalling collections or something? 5000ms is way too much, I'm procedurally fracturing massive structures and it never goes >750µs even on a quite modest testing rig. Besides that make sure you're not on debug builds and such.
    How are you planning to implement the stress solver (ExtStressSolver) and the other PhysX extensions? Unless you're talking about doing that in the native side (you'd need the source license) you'd have to sync the data independently piping everything through your managed code and basically recreating ExtSync, which is certainly going to be a major pain in the rear and is definitely not going to perform decently.
     
  24. AntonioModer

    AntonioModer

    Joined:
    Jul 29, 2014
    Posts:
    65
  25. Deleted User

    Deleted User

    Guest

    Hi there. May I ask? What's the name of the external tool to fracture the meshes? Thanks.
     
  26. bocs

    bocs

    Joined:
    May 9, 2009
    Posts:
    413
    not sure the name, but it was a command line tool included.
    sorry, been almost a year since I messed with it, so don't remember exactly.
     
    Deleted User likes this.
  27. Deleted User

    Deleted User

    Guest

    oh okay, thank you =) And yeah, sorry for the necro posting.
     
  28. Deleted User

    Deleted User

    Guest

    It's me again. Sorry for being annoying, but do you still have the plugin from your screenshot? Or at least what did you use as reference fracture system in order to fracture the mesh? Thanks.
     
  29. bocs

    bocs

    Joined:
    May 9, 2009
    Posts:
    413
    I can post the project with a compiled .dll...
    *but it is very limited, and just a quick test I made

    BUT...

    I don't think I can post the source of the .dll since it's 99% nvidia's code and the EULA only allows compiled versions.
    this is the interface code I made, so you can see how limited it currently is (lot's of hard coded stuff):
    https://pastebin.com/nE90fagU

    *if you don't code C++, even more useless :)
     
  30. Deleted User

    Deleted User

    Guest

    Thank you so much. I will try to understand it. I appreciate your help.
     
  31. bocs

    bocs

    Joined:
    May 9, 2009
    Posts:
    413
    ok...this is all the support i'll give on this:
    *windows 64bit only

    1. create new project
    2. import FractureTest.unitypackage
    3. add primitive to scene (sphere, box etc..)
    4. click menu Fracture->Test
    5. drag primitive object to editor window
    6. click fracture

    download here:
    http://bocs.site/files/FractureTest.unitypackage
     
    mgear and Deleted User like this.
  32. Deleted User

    Deleted User

    Guest

    you are amazing! Works like a charm.
     
  33. Deleted User

    Deleted User

    Guest

    Hi there. Sorry for constant quoting your posts. You're the only one person who knows about blast. May I ask a question? I've generated a fragmented mesh by using cmd AuthoringTool, and got 2 files. .blast and the actual fragmented mesh .fbx, May I ask, how do I use it in unity? Is there any pattern or particular way, because I didn't get how it works in the demo. Btw, It works fine in NVIDIA SampleAssetViewer.




     
  34. bocs

    bocs

    Joined:
    May 9, 2009
    Posts:
    413
    really no clue, I never got that far :) you are at the point I moved on.
     
    Deleted User likes this.
  35. bocs

    bocs

    Joined:
    May 9, 2009
    Posts:
    413
    @wobes

    So you got me interested in this again since tuskake never released anything.

    This is what i've found so far today:

    1. If you want to compile with VS 2017, you can do some small mods
    *edit \BuildTools\cmake_projects_vc14win64.bat -> change line 30 to have "Visual Studio 15"
    *this will make the .sln (but all folders still say "vc14"..too much work to change all those)

    *3 projects will not build (AuthoringTool, PerTests, UnitTests)
    *you have to change some properties in each of them to in "C/C++ All Options" Treat Warnings as Erros to NO or /WX-
    everything will compile now


    2. Unity Example

    *it uses 2 .dll's they don't include the source code
    *NvBlastExtCommon, and NvBlastExtUtils

    using the updated Blast .dlls
    the wrapper is using old names...like
    NvBlastAssetCreateRequiredScratch -> new NvBlastGetRequiredScratchForCreateAsset
    NvBlastAssetCreate -> NvBlastCreateAsset

    So with the missing code, and outdated wrapper...
    it's going to take alot of work to update

    3. TL;DR;

    The "Unity" example only uses the core API, no wrapper for the higher level "Toolkit"
    So outdated the imported functions don't match never versions
    only supplied "debug" versions in the example which will be alot slower
    I think to load .blast files you will need to wrap NvBlastExtSerialization (which they don't do in the example)

    I'm going to play with it some more, but using it AS-IS...just stop
     
  36. Deleted User

    Deleted User

    Guest


    Thank you so much for your research, it is really helpful. Sad that there is zero support for unity from Nvidia.
     
  37. bocs

    bocs

    Joined:
    May 9, 2009
    Posts:
    413
    I've been working on wrapping the NvBlastExtAuthoring classes.

    I wrapped the NvMesh,NvMeshCleaner,NvFractureTool,NvVoronoiSitesGenerator

    This let make a simple Unity Editor:

    Example: 3 variations of slicing, and 1 of Voronoi


    let me clean up some things, and I'll release full source for this.
     
  38. Deleted User

    Deleted User

    Guest

    Wow, well done!
     
  39. bocs

    bocs

    Joined:
    May 9, 2009
    Posts:
    413
  40. Deleted User

    Deleted User

    Guest

    Well done! Thank you for your contribution. Quick question.

    Does Nvidia license allows to sell their sources as an asset? And by the way, did you apply any shader for the pieces?
     
  41. bocs

    bocs

    Joined:
    May 9, 2009
    Posts:
    413
    My understanding, source code = no...compiled binary = yes. (obviously could be wrong)

    standard shader, just dragged a texture on the objects.
     
    Deleted User likes this.
  42. bocs

    bocs

    Joined:
    May 9, 2009
    Posts:
    413
    Updated it some...I'd make a WIP thread, but don't know how many more updates i'll make to this.

    Added: Clustered Fracture
    Added: Inside Materials
    Changed: GUI recoded to look cleaner

    Download Unity Package + C++ Source code:
    http://bocs.site/files/nvBlast_v0.2.zip

     
    Last edited: Apr 12, 2018
  43. bocs

    bocs

    Joined:
    May 9, 2009
    Posts:
    413
    Edit: Updated download link v0.3a - v0.3 had a serious bug

    ok, so 1 more update :)
    I want this to be useful and show how this can be used even without a "complete blast wrapper"

    started with a few lines of code, then I couldn't help myself....
    Added: Editor tool gets object from selected (filtered)
    Added: Rigidbody, Colliders to chunks
    Added: Skinned Meshes supported
    Added: Fracture Skinned Mesh - creates slice points from bones (mesh needs to be 0,0,0...too much funky math)
    Added: Create Prefabs - saves generated meshes to assests.
    Added: Simple Destructible script
    Added: stuff I can't remember...so tired :)

    Download Unity Package + C++ Source:
    http://bocs.site/files/nvBlast_v0.3a.zip

    Here is a video, I know it's boring...but try to watch it all.
     
    Last edited: Apr 13, 2018
    bb8_1, thelebaron, rz_0lento and 6 others like this.
  44. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Someone feel like throwing it up on github (preferably an active account) ? looks like the birth of an excellent community driven fracture package. Thanks @bocs
     
    NeatWolf likes this.
  45. Deleted User

    Deleted User

    Guest

    You are insane (In a good way :)), amazing work. Thanks for the sharing.
     
  46. Player7

    Player7

    Joined:
    Oct 21, 2015
    Posts:
    1,533
    Yeh thanks for doing that wrapper @bocs .. checked out the v0.2 and think I'll have a use for it. v0.03a little slower.. all the collider meshes being added?

    One thing Unity are going to need to do something about notifing end users about packages that are using materials setup for the old shader pipeline, just saw purple shaders on import until I realized they weren't using the Lightweight pipeline ones.
     
  47. bocs

    bocs

    Joined:
    May 9, 2009
    Posts:
    413
  48. bocs

    bocs

    Joined:
    May 9, 2009
    Posts:
    413
  49. OGUZCANSOYSELCUK

    OGUZCANSOYSELCUK

    Joined:
    Nov 11, 2016
    Posts:
    2
    Congratulations on a job well done bocs, and thank you for your amazing effort to get this done and thank you even more for sharing it!

    I've made some changes to the toolset you provided along with the wrapper, let me go over those changes real quick.

    Ability to merge inside and outside submeshes to a single mesh to save on draw calls at the expense of using the same material on both, by toggling that "Use Same Material" checkbox:


    Slightly edited the code to recalculate meshes to fix their pivots.


    Ability to calculate a footprint for buildings to preserve level layout and AI Pathfinding Mesh using the same tools:


    This is how to tool looks like when you put a fractured gameobject in a scene into "Source":


    When you click "Select Objects" the code automaticly selects every chunk whose position.y is less than the threshold value we define on the tool:


    Once you have more than 1 object selected, the tool changes to this:


    This is after I manually deselected some chunks because they were good chunks:


    And this is the final result when you combine them:


    Those chunks have been auto hidden, their meshes combined into a new gameobject with a mesh collider attached, rigidbody not attached because we don't want to footprint to move, and the new mesh saved into the project, and our prefab in the assets folder updated. Everything Dandy and good.

    The motivation behind this footprint feature was to preserve level layout and AI Mesh for whatever that might be lurking in your levels. It also gives you more to play with in terms of rigidbodies and drawcalls, so you can make the chunks above the footprint smaller etc.

    I'll share the changes once I make sure there are no hiccups.
     
  50. Robbert1

    Robbert1

    Joined:
    Oct 12, 2017
    Posts:
    2
    @OGUZCANSOYSELCUK, @bocs great job.

    The ability to merge submeshes to a single mesh and the footprint changes look great. Could you share the code?

    Thanks
     
Thread Status:
Not open for further replies.