Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
2
Question by fherbst · Jul 11, 2010 at 11:09 AM · meshaccessvertexskinningskinned

Access skinned mesh vertices

Hi,

I want to access the mesh of a skinned mesh - not the shared mesh, but the actually deformed one.

In my particular case I need to get and change the vertex positions and vertex colors, but I can think of some situations where this would be nice to do:

  • snapshotting a mesh to use it for something else (e.g. as new MeshCollider mesh)
  • adding morphs after meshes are skinned

Is skinning done on software or on hardware? If Unity uses hardware skinning, I assume I cannot acccess the vertices as they are only deformed by the graphics card. Then the only way would probably be to write my own software skinning algorithm (and I don't want to do that).

But I read that Unity since 2.5 uses "multithreaded mesh skinning" , and that would mean it is done software-side and is somehow accessible. But how?

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

· Add your reply
  • Sort: 
avatar image
2
Best Answer

Answer by mattirwin · Jan 26, 2011 at 09:30 PM

I know this is an old question, but I was looking to do something similar and found a good script on the Forum. This code is working for me, although my current mesh and bone setup is fairly simple.

Have a look here:

http://forum.unity3d.com/threads/14378-Raycast-without-colliders

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image fherbst · Jan 27, 2011 at 05:23 PM 0
Share

Thanks! I still have to test whether this kind of "software skinning" is fast enough for my purposes, but maybe I can reanimate the project now :)

avatar image mattirwin · Feb 04, 2011 at 12:07 AM 0
Share

Weird follow-up: The script when compiled into a Windows standalone seems to be sensitive to the Api Compatibility Level. Everything is cool in the editor, but make sure you have the above set to ".NET 2.0" and not ".NET 2.0 Subset".

The latter was giving me false hits on the updated mesh collider. I have no idea what would cause this.

avatar image
2

Answer by Aras · Jul 11, 2010 at 11:20 AM

Yes, skinning is performed on the CPU (and multiple skinned meshes are transformed on separate threads to exploit multicore CPUs). However, right now there's no API to access post-skinned meshes.

Would your "extra modifications" be possible to do in a vertex shader? This would not solve "I want to create colliders" problem, but some types of deformations should be possible to do in a shader.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image fherbst · Jul 11, 2010 at 11:44 AM 0
Share

What I want to to is to set the vertex color based on the motion of the vertex in the last frame. I don't think it can be done in a shader because the changed vertex colors can't be "written back" to the colors for the next time drawing. It works perfect for normal $$anonymous$$eshFilter objects, and I had not thought it would be harder to do for skinned meshes...

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

No one has followed this question yet.

Related Questions

Manipulate skinned mesh? 1 Answer

Mesh from Vertices (Polygon from Spline) 3 Answers

Mesh Vertex 0 Answers

skinmesh component is not in mesh? 0 Answers

Understanding verts and triangles in Unity 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges