SSTU - Shadow Space Technologies Unlimited

SSTU - Shadow Space Technologies Unlimited

98.5k Downloads

Potential Procedural Mesh Rework - Use Skinned Meshes and Baking

shadowmage45 opened this issue ยท 0 comments

commented

It has become apparent that manually creating procedural meshes for fairings/etc is... extremely painful. The existing code works, but is such a mess that it is impossible to do any further development on it.

One thought on how to improve this process would be to use pre-rigged models that use skinned-mesh renderers rigged in such a way as to allow for manipulation of the various edge-loops. Each model could have 2-3 bones (per panel side) that could be moved vertically or rescaled to manipulate each edge loop.

Skinned-mesh renderers can 'bake' a static (non-skinned) mesh to be used by a standard MeshRenderer component; so that in the flight scene the SMRs can be removed in place of something a bit more performance friendly.

A big sticking point on this would be how to handle the multi-panel/split fairings in a transparent manner. These would seemingly need to have pre-compiled models available for each given split # (e.g. 2, 3, 4, 6, etc). Another problematic point is UV mapping -- a pre-rigged model can only use a single set of UVs. This might be mostly okay for fairing use, but might look sub-optimal if used on, for example, the decoupler.

Another point to investigate is if KSP's drag-cube system can deal with the skinned-mesh-renderers properly. Apparently at some point there were some problems with normals interfering with drag-cube rendering or somesuch BS.