Skip to main content
GameDev.net gamedev.net
🔒 Locked 🎮 Unity

Scaling Skinned Model without using Scale Matrix?

Started by Grumple Nov 17, 2018 at 2:33 PM 2 replies 2.4k views
Original Post
Grumple
Grumple

Hello,

As part of the 'asset pipeline' for my custom engine I've built a model importer using assimp. The goal is to be able to import models from turbosquid, etc, into a proprietary format without having to significantly rework them. It's worked fairly well, but whereas my game is mostly built around 1 unit = 1 metre, I see FBX (my preferred import format) tends to be 1 unit = 1 cm. On top of that I see a lot of assets from the asset stores that look awesome but are bigger/smaller than I'd like, regardless of units of measurement. I'd like to 'pre-scale' these models on import into my own model file format without just using a scale matrix. (other than this import scale issue I don't have need for scaling in the engine, and it can complicate a lot of other systems).

I've spent a week battling blender with my entry-level modeling skills, and can sort of work my way through the crazy unit issues it has with FBX to scale down the based model/armature, but as far as I can tell there is no simple way to just 'apply scale' to animations without a lot of manual work in the graph view.

Assimp has a 'global scale' capability in newer versions, but that seems to just apply a scale transform to the root bone.

Given that I just want to apply a uniform scale to all aspects of the model, it feels like during my model import 'post process', I should be able to just scale the translate of all bone transform/offset matrices, and scale the vertices of all bind-pos mesh data. If I apply the same scale to any location/translate key frames of animations, shouldn't this all 'just work'? That way I could store my models in proprietary/engine format at the scale I want without any screwing around at run-time within the game itself...

Any insight would be greatly appreciated...usually I have no trouble finding lots of good reading about game programming issues, but this seems to be a surprisingly murky subject.

Grumple
Grumple

Just to follow up on this in case anyone is interested...I did a test of the implementation described above and it "seems" to work fine.

After applying uniform scale value to all mesh vertices, and translates of the joint transforms and offset mats, as well as any translate key frames in any animations, things turned out as expected in terms of size changes without (so far) any unexpected problems.

Having said that I've only tested a few models and every time I think I understand all the elements at play with skinned animation I have something new smack me in the face...

orange451
orange451

In your vertex shader, couldn't you skin your mesh normally, then apply the world matrix? Where in the world matrix contains a scale?

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.