Jump to content


Photo

Optimization and Unity


  • Please log in to reply
4 replies to this topic

#1 AShrouderer

AShrouderer

    Newbie

  • Customers
  • Pip
  • 3 posts
  • Company:inXile

Posted 24 November 2015 - 06:25 PM

Hello, I am in the initial stages of getting 1 character out of ~40 into Unity using Shroud. I am wondering what are the top 5 things I can do to optimize so Shroud doesn't slow down the game (deleting unused controllers, etc..). We could possibly have ~10 characters on screen at a time. There are mostly skirts and usually not more than 1 Shroud cloth per character. Any and all help would be greatly appreciated.
Thank you



#2 Joe_vdH

Joe_vdH

    Administrator

  • Administrators
  • 193 posts
  • LocationSeattle, WA
  • Company:CloakWorks

Posted 02 December 2015 - 09:25 AM

Sure!  Here's a couple suggestions:

  • Try to keep the number of rows and columns low in your cloth rig.  If there are fewer points to processes, then it will run faster.  The mistake a lot of people make is having their cloth rig be more dense than the mesh it is animating when using thick cloth; if the cloth is more dense than the visual mesh, you won't get any benefit from it.  However, don't make the cloth rig too sparse, as it will allow colliders to pass through.  In general the squares of the rig should be about half the size of your smallest collider
  • Try to keep your number of iterations low.  Low iterations can lead to stretching, but there's some things you can do to avoid that:
    • Always put the green part at the top (where your anchors to the mesh are).  The rig is color coded with green at the top and blue at the bottom; if you put the green at the top, it will stretch less
    • Use the Stretch constraints.  These should be part of the your rig automatically when you create them, just be sure to not remove them
  • Basic collision settings are faster than using the advanced collider settings.  However advanced is really the best choice for fast moving parts of your character like the knees.  If your cloth rig is simple, you can often get away with using basic colliders + skinned distance and skinned normal constraints instead of lots of advanced colliders. When you do use advanced colliders, spheres are cheaper than capsules
  • If your cloth is just a thin sheet of polys, then use the Thin cloth support instead of Thick cloth.  Thin cloth means that Shroud generates the visual mesh 1:1 with the cloth rig, making applying the pose of the rig to the rendered mesh much simpler than using Thick cloth support.  You can still model the shape of the cloth in Maya or whatever, and then use the Match to Mesh tool to make the thin cloth assume the same skinned weighting values as the source mesh, but in your game turn the source mesh off and let Shroud use the generates thin cloth mesh. 
  • Use the collision filters feature if you have more than one cloth rig on the character.  Collision filtering lets you set which colliders effect which cloth rig, so that only the colliders that each rig can reach are actually tested by the simulation. 

 

Hope that helps!


Shroud - Real-Time Cloth Physics - www.cloak-works.com


#3 AShrouderer

AShrouderer

    Newbie

  • Customers
  • Pip
  • 3 posts
  • Company:inXile

Posted 04 December 2015 - 07:39 PM

Does removing unused 'Constraints' (Plane collision, Sphere collision) or 'Forces' optimize Shroud? Is this something I should think about or are the majority of performance hits stated in your first reply?

Thank you!



#4 Joe_vdH

Joe_vdH

    Administrator

  • Administrators
  • 193 posts
  • LocationSeattle, WA
  • Company:CloakWorks

Posted 05 December 2015 - 04:49 PM

They don't impact performance in a meaningful way unless there are actual planes or spheres, etc that they are colliding with.  Removing the forces will negatively impact the look of the cloth, which you likely don't want, and the cost isn't that significant anyway. 

 

What platform is this for, anyway? 


Shroud - Real-Time Cloth Physics - www.cloak-works.com


#5 AShrouderer

AShrouderer

    Newbie

  • Customers
  • Pip
  • 3 posts
  • Company:inXile

Posted 07 December 2015 - 02:56 PM

Mac, PC, and Linux.






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users