engine
engine copied to clipboard
Additional morph target functionality
There is a need currently to call user callbacks during glb loading, to allow users to access custom glb data.
When this is implemented, implement these addition features for morph targets:
- before glb-parser creates new pc.Morph(), we should execute user callback and allow:
- ~~user to specify morph preference (attribute based vs texture based) - perhaps by indicating how many concurrent morph targets should be supported, or by directly selecting the rendering path.~~ - Non longer relevant as vertex attribute based solution was removed in engine V2 https://github.com/playcanvas/engine/pull/6319
- ~~allow user to specify precision of storage of morph targets (could be used for both attributes and textures if supported). Currently it's all stored as floats, but we could consider using half / short / byte storage.~~ We have an option for this when the glb is loaded dynamically: morphPreferHighPrecision
- [x] considering storing vertex_ids (see Morph class) using uint format (webgl2 only) instead of current float format, allowing larger texture limits (currently 4kx4k). Done https://github.com/playcanvas/engine/pull/6319
- we prefer half float texture format currently, to minimise memory and GPU use, but this forces CPU to convert data to half-float format. We need to profile this cost and perhaps prefer float format if this is unacceptably high.