XNA Creators Club Online
Page 1 of 1 (3 items)
Sort Posts: Previous Next

Observations / questions on material properties in Blender FBX -> XNA

Last post 04-14-2008 9:35 PM by Tackemon. 2 replies.
  • 04-12-2008 5:50 PM

    Observations / questions on material properties in Blender FBX -> XNA

    I'm an XNA noob that's mostly been playing with 2D stuff (finished an Asteroids game with rendered sprites a couple of weeks ago), and I've just now started messing around with 3D stuff.

    My first couple of simple models exported from Blender as FBX files and imported into XNA seemed to work just fine.  But as soon as I tried using some BasicEffect lights (rather than default lighting), I noticed some issues.  Basically, I was either getting an emissive effect or totally black shading.

    After a bit of experimentation, I discovered that the Blender FBX exporter was using the reflection value in Blender (it defaults to 0.8) as an EmissiveFactor property in the FBX file.  And it was sticking a DiffuseFactor of zero in there too.  Changing the DiffuseFactor to 1.0 and the EmissiveFactor to 0.0 in the FBX file or just removing the lines fixed the issues.

    I did try that XNA tweaked version of the FBX exporter that's out there for better animation support, but it's got the exact same logic for generating both of those material values.

    I ended up tweaking the FBX exporter script to simply not generate either of those lines.  (and while I was in there, I changed the RelativeFilename prefix to default to "..\Textures\", so no more manual editing of the FBX file)

    So at this point if I used my tweaked exporter script, things appear to be OK.  I'm curious why this isn't mentioned in any of the Blender -> XNA tutorials and why this doesn't seem to be discussed anywhere though.  Maybe someone with more experience can shed some light on this?  I guess it just seems like I'm missing something obvious here. :)

  • 04-12-2008 7:24 PM In reply to

    Re: Observations / questions on material properties in Blender FBX -> XNA

    Thanks for this, would you mind emailing me the script you put together, I will forward it onto the author and see if he could add the changes, or at least intergrate them.

  • 04-14-2008 9:35 PM In reply to

    Re: Observations / questions on material properties in Blender FBX -> XNA

    OK, I e-mailed it to you.  What I've done isn't a general purpose "fix" or anything - it's really just a quick hack to deal with the issue for now.  At some point I might look into what it would take to have more sensible values carry over, but I don't see that I'll need either of those any time soon.
Page 1 of 1 (3 items) Previous Next