Giter VIP home page Giter VIP logo

Comments (6)

willeastcott avatar willeastcott commented on June 15, 2024 1

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.

gameatp avatar gameatp commented on June 15, 2024

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.

That's what I think. I tried to do it, but it didn't work. Maybe I wrote something wrong.

from playcanvas-spine.

e-strokov avatar e-strokov commented on June 15, 2024

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.

gameatp avatar gameatp commented on June 15, 2024

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.

gameatp avatar gameatp commented on June 15, 2024

from playcanvas-spine.

mvaligursky avatar mvaligursky commented on June 15, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.