playcanvas / playcanvas/engine

Add circular buffer texture for SkinInstance.

Open
#8,020 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
16.8k
Forks
2k
Avg merge
4h 32m
Merged PRs (30d)
222

Description

During my experiments with multi-rendering for the landscape, I noticed that using a ring buffer completely eliminated GPU stalls. It might be worth considering applying this principle to SkinInstance in the engine.

https://github.com/playcanvas/engine/blob/4619f0ec5c8b6975aab626edebc0067be5395a75/src/scene/skin-instance.js#L68

    ...
    currentTextureIndex = 0;
    ...
    get boneTexture() { this.boneTextures[this.currentTextureIndex]; }
    ...
    uploadBones(device) {
        this.boneTextures[this.currentTextureIndex].upload();
    }

    updateMatrices(...) {
        this.currentTextureIndex = (this.currentTextureIndex + 1) % this.boneTextures.length;
        ...
    }
...

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in src/scene/skin-instance.js around the referenced bone texture state, especially boneTexture, uploadBones, and updateMatrices. Trace how SkinInstance updates and uploads its textures, then determine the ring-buffer behavior needed to avoid GPU stalls and verify that the existing skinning path still uses the current texture correctly.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
computer-graphics, performance
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.