You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Implement morph targets similarly to Source Engine's Flex animation by cloning a model's vertex buffers (instancing) and using vertex_update_buffer_from_buffer() on them to lerp from base flex to target flexes when needed.
This would be difficult to implement mainly because ModelInstances are supposed to be fully garbage collectable and the workflow would be very inefficient - models would need to be exported and converted into BBMOD files for each morph and a new tool would need to be implemented to calculate deltas of vertex positions and normals (maybe even tangents!?) on each vertex buffer from base BBMOD to target BBMOD and output them.
If implemented, ModelInstance would receive a new method morph(name, value) with the following behaviour:
On first call, clones the Model's vertex buffers (and stores the weak reference of the ModelInstance somewhere in order automatically destroy the buffers on GC).
Updates a morph struct containing the value of each morph target defined in a Model.
Use vertex_update_buffer_from_buffer() on every cloned vertex buffer that is affected by the specified morph.
(OPTIONAL) clear_morphs() would get rid of the cloned vertex buffers and all other morph information.
Implement morph targets similarly to Source Engine's Flex animation by cloning a model's vertex buffers (instancing) and using
vertex_update_buffer_from_buffer()on them to lerp from base flex to target flexes when needed.This would be difficult to implement mainly because
ModelInstances are supposed to be fully garbage collectable and the workflow would be very inefficient - models would need to be exported and converted into BBMOD files for each morph and a new tool would need to be implemented to calculate deltas of vertex positions and normals (maybe even tangents!?) on each vertex buffer from base BBMOD to target BBMOD and output them.If implemented,
ModelInstancewould receive a new methodmorph(name, value)with the following behaviour:ModelInstancesomewhere in order automatically destroy the buffers on GC).morphstruct containing the value of each morph target defined in aModel.vertex_update_buffer_from_buffer()on every cloned vertex buffer that is affected by the specified morph.clear_morphs()would get rid of the cloned vertex buffers and all other morph information.