Comments (6)
If the draw order of meshes changes, the vertex/index buffers must be rebuilt. For the example character (the knight) shown animated on the homepage of the repo, rebuildMeshes
is never called.
However, I can see that there is probably a good opportunity here for optimization for Spine characters/objects that do frequently cause calls to rebuildMeshes
. Using pc.createMeshes
is probably a bad idea. A single pc.Mesh should be created once, and the vertex/index buffers should only be recreated if the overall number of vertices changes (which presumably shouldn't happen in the case of a reorder of character parts).
Instead, the vertex/index buffers should just be refilled.
from playcanvas-spine.
If the draw order of meshes changes, the vertex/index buffers must be rebuilt. For the example character (the knight) shown animated on the homepage of the repo,
rebuildMeshes
is never called.However, I can see that there is probably a good opportunity here for optimization for Spine characters/objects that do frequently cause calls to
rebuildMeshes
. Usingpc.createMeshes
is probably a bad idea. A single pc.Mesh should be created once, and the vertex/index buffers should only be recreated if the overall number of vertices changes (which presumably shouldn't happen in the case of a reorder of character parts).Instead, the vertex/index buffers should just be refilled.
That's what I think. I tried to do it, but it didn't work. Maybe I wrote something wrong.
from playcanvas-spine.
Spine plugin rebuilds meshes only if there are multiple atlases assigned to attachments and depth-order of those attachments changes.
So, I can recommend to minimise the number of textures or align attachments corresponding to texture to avoid reordering.
And unfortunately number of vertices is not constant.
from playcanvas-spine.
Spine plugin rebuilds meshes only if there are multiple atlases assigned to attachments and depth-order of those attachments changes.
So, I can recommend to minimise the number of textures or align attachments corresponding to texture to avoid reordering.
And unfortunately number of vertices is not constant.
But,There's probably more than one texture for animation.
from playcanvas-spine.
from playcanvas-spine.
I'll close this as the rendering system i question has been completely rewritten since then, and should perform a lot better overall.
from playcanvas-spine.
Related Issues (20)
- Data export from Spine 3.8.xx HOT 3
- Spine clipping mask problem HOT 3
- Attaching listeners to AnimationState HOT 4
- Meshinstance memory leak in render
- Mention required "Power Of Two" export option. HOT 1
- Would we be able to change to use asset.filename instead of deriving from the URL?
- Memory leak: Spine component not fully removed on destroy (Fix included)
- Port to render component
- Basis compressed textures for the atlas throws code errors HOT 2
- Support for Spine 4.x now that it's stable? HOT 5
- Spine animations don't work with engine 1.48.0+ HOT 1
- TypeError: Cannot set property state of # which has only a getter HOT 1
- Allow optional material configuration for the plugin HOT 1
- Unable to disable or destroy entity in the complete callback
- 3.8 Clipping bug where sprites are not clipped properly
- Minor Issue: Mesh constructor takes a GraphicsDevice as a parameter HOT 3
- Can you add virtual joystick and attack example to hero.html? HOT 1
- I found that he couldn't complete my attack animation. HOT 1
- ES6 Compatibility HOT 6
- Mask problem in Spine
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from playcanvas-spine.