sugi-cho / Animation-Texture-Baker

頂点の位置と法線を、Texture2Dに保存しておく。ARGBFloatとか、HDR Textureを使用したバージョン
MIT License
792 stars 110 forks source link

How to make multiple animations in 1 single texture #14

Open TrongHieu90 opened 3 years ago

TrongHieu90 commented 3 years ago

Hi, I successfully bake the animation to texture. However, the texture is too long horizontally (2048 pixel) and only a few pixel in height.

Can there be a feature to make the texture as square as possible. Also to put all the animations of the same mesh into 1 single texture. That way most of the space will be used.

Thanks for this great tool.

Ph0t0nX commented 3 years ago

I have seen an article where someone wrote about wrapping the texture pixels, but there was no source code with it. I haven't tried it myself, but I did come up with a method to compress the data into 32 bits which allows for double the vertex count in my project here: https://gitlab.com/lclemens/animationcooker . It uses half the texture memory which is nice, but it's not as good as the wrapping method you suggested if your goal is increasing vertex count.