Blender to XNA: Skinned Model Renders Black

Started by
18 comments, last by oxiyoxi 11 years, 6 months ago
If I am correct, removing the TEXCOORD from the effect and he texture from the mesh would result in a flat grey model, right? Well I am highly certain the problem is with Blender, anyway. How else would the standard dude.fbx work where my own won't? Also, it seems that despite my program recognizing SkinnedEffect, it's not in my project! I don't get it. I thought SkinnedEffect was a custom MS effect and came with the sample...
Advertisement
Will someone please take a look at my .blend file (linked above) and see if I am doing something wrong?
Try the following to debug the problem:

  1. Add a breakpoint during the render of your model, check that the texture is actually loaded in the first place.
  2. Make sure when you export your FBX file through blender that you tick the option: XNA Strict Options
  3. As your model is skinned, make sure that the textures are placed where XNA expects them, you can check this by opening up the fbx file and looking for the texture references.
  4. Make sure (and I know this is obvious but it's worth checking) that you have UV mapped your mesh and not just applied a texture material, because generated UV's don't automatically export.
  5. If none of the above fix the issue, then it's possible there is something wrong with the rendering code you are using, if you are using a custom shader to display
    the model, let us see what you have so that we can better help. If you have your own lighting system, perhaps the model is simply not being lit.

Hope this helps, and keep us up to date on your progress.

Aimee

We are now on Tumblr, so please come and check out our site!

http://xpod-games.com

Thanks for your reply.

1: I may be using custom code, but even using the Skinned Sample by MS with no changes other than the model and animation name strings, it stays black.

2: I am always sure to correctly export the model.

3: My texture is placed in the right spot and when it isn't, VS complains like it is supposed to.

4: Wait... Blender doesn't export my UV map? I did make my own... This sounds like a part of the problem, but I don't know...

5: Similar to 1.

EDIT: My models did work ok with Blender 2.6, whereas now I am using 2.63a. Is this an issue?
I use Blender 2.59 so I'm not sure if the issue is there.
Things that you may want to keep in mind: The SkinnedModelProcessor is not where the problem is. Something seems to be up with the way Blender prepares textures in your model upon export.

I opened your Blend file, scrapped the extra textures, and just exported the Steve mesh with one texture. In XNA he appears tiny (probably just the size the model was made) and indeed appears black. Then it hit me... Did you choose to pre-multiply Alpha in your texture processor? My guess it's set to True by default in the Skinned sample. Try turning it off. Had the same problem when I dug up an SSAO shader I made many months ago and for some reason the randomized normals texture was rendering in black making the AO look weird. The alpha channel of the texture was black, so I had to disable pre-multiply alpha to get it working again.

New game in progress: Project SeedWorld

My development blog: Electronic Meteor

Ok, how do I turn this off?
Here's how.

With this window open, click on the little arrow or plus sign next to Content Processor and then you should see an option called "Premultiply Texture Alpha". Set it to false.

New game in progress: Project SeedWorld

My development blog: Electronic Meteor

Thanks. Will try after work and edit with results.

EDIT: Setting the pre-multiply alpha setting on either the model or the texture didn't work...
Not even removing all transparency options in Blender works...
Just wanted to follow up on this as it seems you haven't solved the issue yet, and I needed a break from just writing shader code for our tech featuring at eurogamer expo this year lol. Just now I grabbed your blend file and had a poke around, seems that you have unwrapped the mesh, but you have not yet coupled a texture to the UV's, so heres what I did, I loaded a basic texture I had in edit mode while the UV's were visible, then went to the texture properties tab, scrolled down to Mapping -> Map and chose UVTex so that the UV's were properly assigned.

After that I exported as I mentioned, and it works fine, to prove it here is a screenie of your model running in our engine Phobius (this is an XNA engine):

stevehpx.jpg

The issue is entirely down to making sure that your model is properly UV mapped, so try have another pop. If you still have problems PM me and I'll send you the modified blend file so you can see what I did.

Aimee.

We are now on Tumblr, so please come and check out our site!

http://xpod-games.com

I have the same problem,Please send your modified blend file for me,thank you very much~
i still didn't figure out this problem~

This topic is closed to new replies.

Advertisement