Jump to content
  • Advertisement
Sign in to follow this  
Grumple

Scaling Skinned Model without using Scale Matrix?

Recommended Posts

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.

Share this post


Link to post
Share on other sites
Advertisement

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...

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!