Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

VertExmotion [Released]

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

  1. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,456
    Unity 2020.3.10f1 use URP 10.5, did you unpack the VetExmotion URP shaders compatible with this version?
     
  2. gigacaria

    gigacaria

    Joined:
    Apr 9, 2022
    Posts:
    7
    When I checked, "URP_7.1.8.UnityPackage" was imported.
    I can't reproduce the bug, but I'll see if this causes the bug.
    I'm sorry for the trouble.
     
  3. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,456
    It should works better with the 10.5 addon ;)
    Please let me know if it works properly with it.
     
  4. lyg2260123

    lyg2260123

    Joined:
    Jun 22, 2017
    Posts:
    3
    Dear,i used Unity 2020.3.26f.1,urp 10.8.1,and VertExMotion Pro 1.9.3.
    but import the verExMotion package,
    1.the mat shows pink,the shader(VertExmotion/Standard) is not support。most of all shader is not support。
    2.only shader VerExmotion/Unit/Texture,is support,but without shadow。we need shadow。
    Can you help me?Tks
     

    Attached Files:

    • 1.png
      1.png
      File size:
      229.3 KB
      Views:
      68
    • 2.png
      2.png
      File size:
      326 KB
      Views:
      77
  5. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,456
    The shaders included in the package are made for the built-in render pipeline.
    You have to install the addon according to your URP version ("VertExmotion/Addon")
    You'll be able to use the shader for URP : VertExmotion/URP/...
    You could also upgrade your project to 2021.2 and use the Vertex buffer mode (compatible with all shaders)
     
    Last edited: Apr 18, 2022
  6. adamz

    adamz

    Joined:
    Jul 18, 2007
    Posts:
    1,159
    Hey, how do I enable Vertex Buffer? It seems to only be a tab with instructions. I followed them by painting the weights and adding/positioning a sensor, but nothing happens. I'm using a custom Amplify shader without any of your additional nodes, running URP in Unity 2021.3.0f1. Am I missing something? Thanks.
     
    Last edited: Apr 18, 2022
  7. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,456
    There's nothing more than choosing the Vertex Buffer mode instead of the shader mode.
    Here a simple test with Unity 2021.3.0f1


    Note : If you're using a skinnedmesh character, you have to attach the sensor to a bone, by default the sensors is linked to the gameobject and won't react to the character animation.
     
  8. adamz

    adamz

    Joined:
    Jul 18, 2007
    Posts:
    1,159
    Thanks for the video. So I was able to get it working with a sphere like in your video. Then I tried using your zombie character, assigning it a generic URP Lit shader, then went through the same steps as the sphere, making sure the sensor was attached to the spine, and hit Play. It did not work.
     
  9. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,456
    That's weird, :confused:
    I did a quick test with the zombie in a fresh URP project, and it works fine.

     
  10. adamz

    adamz

    Joined:
    Jul 18, 2007
    Posts:
    1,159
    Are you using a VertexMotion shader, or just a URP Lit that comes with Unity?
     
  11. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,456
    As you can see in the video, it use the URP/Lit shader.
    But the shader is not important with the Vertex Buffer mode, because the modifications are made on the mesh before the shader is applied.
     
  12. adamz

    adamz

    Joined:
    Jul 18, 2007
    Posts:
    1,159
    I thought you just used a regular shader. I did the same thing with the zombie walking mesh/animation, and still couldn't get it to work on my end. I'll give it a go at home, maybe it's a hardware issue with my GPU? Im running an old Quadro M4000M at work.
     
  13. adamz

    adamz

    Joined:
    Jul 18, 2007
    Posts:
    1,159
    Do you use free software to record video? I can always record what Im doing as well.
     
  14. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,456
    The Vertex buffer mode requires a system compatible with compute shaders, most of the system are compatible.
    Do you have any error messages in the console?

    Here the specifications for the compatible hardware
    https://docs.unity3d.com/Manual/class-ComputeShader.html
     
  15. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,456
    I use OBS
     
  16. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,456
    Maybe you should try to update the drivers, it should work, DX11 is supported...
     
  17. adamz

    adamz

    Joined:
    Jul 18, 2007
    Posts:
    1,159
    Hey, so I gave it a shot at home and it still did not work for me. My drivers are updated both at work and home. At home Im running a 3070, so I should be good with the GPU. I tried using both my existing project as well as created a new one and only installed VertexMotion. Below is my setup. I have no errors after playing the scene.

    Any way you could send me the scene in which it was working for you? I have Discord: AdamZ101#1159. Thanks.

    My Setup.jpg
     
  18. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,456
    The settings looks good,
    I've send you the sample scene.
     
  19. adamz

    adamz

    Joined:
    Jul 18, 2007
    Posts:
    1,159
    Morning. Thank you for your help and test scene. I loaded the ZombieScene, and it does not work. My VertexMotion is 1.10.0. Did you try a fresh project and loading VM from the asset store? Maybe there's something missing with the package from the store.
     

    Attached Files:

  20. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,456
    yes, I tried with the versions on the store (basic and Pro) downloaded from the package manager
    I don't understand what's going on.... :confused:
    Could you send me the entire project with the zombie?
     
  21. adamz

    adamz

    Joined:
    Jul 18, 2007
    Posts:
    1,159
    Sure I can send it to you, I'll send you a PM once it's ready.
     
  22. adamz

    adamz

    Joined:
    Jul 18, 2007
    Posts:
    1,159
    Link sent. I also included my setup as well.
     
  23. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,456
    I finally found it!
    The GPU skinning must be enable in the player settings :D

    I don't know why it was disabled in your project...
    Anyway, I'll add a warning message and a button for fixing the settings, in the next version.
     
    Last edited: Apr 19, 2022
    hopeful likes this.
  24. adamz

    adamz

    Joined:
    Jul 18, 2007
    Posts:
    1,159
    It working now, thanks for your help! I think it's off by default since 3 projects I've created had it disabled.
     
  25. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,456
    I've tested with different versions of Unity, and in my case GPU skinning was always enabled.
    I spent hours looking at my code for a simple checkbox in the settings :p

    I'll push an update to the assetstore

     
    Last edited: Apr 20, 2022
    adamz likes this.
  26. adamz

    adamz

    Joined:
    Jul 18, 2007
    Posts:
    1,159
    @kalagaan Hey, so I'm a bit uncertain as to how to set up sensors for fingers. Going back to your balloon example you helped me with; besides indenting the balloons surface with my finger tips, I'd also like to to have the tie off area at the bottom of the balloon be stationary.

    What I did was paint the balloon with the exception of the stem. Then would I create another sensor on the finger to be able to push the balloon as well? Would I set the radius of the sensor to be the size of the finger tip? If so, how do I control the sensor falloff so I can push the majority of the balloon when my finger tip is only slightly up against the surface?

    After playing around with the parameters it seems like radius is what I need to increase, but then the balloon get effect when I get close to the mesh and not touching it.

    Any thoughts would be appreciated!
     
    Last edited: Apr 20, 2022
  27. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,456
    Maybe you should use the VertExmotion effect only for the local deformation of the finger on the ballon and use a pivot point to rotate the balloon itself.
     
  28. adamz

    adamz

    Joined:
    Jul 18, 2007
    Posts:
    1,159
    So there's no way to use two sensors for push and then deform? Maybe a better example is a punching speed bag for boxing. So one deformer is for the push, and the other is for the fist indentation. I can figure out the fist indent, I just cant figure out the second half.
     
  29. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,456
    You can do it with a specific script that will modify the inflate parameter according to the distance inside the original mesh. the secondary sensor could be activated only when the first is at a max penetration value (distance from the tip of the finger and the collision hit )




    Here a sample script :

    Code (CSharp):
    1.  
    2. using System.Collections;
    3. using System.Collections.Generic;
    4. using UnityEngine;
    5. using Kalagaan;
    6.  
    7.  
    8. public class DualSensorTouch : MonoBehaviour {
    9.  
    10.     [System.Serializable]
    11.     public class SensorSettings
    12.     {
    13.         public VertExmotionSensorBase sensor;
    14.         public bool enable = true;
    15.         public string name;
    16.         public float power = 1f;
    17.         public float radius = 1f;      
    18.         public float inflate = 1f;
    19.         public float distanceFromHitPoint = .5f;      
    20.         public float collisionInsideDistanceMax = 1f;
    21.     }
    22.  
    23.  
    24.     public VertExmotion m_vtm;
    25.     public List<SensorSettings> m_sensorSettings = new List<SensorSettings>();
    26.     public Transform m_touchDummy;
    27.     public float m_maxRaycastDist = 3f;
    28.  
    29.  
    30.     void Start () {
    31.      
    32.         if(m_vtm != null)
    33.         {          
    34.             for (int i = 0; i < m_sensorSettings.Count; ++i)
    35.             {
    36.                 m_sensorSettings[i].sensor = m_vtm.CreateSensor(m_sensorSettings[i].name);
    37.                 m_vtm.AddSensor(m_sensorSettings[i].sensor);
    38.  
    39.                 m_sensorSettings[i].sensor.m_params.translation.motionFactor = 0;
    40.                 m_sensorSettings[i].sensor.m_envelopRadius = .1f;
    41.                 m_sensorSettings[i].sensor.transform.parent = transform;
    42.                 m_sensorSettings[i].sensor.transform.localPosition = Vector3.zero;
    43.                 m_sensorSettings[i].sensor.transform.localScale = Vector3.one;
    44.             }
    45.         }
    46.     }
    47.  
    48.  
    49.     void Update ()
    50.     {
    51.      
    52.         //initialize the inflate effect
    53.         for (int i = 0; i < 2; ++i)
    54.             m_sensorSettings[i].sensor.m_params.inflate = 0;
    55.  
    56.  
    57.         RaycastHit hitInfo;
    58.         if( Physics.Raycast( m_touchDummy.position - m_touchDummy.forward * m_maxRaycastDist, m_touchDummy.forward, out hitInfo, m_maxRaycastDist) )
    59.         {
    60.  
    61.             for (int i = 0; i < m_sensorSettings.Count; ++i)
    62.             {
    63.                 if (m_sensorSettings[i].enable)
    64.                 {
    65.                     float distanceInsideCollision = Vector3.Distance(m_touchDummy.position, hitInfo.point);
    66.                     distanceInsideCollision = Mathf.Clamp(distanceInsideCollision, 0, m_sensorSettings[i].collisionInsideDistanceMax);
    67.  
    68.                     m_sensorSettings[i].sensor.m_params.power = m_sensorSettings[i].power;
    69.                     m_sensorSettings[i].sensor.m_envelopRadius = m_sensorSettings[i].radius;          
    70.                  
    71.                     //set the position of the sesor based on the hitpoint
    72.                     m_sensorSettings[i].sensor.transform.position = hitInfo.point + hitInfo.normal * m_sensorSettings[i].sensor.m_envelopRadius * m_sensorSettings[i].distanceFromHitPoint;
    73.  
    74.                     if(i==0)
    75.                     {
    76.                         m_sensorSettings[i].sensor.m_params.inflate = m_sensorSettings[i].inflate * distanceInsideCollision;
    77.                     }
    78.                     else
    79.                     {
    80.                         //activate the next sensor only if the previous is at the max value
    81.                         if (m_sensorSettings[i - 1].sensor.m_params.inflate >= m_sensorSettings[i-1].inflate * m_sensorSettings[i - 1].collisionInsideDistanceMax)
    82.                         {                          
    83.                             m_sensorSettings[i].sensor.m_params.inflate = m_sensorSettings[i].inflate * (distanceInsideCollision- m_sensorSettings[i - 1].collisionInsideDistanceMax) ;
    84.                         }
    85.                     }
    86.                 }
    87.             }          
    88.         }
    89.     }
    90. }
    91.  
     
    Last edited: Apr 21, 2022
  30. adamz

    adamz

    Joined:
    Jul 18, 2007
    Posts:
    1,159
    Thanks for this, I appreciate it!
     
  31. adamz

    adamz

    Joined:
    Jul 18, 2007
    Posts:
    1,159
    @kalagaan You don't have the demo scene by chance that I can see in your example? :)
     
  32. gigacaria

    gigacaria

    Joined:
    Apr 9, 2022
    Posts:
    7
    I introduced a shader of URP10.5 and asked to check the operation.
    I received a reply from the user who discovered the problem earlier, but it seems that the problem has not been resolved.
     
  33. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,456
    Maybe it's a problem with the version of Unity...
    You could try to upgrade to a new version.
    Do you use the Basic version or the Pro version?
    One time a version of Unity had a bug on Android with the basic version, because the dll was not properly serialized, upgrading to a new version of Unity fixed the bug (or using the pro).
    Another way to fix it would be to use the vertex buffer mode (version 1.10.1 with 2021.2 ) because it doesn't rely on the shader.

    Do you have more informations about the issue?
    "the shader was not displayed correctly"
     
    Last edited: May 1, 2022
  34. KillerJaguar

    KillerJaguar

    Joined:
    Mar 3, 2015
    Posts:
    3
    I'm having some issues with VertExmotion. I am running Unity 2021.3.0f1 LTS with URP 12.1.6 and getting some shader errors when importing the URP 12 shader package:

    Shader error in 'VertExmotion/Universal Render Pipeline/Unlit': invalid subscript 'normalOS' at Assets/VertExmotion/Shaders/URP/UnlitDepthNormalsPass.hlsl(32) (on d3d11)

    Shader error in 'VertExmotion/Universal Render Pipeline/Unlit': invalid subscript 'normalOS' at Assets/VertExmotion/Shaders/URP/UnlitForwardPass.hlsl(66) (on d3d11)


    When I try to paint the mesh in vertex buffer mode, the mesh turns invisible and nothing happens when I try to paint the mesh.
     
  35. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,456
    Thank you for the feedback
    Here a patch for URP 12
    I'll push a new version on the assetstore.

    Could you check that the paramater 'Read/write' is enabled in the model import settings ?
    Could you try if it works on other models?
    If you have issues on a specific model could you send it to me ? (contact@kalagaan.com)
     
    Last edited: May 1, 2022
  36. KillerJaguar

    KillerJaguar

    Joined:
    Mar 3, 2015
    Posts:
    3
    I imported the same settings into a new project using the built-in pipeline and everything worked as expected, so this feels like an issue exclusive to URP.

    The patch fixes the shader compilation errors, but the mesh still renders invisible in URP when attempting to paint it. I am using RealToon URP shaders, however the vertex buffer mode should make that detail irrelevant as the same settings in a built-in render pipeline project using RealToon work just fine.

    EDIT

    I found out that RealToon URP only renders correctly when they mesh has an outline defined. I'm not sure why this is the case.
     
    Last edited: May 1, 2022
  37. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,456
    When the tool is in paint mode, the shader is replaced with a custom shader for the edition.
    I don't have issues in my scene, but maybe there's some incompatibility with some post process or project settings.
    I'll create a specifc shader for URP using shadergraph , the current version use a standard Unlit shader that may have some issues in some cases.
    I'll push a new version on the assetstore soon.
    It you want a fix before the official update, please send me an email with your invoice number.
     
  38. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,456
    Do you use a compatible shader or the vertex buffer mode?
    Could you send me some scrrenshots or videos of the issue?
     
  39. gigacaria

    gigacaria

    Joined:
    Apr 9, 2022
    Posts:
    7
    I'm using the Pro version.
    I will try to upgrade Unity.
    But my project is so big that I think it will take some time to verify...
    I'll give it a try anyway.
     
  40. ataruwu71

    ataruwu71

    Joined:
    May 20, 2021
    Posts:
    1
    HI, can I copy the settings in Paint and Sensors to the same new model? How do I do it? Thanks
     
  41. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,456
    If you use the same model, you can use save a mesh reference in the paint tool, and use it on your other character.
    You'll have to duplicate the sensors on the new character.

    But maybe you should use a prefab if you want to apply the modifications on different characters.
     
  42. gigacaria

    gigacaria

    Joined:
    Apr 9, 2022
    Posts:
    7
    I updated to "Unity2021.3.1f1", updated to "VertExmotionPro1.10.1", switched the setting to "Vertex Buffer", and switched the mesh shader to "Unity standard URP / Lit".
    Still, it seems that the mesh disappears on some Android models.
    The models for which problems have been reported are "Galaxy note 10+", "Galaxy s21", and "Huawei p30 lite".
     
  43. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,456
    Did you use the same shader (compatible with VertExmotion) or did you use the URP lit shader ?
    With the vertex buffer you can use any shader. if this is an issue with the VertExmotion shader compatibility, it should be fixed by using a 'standard' shader.
     
  44. gigacaria

    gigacaria

    Joined:
    Apr 9, 2022
    Posts:
    7
    Until now, I used "VertExmotion / Universalpipeline / Lit", but I switched to "UniversalRenderPipeline / Lit" because there is a high possibility that there is a problem with the shader.
    By using "Vertex Buffer", it has been confirmed that it works without problems in my development environment.
    However, users using the above three models have sent reports and screenshots that the mesh disappears.
    When I checked the screenshot, only the mesh with the "Vert Exmotion" component is missing.
    By the way, only the "VertExmotion" component is attached to the missing mesh.
     
  45. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,456
    That's weird... :confused:
    maybe there's something wrong with the import settings.
    Could you send me screenshots of the model import settings of your meshes? (contact@kalagaan.com)
    If you could send me a sample scene with the vertexmotion settings and the scripts you're using, I could have a look.
     
  46. gigacaria

    gigacaria

    Joined:
    Apr 9, 2022
    Posts:
    7
    I have two things to worry about.
    The model I'm using is that "Read / Write" is turned on and that the "Vertex Color" setting is removed when modeling.
    This is because if you set the "vertex color" in the modeling software and then paint with VertExmotion, the paint settings will be saved only temporarily. (When you restart UnityEditor, the paint data set in VertExmotion will be forgotten and it will turn blue.)
    However, it works perfectly on all but a few Android models, so I don't think there is a problem with this setting.

    Sending a project is difficult.
    If it seems difficult to resolve, I will stop supporting the device that is having the problem.
    Or I will buy an android device that has a problem and check if it really has a problem.
    Maybe there is a problem with the user's environment.
     

    Attached Files:

  47. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,456
    VertExmotion store the verex color in its own buffer, and overwrite the mesh at runtime.
    But there's another option, you can use the mesh reference in the paint panel, in that case it will use the vertex color defined in the mesh. If you paint the mesh data, you can save the mesh in the project and it will include the vertex color defined by the tool.
    But I'm not sure that it would fixe the problem.

    Only the vertices inside the sensors' range are modified, so if the mesh completly disapear it could be another issue than the VertExmotion process...

    Maybe you could force the "index format" to 16bits, only mesh with moere than 65000 vertices use a 32bit buffer.
    But I have no more idea for now :(
    I'll try to find someone with one of these devices for testing.
     
  48. Fyrburn

    Fyrburn

    Joined:
    Aug 30, 2013
    Posts:
    19
    Hello :)
    Is there a way to paint programmatically?
    ex: I'd like to put down sphere colliders where I want to be hot spots for vertexmotion, and every vertex inside gets turned red.

    I realise something that specific will be no, but is there an API to make things a little easier for my own script to use?
    I see PaintVertice in the editor but it's set to private. I could *probably* jury rig it into working, but was wondering if I'd just missed something publicly accessible!

    Thanks
     
  49. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,456
    You have to modify the mesh vertex color ;)
    each channel of the color is a VertExmotion layer.

    You can use the Unity Mesh API for that. :)
     
  50. Fyrburn

    Fyrburn

    Joined:
    Aug 30, 2013
    Posts:
    19
    ooh I didn't realise, that's perfect actually!
     
unityunity