guansss / pixi-live2d-display

A PixiJS plugin to display Live2D models of any kind.
https://guansss.github.io/pixi-live2d-display/
MIT License
808 stars 123 forks source link

Model part customization #127

Open Anth155 opened 5 months ago

Anth155 commented 5 months ago

I've rendered a model into my web app, but am having trouble trying to enable a frontend feature that allows customization of individual parts(eyes, hair, shirt.. etc). I have all my model's hairs in a single texture file and it's currently rendering the hair in the top left corner. I think I somehow need to get it to point to the other hairs in the same texture file? End goal is to toggle between different hair selections on my web app for my model, would this be possible?

guansss commented 4 months ago

This can be done by generating texture variations on the fly. For example, you first prepare a texture of alternate eyes, then at the point of switching eyes, you combine the original texture with the eyes texture into a new texture and apply it to the model.

This plugin isn't designed with such scenario in mind, so some workarounds might be needed.