Hi,
I’ve been trying to make a simple 3D game with Monogame 3.5 Windows Desktop (recently upgraded from 3.4), and I’ve been trying to get 3D skinned animations working from .fbx. I’ve sort of gotten bone transforms to work (for some reason Blender has a weird bug when it exports weighted .fbx’s), but the .fbx is still mostly functional when viewed in a .fbx viewer:
Now, overlooking that bug, when I load the skinned model and its armature into Monogame, it looks like this:
I’ve gotten models to load with textures and lighting in the game before (as they were BasicEffects), and you can see a white diamond in the corner for comparison (it’s affected by lighting as it should be), but SkinnedEffect seems to be missing the LightingEnabled option, and even if I do the following:
effect.World = Matrix.CreateTranslation(Vector3.Zero);
effect.Projection = MainGame.drawEffect.Projection;
//effect.LightingEnabled = MainGame.drawEffect.LightingEnabled;
effect.EnableDefaultLighting();
effect.DiffuseColor = Vector3.One*10f;
effect.FogEnabled = false;
//effect.PreferPerPixelLighting = true;
effect.DirectionalLight0.Enabled = MainGame.drawEffect.DirectionalLight0.Enabled;
effect.DirectionalLight0.DiffuseColor = MainGame.drawEffect.DirectionalLight0.DiffuseColor;
effect.DirectionalLight0.Direction = MainGame.drawEffect.DirectionalLight0.Direction;
effect.DirectionalLight0.SpecularColor = MainGame.drawEffect.DirectionalLight0.SpecularColor;
effect.DirectionalLight1.Enabled = MainGame.drawEffect.DirectionalLight1.Enabled;
effect.DirectionalLight1.DiffuseColor = MainGame.drawEffect.DirectionalLight1.DiffuseColor;
effect.DirectionalLight1.Direction = MainGame.drawEffect.DirectionalLight1.Direction;
effect.DirectionalLight1.SpecularColor = MainGame.drawEffect.DirectionalLight1.SpecularColor;`
It still appears perfectly black.
Also, on an unrelated note, but how would I go about reading animations from my .fbx and using them with my model? I’ve been having trouble finding documentation on it (except for “Better Skinned 3D Animations”, but when I try to use that script, it’s unable to cast my Model as a ModelExtra, hence why I’m trying to create my own solution).
Thanks in advance for any help,
- Milun