Closed Arcnor closed 9 years ago
Also, at least one report on the forums: http://www.badlogicgames.com/forum/viewtopic.php?f=11&t=16750&p=73076
We can't do much without a problematic model file. On Nov 25, 2014 11:37 AM, "Edu Garcia" notifications@github.com wrote:
Also, at least one report on the forums: http://www.badlogicgames.com/forum/viewtopic.php?f=11&t=16750&p=73076
— Reply to this email directly or view it on GitHub https://github.com/libgdx/fbx-conv/issues/72#issuecomment-64380525.
I don't think models are the problem (I tried several, and all of them worked with a previous version), but I'm attaching one anyway.
Forgot to mention: with that test FBX, you'll need to replace the textures in the generated G3D[BJ](it's trying to load the psd by default, but I replace that to use the existing jpg)
Please check: https://github.com/libgdx/libgdx/wiki/Importing-Blender-models-in-LibGDX
Also, it is quite common that the materials from Blender export with opacity set to Zero. If you notice your model is not being rendered. Go to the Material in Blender, and below "Transparency" set its Alpha to the desired one (usually 1, for full opacity).
I don't think that's the issue (this model doesn't come from Blender but Maya, it loads properly on FBX Review and as I said, with previous versions of the tools, this and other models loaded properly).
I'll continue investigating when I get the time and reopen this if/when I get the cause.
Thanks.
If you export to g3dj and open the file in a text editor then you'll see the line "opacity": 0.000000
for both materials.
You're right, but still, loading that g3dj with opacity 0, I still can see it using LibGDX 1.4.1, so that doesn't seem to be the issue (or it's a different one)
Ah no, sorry. For that loaded file, I'm doing material.set(new BlendingAttribute(GL20.GL_SRC_ALPHA, GL20.GL_ONE_MINUS_SRC_ALPHA));
and that seems to fix it. I'm testing all the conversions again without that line to see which ones are failing.
Ok, so in the end it seems that the problem is that opacity line. The old version of fbx-conv that I'm using (not sure from when, but the files are dated May 10, 2014) is not adding any opacity line. The newest one is adding that opacity 0.000. However, as I said, I'm also viewing the files on FBX Review and they look fine, so I'm going to check if the FBX really has 0 opacity.
Converting my test FBXs to ASCII FBX and checking the material section, I see two values. TransparencyFactor, set to 1, and Opacity, also set to 1.
So not sure why fbx-conv is setting that to 0.
Then fbx-conv is ignoring the opacity value? What should happen when you have both opacity = 1 and transparencyFactor = 1? Also, when did this behavior changed?
My reasoning about that transparency versus opacity (that of course might be wrong) is that transparency will affect the alpha of the texture in Maya/3dsMAX, and opacity will control the actual opacity of the material. So for example, opaque pixels in the texture wont be affected by the transparency factor, but opacity will affect them.
Afaik there isn't an opacity property in the specification (please link to the docs if you find that it does). Perhaps it's an extended property or converted by the fbx sdk or alike. Nonetheless, the doc on the transparency factor is very clear and doesn't mention textures or alike.
There was a bug in an earlier version of fbx-conv which caused an opacity of 0 not to be exported. This is later on solved by explicitly exporting it if a transparency factor is specified.
Yeah, you're right, it doesn't show on the FBX SDK docs. But it's there when I use the Autodesk FBX Exporter, so I'm not sure what's the deal with that.
For now, I'll just set the opacity to 1 always, and I'll ask the shop where I got this files from to check the transparency there, although nobody has reported this, so I think I'm not going to get anything on that front.
Thank you for your time.
I've tried with the latest precompiled version on Mac and Windows, and all the models I've tried are loading properly, but not showing at all. Tried compiling it myself on Mac and got the same problem.
Tried with the same models with an old fbx-conv binary I had around, and it worked properly, so something must be wrong with the code and the latest version.
Tried everything with LibGX 1.4.1.