Giter VIP home page Giter VIP logo

engine-spine's People

Contributors

cptbtptpbcptdtptp avatar eyworldwide avatar guolei1990 avatar gz65555 avatar johanzhu avatar mrkou47 avatar singlecoder avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

engine-spine's Issues

Refactor spine runtime

The Galacean Spine runtime code has become quite outdated and is facing issues both in its project architecture and performance. The demand for Spine is gradually increasing, necessitating an urgent refactoring and optimization of the runtime code.

Refactoring includes several aspects:

Project Engineering Optimization #66 #56

  • Spine has released higher versions like 4.0, 4.1, etc. The past project structure, unable to fulfill the needs of managing multiple versions, necessitates an update to the project engineering structure.
  • Parts of the runtime are coupled with the Galacean editor, which need to be separated in the directory structure.

Loader Optimization

  • Support for loading multiple textures. #85 #53
  • Create material and set texture during loading. #48
  • Custom file loading. #88

Renderer Optimization

  • Optimize code structure for improved code readability.
  • Optimize mesh generation logic to improve performance. #52
  • Support for Spine 4.0, 4.1.
  • Support for premultiplied mode.
  • Use double buffering to improve performance (Performance testing is required to determine if it can enhance performance).
  • Calculate bounding box at first rendering frame. #84

Galacean Spine disappear when at the edge of scene (Due to Bounds cut off)

Problem

When we move spine to the edge of scene, the spine disappeared.

// spineEntity.transform.setPosition(0, -15, 0)
spineEntity.transform.setPosition(27.9, -15, 0)

We just need to move a little bit, and the spine will disappear immediately.
But it should still show a little spine.

Reproduction

https://stackblitz.com/edit/b1ookm?file=index.ts

image
image

Reason

This is caused by bounds of spine.

The bounds of spine is a point.

We can update the bounds manually to temporarily fix it.

const spineAnimation = spineEntity.getComponent(SpineAnimation)
spineAnimation.autoUpdateBounds = true
// or
// spineAnimation.updateBounds()

image

Now, it works well.

Expected

Spine, which is not truncated by default, updates bounds as needed.

spine 资源在多 engine 下加载问题

spine 资源 loader 引用的 engine 不是当前 engine 实例,是之前创建的 engine 实例。
如果前 engine 销毁,再加载 spine 资源会报错。

截屏2023-09-15 11 44 34

Enhancement: Isolate sub mesh generate logic

  1. According to unity runtime, its better to generate sub mesh instruction before actually add submesh.So runtime need do this.
  2. Now a lot of logic is all in buildMesh function, its redundancy.

Enhancement: Set attachment texture before build mesh

  • If no clipping involved, set texture once after playing animation.
  • If clipping involved, set texture at each frame, using dirty flag to optimize.
  • If had multiple texture, set texture at each frame, using dirty flag to optimize.

Support additive effect.

Now the whole spine animation combine as one single mesh.
So, different attachments cannot have additive effect.
Runtime should separate attachment which has different blend mode as sub mesh, and give it new material.

Skeleton scaling bug

when set scale less than 0.01, render is wrong
image
but when scale is bigger than 0.01,render is right
image

Enhancing Loader to Manage Temporary Link Scenarios

Currently, the loader determines the file type based on the file extension during the loading process. However, it fails to handle temporary links created via URL.createObjectURL. The loader needs to attempt processing these types of files and provide feedback to the user.

image

Spine Renderer

• Simplify component, refactor SpineRenderer -> SpineAnimation
• Use new MeshRenderer
• Refactor resouce loader
• Support load bin file
• Remove oasisTexture, use Texture2D
• Encapsulate spine resource class for editor

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.