Hi J-S --

It seems like the objects would only be invisible if blending is on. If blending is off, then the alpha would essentially be ignored and everything would be visible. I know osgviewer doesn't enable blending, and I suspect osganimationviewer doesn't either. That means blending must be enabled in your model. If that's the case, then it seems like it's being rendered correctly -- invisible.

However, I do agree there might be some confusion in how the fbx plugin is setting the alpha value.

I have an fbx file that I've been doing some work with lately. It renders visible, and Material diffuseColor always has alpha 1.0. So I suspect there is some issue with how your model was created.
   -Paul




Jean-Sébastien Guay wrote:
Hi all,

I've been looking at the FBX plugin over the last few days, and it seems to me that it sets all material diffuseColor to have 0 alpha... So the loaded objects aren't visible. This happens both when loading an FBX file I created myself in Softimage XSI Mod Tool 7.5, and when loading an FBX file downloaded from the net, for example:

http://creators.xna.com/en-US/sample/skinnedmodel

The zip file SkinningSample.zip from the above page contains a dude.fbx file in the directory SkinningSample\SkinningSample\Content. Loading this in either osgviewer or osganimationviewer (recent SVN, updated and compiled yesterday), you won't see anything. If I osgconv it to .osg, I can see that indeed, all Materials have the diffuseColor alpha set to 0. If I just set it to 1 and load that .osg file, everything is visible as it should.

I can see this code in the fbx plugin:

  pOsgMat->setDiffuse(osg::Material::FRONT_AND_BACK, osg::Vec4(
      static_cast<float>(color[0] * factor),
      static_cast<float>(color[1] * factor),
      static_cast<float>(color[2] * factor),
      static_cast<float>(1.0 -
                         pFbxLambert->GetTransparencyFactor().Get())));

Why is it done that way? Are the files I've been using invalid (i.e. setting transparency as if it was opacity or vice versa)? It seems weird to me, since as I said I've confirmed this with both models created in XSI and a model I downloaded from the XNA samples. What models has this been tested with?

BTW, I was using XSI 7.5 Mod Tool with CrossWalk 4.1. Not sure what the sample model I downloaded was created with.

Thanks in advance,

J-S
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to