Search Unity

  1. New Unity Live Help updates. Check them out here!

    Dismiss Notice

uFlex - NVidia FLEX for Unity3D - Unified Visual FX [RELEASED]

Discussion in 'Assets and Asset Store' started by korzen303, Apr 15, 2016.

  1. Buquet

    Buquet

    Joined:
    Aug 13, 2015
    Posts:
    11
    Why main ulex component significally load CPU, on empty scene? :(
     
  2. julien-conan

    julien-conan

    Joined:
    Jun 20, 2015
    Posts:
    5
    Good Flex integration I was looking for that a long time...
    But game window goes black when I activate Virtual Reality Support with Oculus Utilities, does anybody know what's happening ?
     
  3. pan-master

    pan-master

    Joined:
    Nov 11, 2013
    Posts:
    124
    is there any update to Nvidia uflex1.1?
     
  4. DJLICE

    DJLICE

    Joined:
    Apr 5, 2017
    Posts:
    2
    Hi !
    First: Nice Asset, love Playing around with the Demo Scenes.

    Im Currently on Unity 5.6.0f3, Asset Fresh Imported from the Store a few Hour ago.

    Now my Problem:
    When i try to open Tools->uFlex, nothing happens. (Got an Error first, because uFlex-Window wantet to get Random Values for Colors, and this is not allowed (anymore?), so i set some Static Values for now.)
    But even after Correcting this Error, the uFlex Window will simply not show up (no Error Message or Warning),
    the "uFlex Utility" Window works without any problems.

    Any Idea what could be wrong?
    Thanks & Best Regards!
     
  5. korzen303

    korzen303

    Joined:
    Oct 2, 2012
    Posts:
    175
    @real4ct Checked VR multiple times in both OpenVR and Oculus VR and worked fine (except SSF in single pass rendering)

    @pan-master It is in the making, except working on non-NVidia hardware using DirectCompute not much has changed.

    @DJLICE Seems like a problem with windows layout. uFlex window is probably displayed outside your screen. Click Layout in Unity's top right corner and Revert to Factory Settings. Let me know if that worked
     
    DJLICE likes this.
  6. DJLICE

    DJLICE

    Joined:
    Apr 5, 2017
    Posts:
    2
    @korzen303 Well damn me it worked, should have thought of that myself tho...
    Thank you !
     
    korzen303 likes this.
  7. julien-conan

    julien-conan

    Joined:
    Jun 20, 2015
    Posts:
    5
    @korzen303 Working fine on Oculus VR I confirm :) I'd like to have other documentation than NVIDIA C++ official doc, maybe include SSF Pro in the package, even if it's worth the price anyway. Perfect and considerable feat already ! Thank you !
     
  8. Nico20003

    Nico20003

    Joined:
    Apr 4, 2014
    Posts:
    31
    Is anyone having some wierd flickering with this asset and htc vive in unity 5.6??
     
  9. Martian-Games

    Martian-Games

    Joined:
    Jan 19, 2012
    Posts:
    39
    I notice Unity 5.6 hard-crashes on all related PhysX scenes if PhysX is not explicitly turned on in NVidia settings. Opening NVidia Control Panel, Selecting "Set PhysX Configuration" > [Your GPU] .. solves the problem. Curiously, on a new computer, the default is "CPU". LoL. What a world.
     
  10. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    6,484
    The uFlex editor window does not work. I'm using Unity 5.6f3.

    Tried debugging the FlexWindow script, couldn't seem to really get anywhere.

    edit//

    seemed to be something with setting the color variable during serialization. Also changed the init code a bit, not sure which change made it work.

    Code (csharp):
    1.  
    2.         public static FlexWindow FlexEditorWindow;
    3.         public static Rect WindowRect = new Rect(150, 150, 400, 400);
    4.  
    5.         [MenuItem("Tools/uFlex")]
    6.         public static void ShowWindows()
    7.         {
    8.             FlexSolver solver = FindObjectOfType<FlexSolver>();
    9.             if(solver == null)
    10.             {
    11.                 Debug.Log("No FlexSolver in scene. Creating a default one (Assets/uFlex/Prefabs/Flex.prefab)");
    12.                 GameObject prefab = AssetDatabase.LoadAssetAtPath<GameObject>("Assets/uFlex/Prefabs/Flex.prefab");
    13.        
    14.                 GameObject flex = GameObject.Instantiate(prefab);
    15.                 flex.name = "Flex";
    16.             }
    17.  
    18.             FlexEditorWindow = (FlexWindow)GetWindow(typeof(FlexWindow));
    19.             FlexEditorWindow.titleContent.text = "uFlex";
    20.             FlexEditorWindow.position = WindowRect;
    21.             FlexEditorWindow.Show();
    22.  
    23.             Debug.Log(FlexEditorWindow);
    24.         }
    Also, the scaling is a real issue. It's as if the plugin was designed around the idea everything being done at hugely upscaled sizes. All but one of the scenes use wildly overscaled particles that are impractical for the majority of uses of the plugin and the uFlex menu doesn't have any control for adjusting the particles scale at creation, then afterwards the created system cannot change its grid size. When I tried creating a 5x5x5 at 0.1 spacing and then change the particle rendered size to 0.1 then the simulation seems to break down and incorrectly spew particles in random directions.

    It would be a good idea to look into better scaling control and assume that users are using standard unit/scene scale instead of these massively overscaled systems. As is, a value of 1 (for a single particle) is like half a meter (for a single particle) which is a real struggle to understand and work with.
     
    Last edited: Apr 22, 2017
  11. tuskake

    tuskake

    Joined:
    Mar 5, 2013
    Posts:
    26
    Is it possible to have multiple fluids with different settings in the same scene?

    Like water and sand?
     
  12. korzen303

    korzen303

    Joined:
    Oct 2, 2012
    Posts:
    175
    At the moment Flex supports both fluids and granular materials in one scene, but not different fluids properties. So yes, you can have water and sand in one scene, but not water and, for example, some sticky goo.
     
  13. noxerr94

    noxerr94

    Joined:
    Apr 16, 2016
    Posts:
    4
    hi, I'm creating rigidbody uflex object with the window of the editor. I'm creating a chair, a ball, and lots of different items but, when I click on "Draw Debug" from Flex Particles script, I'm seeing that it shows an "sphere" collider which doesn't match the mesh at all. Even if the mesh is an sphere, the collider uflex creates is 10 times bigger. Is there any fast fix? or is it going to be fixed in the next update?
     
    Last edited: Apr 28, 2017
  14. nsgnn

    nsgnn

    Joined:
    Feb 21, 2017
    Posts:
    1
    I am having issues with uFlex recently. I have been crashing everytime I attempt to enter play mode or enable a flex component. The .dmp log shows this:
    Previously it was working in our project on 5.6. We have reimported the asset to see if that was the issue, and it did not help. Do you have any ideas as to what would cause this?
     
  15. Spettro22

    Spettro22

    Joined:
    Apr 22, 2016
    Posts:
    4
    Hi, i'm having the same problem of LaneFox,

    The uFlex editor window does not work. I'm using Unity 5.6f3.
    Has Someone already solve this problem??
    thank you in advance
     
  16. noxerr94

    noxerr94

    Joined:
    Apr 16, 2016
    Posts:
    4
    does not work means that it doesn't appear? I solved it with: window -> layout -> reset factory
     
  17. Spettro22

    Spettro22

    Joined:
    Apr 22, 2016
    Posts:
    4
    Thank you, it was a script problem;
    Do you know how to create the features of the water balloon seen in the example, but with a different shape?
    I have some problem because i don't know how to change the initial shape of the fuild, in the example is already spheric!
     
  18. sashahush

    sashahush

    Joined:
    Sep 5, 2012
    Posts:
    75
    Hi there, i have purchased this fine asset, fantastic work!
    I have a few questions i'd like to get more info on.

    - I wanted to know how can this apply to an animated skeleton mesh, any examples?
    - How do you constraint certain vertices of the mesh, how was the dragon constrained to the ground?
    - Can i move the constrained start and end points of the rope?
    Thank you!
     
  19. NoxNorthwind

    NoxNorthwind

    Joined:
    Jun 19, 2016
    Posts:
    2
    Heyho,

    is it possible to define points in the world which attract the objects? - Somehow like planets.
    Or in another way: Is it possible to change the velocity per "particle"? I can only imagine that this would have a huge impact on the performance due to the fetch to the cpu.
     
  20. korzen303

    korzen303

    Joined:
    Oct 2, 2012
    Posts:
    175
    sashahush likes this.
  21. sashahush

    sashahush

    Joined:
    Sep 5, 2012
    Posts:
    75
    I'm using Unity 5.6f3.
    Having the issue of the Flex Window not showing up, i've tried resetting the layout as suggested above but i still get this error:

    UnityException: get_value is not allowed to be called from a ScriptableObject constructor (or instance field initializer), call it in OnEnable instead. Called from ScriptableObject 'FlexWindow'.
    See "Script Serialization" page in the Unity Manual for further details.
    uFlex.FlexWindow..ctor () (at Assets/uFlex/Editor/FlexWindow.cs:74)
    UnityEditor.EditorWindow:GetWindow(Boolean, String, Boolean)
    uFlex.FlexWindow:ShowWindows() (at Assets/uFlex/Editor/FlexWindow.cs:929)
     
  22. korzen303

    korzen303

    Joined:
    Oct 2, 2012
    Posts:
    175
    Hi, there is a problem with uFlex window in Unity 5.6.
    T
    o fix it please double click the error log message in the console or go to line 74 in Editor/FlexWindow.cs and change the following code. Next, please reset Unity's layout (top right corner, Layout/Revert Factory Settings).

    Code (CSharp):
    1. Color color = new Color(UnityEngine.Random.value, UnityEngine.Random.value, UnityEngine.Random.value, 1.0f);

    to
    Code (CSharp):
    1. Color color = Color.gray;

     
    Last edited: May 9, 2017
    FernanUrodev, matseng and sashahush like this.
  23. sashahush

    sashahush

    Joined:
    Sep 5, 2012
    Posts:
    75
    Perfect thank you Korzen! Works like a charm now
     
  24. sashahush

    sashahush

    Joined:
    Sep 5, 2012
    Posts:
    75
    Thanks very much Korzen for the reply.
    "Just set their mass to 0 and then you can modify their position" - How do i do this exactly? Do i select the particles and create a new script which sets the mass to zero? or do i select them and change their mass in some property panel?
     
  25. stsword

    stsword

    Joined:
    May 4, 2017
    Posts:
    8
    HI
    I use uFlex to do a cloth simulation, a catwalk girl with tight dress.
    the motion is good and fit when the character is static, but the cloth will penetrate into the body collider.

    this can be fixed by decreasing the FixTimestep from 0.01 to 0.003
    my question is , is there any method that i can get a result without penetration



    i can provide the scenes if needed
     
    Last edited: May 22, 2017
  26. korzen303

    korzen303

    Joined:
    Oct 2, 2012
    Posts:
    175
    @sashahush I think the best way would be to write a small script which works along some bounding volume (box, sphere etc) and locks all the particles which it contains. You can take it further and use unity raycasts against mesh to make some sort of paint brush for locking particles.

    @stsword Yep, that is just the why Flex works. I am afraid that you would need either some custom continuous collision detection or smaller timesteps and/or larger particle-mesh collision margins. But you can drop me this scene. I will have a look.
     
  27. stsword

    stsword

    Joined:
    May 4, 2017
    Posts:
    8
    @korzen303, thanks for your kindly reply

    more question about the FlexParticles Script, just curious where the particle position stored?
    the particle data still exist even i delete the mesh of the cloth
     
  28. korzen303

    korzen303

    Joined:
    Oct 2, 2012
    Posts:
    175
    OK, so positions are store per object in FlexParticles. Next, they are gathered from all FlexParticles and assembled in global arrays in FlexContainer. These arrays are then copied to GPU, after simulation copied back to FlexContainer and from there propagated to individual FlexParticles.

    That is why the best way to modify this is to derive from FlexProcessor

    Code (CSharp):
    1.  
    2.        // Override to modify the data after the flex game objects were updated but before the data from them was copied to the container arrays
    3.         // In other words, use this for working with flex game objects.
    4.         public virtual void PreContainerUpdate(FlexSolver solver, FlexContainer cntr, FlexParameters parameters)
    5.         {
    6.  
    7.         }
    8.  
    9.  
    10.         // Override to modify the data after the container was updated
    11.         // In other words, use for working directly with the container data.
    12.         public virtual void PostContainerUpdate(FlexSolver solver, FlexContainer cntr, FlexParameters parameters)
    13.         {
    14.  
    15.         }
     
    stsword likes this.
  29. Mourinho

    Mourinho

    Joined:
    Dec 29, 2012
    Posts:
    2
    Hey,

    great asset. If you have the time, can you give an estimate when the new uflex version will be released?

    Cheers.
     
  30. korzen303

    korzen303

    Joined:
    Oct 2, 2012
    Posts:
    175
    The uFlex is feature complete in terms of wrapping Flex 1.0. Next uFlex version will focus on wrapping Flex 1.1, which doesn't really add anything new except support for non-NVidia GPUs via DirectCompute. This is a matter of nearest weeks hopefully.
     
    Last edited: May 12, 2017
  31. Mourinho

    Mourinho

    Joined:
    Dec 29, 2012
    Posts:
    2
    Thanks for the quick answer!
     
  32. MelvinEng

    MelvinEng

    Joined:
    Jan 11, 2016
    Posts:
    14
    Hi Korzen,

    Any possibility of some sort of fracture/breakage feature for Flex objects?
    Had heard of some related news on this front a long while back, but that kind of fizzled out unfortunately...

    Regards.
     
  33. stsword

    stsword

    Joined:
    May 4, 2017
    Posts:
    8
    Screenshot_1.png Hi Korzen

    when i generate cloth with polygon like this , error come out "NullReferenceException: Object reference not set to an instance of an object"

    i need to do this coz i need to do some layering cloth

    is there any method to fix this ?
     
  34. roozi90

    roozi90

    Joined:
    Jun 9, 2016
    Posts:
    3
    how can use texture on soft or rigid models
     
  35. korzen303

    korzen303

    Joined:
    Oct 2, 2012
    Posts:
    175
    The textures should be transferred to eventually created meshes. What exactly is the problem?
     
  36. korzen303

    korzen303

    Joined:
    Oct 2, 2012
    Posts:
    175
    @QHuman Hi it is a common problem. Please reinstall NVidia drivers with Advanced/Clean Settings option enabled.
     
  37. Leanimal

    Leanimal

    Joined:
    Sep 1, 2013
    Posts:
    28
    Hey @korzen303 ! We have a bunch of data being both voxelized and rendered on the GPU. Is there a way we can copy the finished particles buffer to a structured buffer on the device in our compute shader? The readout to the CPU is super expensive and ideally we would just read it off the gpu directly.
     
  38. korzen303

    korzen303

    Joined:
    Oct 2, 2012
    Posts:
    175
    @Leanimal Hi, currently uFlex 0.55 (using Flex 1.0) is using CUDA so you would need a native plugin, which maps the DirectCompute buffers in CUDA context and allows moving the data on the GPU. I tried it and it works, although it is kinda complicated and there wasn't that much speed boost for normal applications. You can base the implementation on this https://bitbucket.org/Unity-Technologies/graphicsdemos and google for "CUDA DirectX interop".

    However, Flex 1.1 is also implemented in DirectCompute so this should makes things easier as no CUDA mingling. uFlex based on Flex 1.1 should be ready in couple of weeks.
     
    Leanimal likes this.
  39. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    6,484
    Does this address the overscale issue?
     
  40. pan-master

    pan-master

    Joined:
    Nov 11, 2013
    Posts:
    124
    Does Anybody have shader with modifications from

    29min. Maybe such shader could make flex a bit faster.
    For cloths uflex is too slow on gtx1080ti
     
  41. KlutoTek

    KlutoTek

    Joined:
    May 24, 2017
    Posts:
    6
    I'm having trouble getting any sort of Shader Forge shader to be lit correctly on the meshes that uFlex generates. The shaders work fine on any other object except the meshes uFlex generates. They also work fine on the models the uFlex meshes are derived from. PBL and custom lighting modes always show up black. Blinn and Phong show diffuse color but no lighting or normals. Anyone else experience this or have an idea how to fix it?
     
  42. tuskake

    tuskake

    Joined:
    Mar 5, 2013
    Posts:
    26
    Hi,

    Is it possible to add somekind of scaling property to Flex that easily scales all necessary properties. Now only the small scale scene runs properly and other scenes are too slow and too big.

    There seems to be leaking of some sorts included in every scene, like the water balloon. The water just teleports outside of the balloon by itself.
     
  43. stsword

    stsword

    Joined:
    May 4, 2017
    Posts:
    8
    Can uFlex support deformation collider? i find a script that can update collider mesh each frame, this support unity dynamic on its own, but seem have no effect on uFlex
     
  44. KlutoTek

    KlutoTek

    Joined:
    May 24, 2017
    Posts:
    6
    Still trying to get Shader Forge materials to work right. It seems like the generated mesh's normals or tangents are wrong. Or at least wrong enough for SF to choke on them. Removing the normal map node on an SF material fixes the lighting. Stangely, normal map's on Unity's shaders work fine.
     
  45. roozi90

    roozi90

    Joined:
    Jun 9, 2016
    Posts:
    3


    hey
    when I use your FlexDragBase code i notice that flexutil2 class was not exist in code ,how can i found that?
    tnx
     
  46. korzen303

    korzen303

    Joined:
    Oct 2, 2012
    Posts:
    175
    @KlutoTek for softbodies uflex relies on Unity's SkinnedMeshRenderer so, as long as shaderforge supports this, things should work.
     
  47. Buquet

    Buquet

    Joined:
    Aug 13, 2015
    Posts:
    11
    i am testing mesh skinning with Flex. some results
    FPS without recorder ~= 100

    Flex Fluid with SSF by Korzen
     
    sashahush likes this.
  48. korzen303

    korzen303

    Joined:
    Oct 2, 2012
    Posts:
    175
    @Buquet Nice work! Would you mind sharing the tools and/or the code with the community? Many people ask about it.
    I could include it in uFlex at some point
     
  49. Buquet

    Buquet

    Joined:
    Aug 13, 2015
    Posts:
    11
    i am replace Unity skinning pipeline in native dll, for avoid multiple GPU/CPU/GPU transitions
    and uses Flex 1.1.0 (but early versions is identical)

    with fluids code is uFlex like, but i am edit your SSF asset for support multiple fluid instances. and i partially activate particle portions in flex.ActiveBuffer from emitter position.
    i can send you edited SSF asset for longer research.

    sorry for my english :)
     
    sashahush likes this.
  50. korzen303

    korzen303

    Joined:
    Oct 2, 2012
    Posts:
    175
    @Buquet I will definitely have a deeper look at this. Are you using DirectCompute implementation of Flex 1.1. How did you handle NvBuffers mapping/unmapping. My method is rather cumbersome
     
unityunity