Search Unity

VertExmotion [Released]

Discussion in 'Assets and Asset Store' started by kalagaan, Oct 30, 2014.

  1. dzft3w

    dzft3w

    Joined:
    Apr 4, 2020
    Posts:
    13
    Hello!
    Is there a setting for inertia to stop objects from deforming when in uniform motion like in elevator?
     
    Last edited: Jul 28, 2022
  2. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,500
    You could try to add the inverse motion vector to the sensors. There's a custom world force in the sensors' parameters.
    There's different samples using custom forces by script in the package.
     
  3. CoolCat518

    CoolCat518

    Joined:
    Feb 4, 2015
    Posts:
    18
    Hi, I used vert exmotion on the skin mesh, the effect is good when the scale value is 1, but when I set the scale of the character larger at runtime, vert exmotion has no effect, how can I solve this problem? Thank you!
     
  4. CoolCat518

    CoolCat518

    Joined:
    Feb 4, 2015
    Posts:
    18
    Unity version: 2022.1.8 vertExmotion vertion:1.10.2

    In your demo scene to adjust the scale value of those characters, the effect is good, but using my own characters, scale larger will have no effect
     
  5. sii-018

    sii-018

    Joined:
    Aug 22, 2022
    Posts:
    2
    Hello.

    I tried applying it to poiyomi as per page 22 of the document, but I can't paint on the vertices.
    gradient doesn't seem to work either.

    Is there any solution?
     
  6. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,500
    What is your version of unity?
    Do you use the latest version of Vertexmotion ?
     
  7. sii-018

    sii-018

    Joined:
    Aug 22, 2022
    Posts:
    2
    I am using unity 2020.3.30f1
    The version of vertexmotion uses the latest 1.10.2
     
  8. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,500
    Does the model has the Read/Write parameter enabled in the import settings?
    If it doesn't work, could you send me your model and your invoice number (contact@kalagaan.com)
    I'll help you to fix it.

    Note : With Unity 2021 you can use the Vertex Buffer mode, so you don't have to convert the shader.
    You'll have to download the package again using the package manager in Unity 2021.
     
    sii-018 likes this.
  9. xueqing0622

    xueqing0622

    Joined:
    Apr 8, 2020
    Posts:
    12
    Hi, kalagaan

    Could you upload a scene example for this script! Thanks a lot!
     
  10. DigitalAdam

    DigitalAdam

    Joined:
    Jul 18, 2007
    Posts:
    1,202
    @kalagaan Hi, I'm running Unity 2022.1.17f1, HDRP, with your latest update. Is there a way to show the entire mesh when painting with the vertex buffer mode? It seems to disappear when orbiting around in the scene view. GPU Compute Skinning is enabled.Thanks.
     

    Attached Files:

  11. EvalDaemon

    EvalDaemon

    Joined:
    Aug 8, 2013
    Posts:
    107
    I found that the hdrp vert lit shader was giving an error and doing the same thing because it calls vertmesh that was looking for vertexmotion.cginc down one folder when it was actually down two. So I changed the shader to look for it like this.

    #include "../../VertExmotion.cginc"
     
  12. Desertleaf

    Desertleaf

    Joined:
    Dec 15, 2013
    Posts:
    15
    Unity 2021.3.11f [ VertExmotion implementation in Amplify Shader Editor].

    When i add the additional directive for Vertexmotion.cgnic, i get a redefinition error for _Time.

    I don’t know HLSL so i don’t know what to do.
    //EDIT - upgraded to 2021.3.13F - problem still exists.

    ///EDIT

    Shader error in 'VerExmotion/Basic_AmplifiedVersion_Converted': redefinition of '_Time' at 2019_4/2021.3.13f1/Editor/Data/CGIncludes/UnityShaderVariables.cginc(40) (on d3d11)

    I notified Amplify shader team but they are busy with other things.
     
  13. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,500
    Oops, I was really busy these months and I didn't see this notification :(
    I'll have a look, thank you for the feedback
     
  14. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,500
    Thank you, for the feedback! ;)
     
  15. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,500
    I'll check that! ;)
     
  16. Setmaster

    Setmaster

    Joined:
    Sep 2, 2013
    Posts:
    239
    Getting this error with the Unlit URP shader:

    invalid subscript 'normalOS'
    Compiling Subshader: 0, Pass: DepthNormalsOnly, Vertex program with <no keywords>
    Platform defines: SHADER_API_DESKTOP UNITY_ENABLE_DETAIL_NORMALMAP UNITY_ENABLE_REFLECTION_BUFFERS UNITY_LIGHTMAP_FULL_HDR UNITY_LIGHT_PROBE_PROXY_VOLUME UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BLENDING UNITY_SPECCUBE_BOX_PROJECTION UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS
    Disabled keywords: DOTS_INSTANCING_ON INSTANCING_ON SHADER_API_GLES30 UNITY_ASTC_NORMALMAP_ENCODING UNITY_COLORSPACE_GAMMA UNITY_FRAMEBUFFER_FETCH_AVAILABLE UNITY_HALF_PRECISION_FRAGMENT_SHADER_REGISTERS UNITY_HARDWARE_TIER1 UNITY_HARDWARE_TIER2 UNITY_HARDWARE_TIER3 UNITY_LIGHTMAP_DLDR_ENCODING UNITY_LIGHTMAP_RGBM_ENCODING UNITY_METAL_SHADOWS_USE_POINT_FILTERING UNITY_NO_DXT5nm UNITY_NO_FULL_STANDARD_SHADER UNITY_NO_SCREENSPACE_SHADOWS UNITY_PBS_USE_BRDF2 UNITY_PBS_USE_BRDF3 UNITY_PRETRANSFORM_TO_DISPLAY_ORIENTATION UNITY_UNIFIED_SHADER_PRECISION_MODEL UNITY_VIRTUAL_TEXTURING


    invalid subscript 'normalOS'
    Compiling Subshader: 0, Pass: Unlit, Vertex program with <no keywords>
    Platform defines: SHADER_API_DESKTOP UNITY_ENABLE_DETAIL_NORMALMAP UNITY_ENABLE_REFLECTION_BUFFERS UNITY_LIGHTMAP_FULL_HDR UNITY_LIGHT_PROBE_PROXY_VOLUME UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BLENDING UNITY_SPECCUBE_BOX_PROJECTION UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS
    Disabled keywords: DEBUG_DISPLAY DOTS_INSTANCING_ON FOG_EXP FOG_EXP2 FOG_LINEAR INSTANCING_ON SHADER_API_GLES30 UNITY_ASTC_NORMALMAP_ENCODING UNITY_COLORSPACE_GAMMA UNITY_FRAMEBUFFER_FETCH_AVAILABLE UNITY_HALF_PRECISION_FRAGMENT_SHADER_REGISTERS UNITY_HARDWARE_TIER1 UNITY_HARDWARE_TIER2 UNITY_HARDWARE_TIER3 UNITY_LIGHTMAP_DLDR_ENCODING UNITY_LIGHTMAP_RGBM_ENCODING UNITY_METAL_SHADOWS_USE_POINT_FILTERING UNITY_NO_DXT5nm UNITY_NO_FULL_STANDARD_SHADER UNITY_NO_SCREENSPACE_SHADOWS UNITY_PBS_USE_BRDF2 UNITY_PBS_USE_BRDF3 UNITY_PRETRANSFORM_TO_DISPLAY_ORIENTATION UNITY_UNIFIED_SHADER_PRECISION_MODEL UNITY_VIRTUAL_TEXTURING
     
    Last edited: Jan 27, 2023
  17. Graham-B

    Graham-B

    Joined:
    Feb 27, 2013
    Posts:
    331
    I'm trying to use VertExmotion along with HBAO, but the HBAO post process is producing a strange outline which shows the mesh both before and after deformations from VertExmotion. Any idea how I can work around this?

    Was wondering if it could be something simple like an ordering issue, but tried setting HBAO higher in the script execution order and no luck.

    There seems to be an incompatibility between the two assets. I contacted the HBAO developer and he replied with a tidbit of information that may be useful to you.

    "Like most SSAO solutions, HBAO require 2 inputs: depth and normals textures that Unity provides to shaders"

    Any idea how I can work around this?
     
  18. Graham-B

    Graham-B

    Joined:
    Feb 27, 2013
    Posts:
    331
    I tried out Amplify Occlusion since I saw another post saying it is compatible, however it has the exact same issue as HBAO, the strange ghosting between the mesh before and after VertExmotion deformation.



    The only way around this that I can find is to set the "Per Pixel Normals" to "None," but unfortunately this leaves the mesh looking pretty bad without normals in the AO calculation.

    Any ideas?
     
  19. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,500
    On the latest version of Unity you can use the vertex buffer mode instead of the shader mode,
    it will work with any shader.
     
  20. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,500
    Hello,
    Did you try the Vertex Buffer mode ?
     
  21. Graham-B

    Graham-B

    Joined:
    Feb 27, 2013
    Posts:
    331
    Where do I find Vertex Buffer mode?

    Edit: Found it, and it works perfectly!


    Thanks! This will make my life a lot easier since I no longer need to manual update my custom shaders.
     
    Last edited: Jan 29, 2023
    kalagaan likes this.
  22. Rabadash8820

    Rabadash8820

    Joined:
    Aug 20, 2015
    Posts:
    94
    Hi @kalagaan, this looks like an incredible asset, and I'm super impressed that you've maintained it since 2014! I'm currently evaluating it for use in a game about cells, where I was going to represent the cell membranes as softbodies to give them some fluidity and deformability. One other critical requirement is to be able to merge other small softbodies (vesicles) with this membrane, or pinch them off. Your push and pull interactions look promising, but does your asset provide a way to actually "merge" two softbody meshes into one, or split one apart?
     
  23. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,500
    VertExmotion doesn't modify the original geometry, it's a way to deform existing meshes.
    The sensors are spheres (or cylinder) where you can modify the vertices with some settings (offset, inflate, jiggle...)
    You can share them between different objets, so if the vertex density is the same, both surfaces could be modified in the same way in worldspace.
    Not sure that it will feet exactly what your need, but it could help to have nice interactions.
     
  24. Rabadash8820

    Rabadash8820

    Joined:
    Aug 20, 2015
    Posts:
    94
    Cool, thank you for clarifying. Looks like I'll need to find a good asset for combining meshes or write something crude myself. VertExmotion should be great for the fluidity part though. Thanks again!
     
  25. unity_9GrkBK6e9MmiSg

    unity_9GrkBK6e9MmiSg

    Joined:
    Nov 3, 2019
    Posts:
    4
    Hi @kalagaan, this asset is really nice. Is there any tutorial for collisions?
    For example at this demo(http://www.kalagaan.com/VertExmotion/Demos/Collisions/) and in general for simple collisions can be done only with sensors or there's a script needed? If there's a script needed do you have a tutorial or example?
     
  26. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,500
    A default collision system is included in the sensor's settings, there's some informations in the documentation.
    https://www.kalagaan.com/VertExmotion/Doc/VertExmotion_doc.pdf

    There's some examples in the package for using the collision system and some scripts for advanced collisions based on procedural sensor spawn and control, it really depends of the effect you need.
     
  27. unity_9GrkBK6e9MmiSg

    unity_9GrkBK6e9MmiSg

    Joined:
    Nov 3, 2019
    Posts:
    4
    Thank you very much!
     
  28. Hummy91

    Hummy91

    Joined:
    Jun 7, 2017
    Posts:
    67
    Does this asset work with HDRP and also with Skinned Meshes that use/manipulate Blendshapes at runtime?
     
  29. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,500
    Yes it works with all render pipelines and blendshapes.
     
    Hummy91 likes this.
  30. Hummy91

    Hummy91

    Joined:
    Jun 7, 2017
    Posts:
    67
    Thought I would just share this small bit of info here as I was struggling with syncing up my character mesh soft body with attached clothing and couldn't find any solid answers in this thread. What ended up working best for me was to programmatically copy the sensors and sensor links from the VertExmotion component on my character to the one on my clothing item. The important part was copying the sensor LINKS as well as the sensor itself.

    This + ensuring that the vertex painting on your base mesh and on your attachment/clothing is similar (in my case I just fully painted (red) the animated areas on my base mesh and clothing) and you can get it basically 100% accurate. I have a extremely thin, tightly wrapped bandage on my characters leg which is now simulating perfectly.
     
    kalagaan likes this.
  31. Andresmonte

    Andresmonte

    Joined:
    Nov 22, 2014
    Posts:
    37
    Hello, I just found a bug. If I increase the scale of my character that uses VertExMotion with the VertexBuffer mode, the inflate effect thinks the sensor is closer than it actually is. It's very frustrating because instead of deforming the mesh inwards, it's actually inflating the mesh outwards, even when the sensor is way away from the surface of my character mesh.
     
  32. Setmaster

    Setmaster

    Joined:
    Sep 2, 2013
    Posts:
    239
    Just checking if the dev is still alive.
     
  33. Rabadash8820

    Rabadash8820

    Joined:
    Aug 20, 2015
    Posts:
    94
    The dev (@kalagaan) has been actively posting on this thread since 2014, the latest in March. They also responded to your last message in January and my message in February. The only message they haven't responded to (at least recently) is that bug report from ~2 weeks ago. So I obviously have no idea if they're still alive, but if you're just making a joke...what is the joke?
     
  34. Setmaster

    Setmaster

    Joined:
    Sep 2, 2013
    Posts:
    239
    Why are you taking this so seriously? No, it was not a joke, I just wanted to see if they were around. I see a post from Jul 13th that still hasn't had a response. No big deal, but I wanted to check.
     
  35. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,682
    According to the forum, he's not logged into the forum since May12.
     
    Last edited: Jul 30, 2023
    Setmaster likes this.
  36. Andresmonte

    Andresmonte

    Joined:
    Nov 22, 2014
    Posts:
    37
    He told me via email that he was on vacation a couple of weeks ago.
    The bug I described is easy to fix if you have the pro version; if you have the normal version, it requires some tweaking.
     
    Setmaster and hopeful like this.
  37. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,500
    I'm still alive :p

    I've pushed a fix on the assetstore (v 1.10.3)
     
    Setmaster and hopeful like this.
  38. Slaimx

    Slaimx

    Joined:
    Jul 25, 2020
    Posts:
    8
    Hi there, is this gonna works on entity/ecs project.

    If yes, i baked animation shader. The thing i want is to be able to manipulate top of the body to be able to rotate. For example, i paint weight to the top of the Mesh/shader. Then i want it to be able to rotate by pivot i set. To achieve look up and down. Is this possible?
     
  39. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,500
    I didn't test it with entity, but that should work...
    Could you send me a sample project (contact@kalagaan.com), I could have a look.
     
  40. pappaprino

    pappaprino

    Joined:
    Sep 10, 2023
    Posts:
    15
    hi, i have a question... so, how i can make it stop to react to the forward movements physics and only make it react after a velocity threshold, like when it run? i'm trying to have the same result as when the character is not moving and only the animation in place is playing without any added force, because i try to adding an oppose force in the custom world force but is not really working, it create some strange constraint.
     
  41. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,500
    Hello,
    you can modify the limits per axis for creating a constraint in the motion system of the sensor.


     
    Last edited: Sep 10, 2023
    pappaprino likes this.
  42. pappaprino

    pappaprino

    Joined:
    Sep 10, 2023
    Posts:
    15
    hey thanks! what a quickly reply! uhmmm yes, it's seems it's work, but if i activate the stretch, it put it in again some little constraint
     
  43. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,500
    The strech don't use the axis limit, it's added to the global motion.
    It depends of the FX you want to achieve, but maybe you could use a linked sensor to simulate speed deformation in a smooth way.
    The linked sensor could move accordingly to the main sensor motion and apply a force based on the moving direction. It requires a custom script for moving the sensor and for changing the settings procedurally.

    The linked sensors blend the settings from 2 sensors to the vertices in the range of the capsule.

    Here a sample of an inflate deformation based on linked sensors.
     
    pappaprino likes this.
  44. pappaprino

    pappaprino

    Joined:
    Sep 10, 2023
    Posts:
    15
    uhmmm interesting, i will give a look to it, now another question, i was trying to access to the axisOuterMaxDistance.x and the others, by scripts, like:

    Code (CSharp):
    1. coordin = vert.gameObject.GetComponent<VertExmotionSensorBase.Parameter.Translation>();
    2.  
    and then calling the
    Code (CSharp):
    1. maxX = coordin.axisOuterMaxDistance.x;
    but clearly i'm doing something wrong, i know, because i can't find it on the gameobject because i have the vertexemotion.cs and not the VertExmotionSensorBase.cs how i can access to it and then choose the different sensors? probably a stupid question
     
  45. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,500
    The VertExmotion component has a list of all the sensors applied on it (m_VertExmotionSensors).
    Most of the time the sensors are children of the VertExmotion gameObject.
    If you attach a sensor to a bone (for SkinnedMesh), the sensor will be attach to the bone transform at start.

    Note : you can share one sensor to multiple VertExmotion component by adding it to each list, that could be usefull for sharing deformation in the same way on different renderers.
     
    pappaprino likes this.
  46. pappaprino

    pappaprino

    Joined:
    Sep 10, 2023
    Posts:
    15
    anyways, i have made a script that change the max and min distance, it works good. then after playing with the min and max, the walking animation, in place or not is good... but when i tried the running animation.. and even replacing the min and max value... nothing the result is bad.. the running in place animation is good, while moving, again is not... even trying to modifying the min and max at runtime... so, there is not really something to disable the velocity magnitude? (if it use that, i don't know)
     
  47. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,500
    This component set a reference for the motion system (of each sensor) instead of a world simulation.

    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3. using Kalagaan;
    4.  
    5. public class VertExmotionMotionReference : MonoBehaviour {
    6.  
    7.     public Transform m_reference;
    8.     VertExmotion m_vtm;
    9.  
    10.     void Awake () {
    11.  
    12.         m_vtm = GetComponent<VertExmotion>();
    13.         if (m_reference == null || m_vtm == null) return;
    14.  
    15.         for (int i = 0; i < m_vtm.m_VertExmotionSensors.Count; ++i)
    16.         {
    17.             //set the motion reference
    18.             m_vtm.m_VertExmotionSensors[i].m_motionReference = m_reference;
    19.         }
    20.     }  
    21.  
    22. }
     
    pappaprino likes this.
  48. pappaprino

    pappaprino

    Joined:
    Sep 10, 2023
    Posts:
    15
    thanks it works perfectly
     
    kalagaan likes this.
  49. douggordongala

    douggordongala

    Joined:
    Feb 22, 2022
    Posts:
    1
    Hey guys, sorry for the simple (and probably already answered) question. I just started messing around with VertExmotion today and I noticed that whenever I stop my scene in Unity, it reverts my "distance power" and "motion factor" settings. Any help would be greatly appreciated. Thanks!

    Another question...I'm trying to import paint data from a map. In the inspector there is no way to set to advanced but under advanced section I did set it to read/write. When I import into VertExmotion I dont see an option to select UV channel (UV1 by default) and click 'Paint from map' I do see a prompt saying read/write needs to be enabled which it already is. Also if I click off and back on the character the map I imported in no longer there

    I appreciate any help you guys can give me!
     
    Last edited: Sep 12, 2023
  50. Hummy91

    Hummy91

    Joined:
    Jun 7, 2017
    Posts:
    67
    Hey Kalagaan, what would you recommend for causing a sort of localized wobble effect on an otherwise static object that is already using Vertexmotion? E.g, some jelly which is mostly at rest, and is hit by another object? Outside of simulating the physics for that (by literally throwing something at it), if I wanted to trigger such an effect via script, would that be possible? I was imagining something like AddForce/AddImpulse to a specific sensor/s.
     
    Last edited: Sep 12, 2023