danzel / XnaUnitySpriteBatch

Provides a Xna SpriteBatch implementation for Unity use, allowing for quick and rough porting of Xna projects to Unity.
Other
11 stars 6 forks source link

Improve Performance on WP8 #1

Open danzel opened 11 years ago

danzel commented 11 years ago

http://docs.unity3d.com/Documentation/Manual/RenderingStatistics.html

Try MarkDynamic Try Double Buffer (switch mesh each frame) http://docs.unity3d.com/Documentation/ScriptReference/Mesh.MarkDynamic.html http://forum.unity3d.com/threads/118723-Huge-performance-loss-in-Mesh-CreateVBO-for-dynamic-meshes-IOS

Mentions changing triangle array frame is bad perf http://forum.unity3d.com/threads/118723-Huge-performance-loss-in-Mesh-CreateVBO-for-dynamic-meshes-IOS?p=924201&viewfull=1#post924201

And mesh.clear is bad

color32 is faster than color http://forum.unity3d.com/threads/118723-Huge-performance-loss-in-Mesh-CreateVBO-for-dynamic-meshes-IOS?p=1292009&viewfull=1#post1292009

Can probably ditch RecalculateNormals. Fix up garbage generation in SpriteBatch vs GraphicsDevice (Maybe do a specialised spritebatcher that uses unity types and struct o array rather than array of struct)

changing a materials texture may be bad: http://answers.unity3d.com/questions/366540/one-material-for-many-objects-with-different-textu.html http://forum.unity3d.com/threads/151635-Performance-of-switching-material-textures-frequently

http://withimagination.imgtec.com/index.php/powervr/how-to-improve-your-renderer-on-powervr-based-platforms

danzel commented 11 years ago

3522b70ec203c409ee06f9511d73b9c2ed7254d7 improved perf heaps by fixing a pool bug. Not changing texture of a Material seems to give a very small win too.