Author Topic: Fbx files loaded but nothing displayed  (Read 6267 times)

Peter Yeremenko

  • Jr. Member
  • **
  • Posts: 9
Fbx files loaded but nothing displayed
« on: June 25, 2012, 05:38:56 AM »
Hi! Thanks for for quick reply for my previous question.

I have another problem using Bonzai engine. I have several fbx models with animations. I work with them like described in this thread.

But instead of viewing the objects I see only background of scene. Like I have wrote previously, I've loaded flower_6.fbx model from models pack (http://dexsoft-games.com/models/medieval_free.html). The flower is displayed correctly. Md2 models with animations are displayed correctly too. But my animated fbx models is not displayed.

To check if it is problem of my code, I have tried to display them using Bonzai model viewer with "animated" flag. But there is nothing displayed in viewer too. In viewer bonzaiengine-viewer.jar models displayed very well.

Bonzai is wonderful framework but I assume two possible reasons:
  • Designer provided bad models
  • There is something wrong in Bonzai with such type of files

Plesae, look at attached model in bonzai viewer, or otherwise. I would appreciate if you tell me about the reason of misdisplaying of the models.

Thanks in advance.
Peter Yeremenko

Peter Yeremenko

  • Jr. Member
  • **
  • Posts: 9
Re: Fbx files loaded but nothing displayed
« Reply #1 on: June 25, 2012, 05:53:57 AM »
I cannot attach file here, so i've uploaded it onto http://oymo.mooo.com/models/intersection.fbx

jerome_j

  • Administrator
  • *****
  • Posts: 116
    • Bonzai Engine
Re: Fbx files loaded but nothing displayed
« Reply #2 on: June 25, 2012, 09:37:42 AM »
I've tried your fbx using the online web start viewer, and the model is displayed and animated.
It shows a piece of cylinder, a piece of sphere and the intersection of the two (kusok) with skeletal animation.

If your not using the latest dev build, please update. Let me know if you are able to view your fbx properly with jws viewer, but not the viewer in the dev build.

Peter Yeremenko

  • Jr. Member
  • **
  • Posts: 9
Re: Fbx files loaded but nothing displayed
« Reply #3 on: June 25, 2012, 10:27:51 AM »
I've just tried to use viewer from latest build, but result is the same. I also can view model in Windows 'fbx viewer tool', via bonzaiengine-viewer.jar at Windows 7 and Ubuntu. But both dev and stable builds of BonzaiEngine-ModelViewer.apk doesn't show anything

p.s. On the downloads page i found "Latest/Next changes: 1.2.5 build 2012-06-23" header, but links in "dev release" section date from the 2012 May 26th.

jerome_j

  • Administrator
  • *****
  • Posts: 116
    • Bonzai Engine
Re: Fbx files loaded but nothing displayed
« Reply #4 on: June 25, 2012, 01:58:06 PM »
I can't test right now with the last dev build (I'll give a look this evening), but with our last code it works fine on both android and desktop.

"Latest/Next changes" are features already implemented and which will be available when a new build will be made.


jerome_j

  • Administrator
  • *****
  • Posts: 116
    • Bonzai Engine
Re: Fbx files loaded but nothing displayed
« Reply #5 on: June 25, 2012, 07:34:47 PM »
I have just tested with the build 26-05-2012, and your fbx is working properly.
Are you sure you're using last dev build ? Which jar are you using and the size in octets ?

If you're converting into jmf format, they was a bug in the jmf reader of 26-05-2012. In that case, use the today's build: 1.2.5 25-06-2012.
« Last Edit: June 25, 2012, 07:37:03 PM by jerome_j »

Peter Yeremenko

  • Jr. Member
  • **
  • Posts: 9
Re: Fbx files loaded but nothing displayed
« Reply #6 on: June 26, 2012, 06:02:34 AM »
Hi, Jerome

I have done all the instructions, but everything remained as before. Here is the link to video with my attempts (because I can't realize why there is nothing displayed in the viewer): http://oymo.mooo.com/models/MOV_0380.mp4

0) Sorry for russian UI of my phone.
1) I've installed Bonzai viewer apk from latest build http://bonzaiengine.com/downloads/download.php?id=be-dev&url=BonzaiEngine-1.2.5-25062012.7z
2) I've opened intersection.fbx, the same, which was mentioned in second post
3) But there's nothing on the screen

Please, tell where I was wrong.
« Last Edit: June 26, 2012, 06:16:26 AM by Peter Yeremenko »

jerome_j

  • Administrator
  • *****
  • Posts: 116
    • Bonzai Engine
Re: Fbx files loaded but nothing displayed
« Reply #7 on: June 26, 2012, 09:49:23 AM »
The model is properly loaded, as you can see it list the animation in the bottom left combo.

There's possibly some shader compilation error which break the rendering. In that case, it's possibly due to the skinning matrices which takes too much spaces in the current shader.
To be sure, can you open the log panel and copy / paste the full text in the forum (or a video if it's easier for you) ?

Peter Yeremenko

  • Jr. Member
  • **
  • Posts: 9
Re: Fbx files loaded but nothing displayed
« Reply #8 on: June 26, 2012, 10:27:29 AM »
when I'm trying to display model using BE-Viewer it writes in log this data:

The same I have in android logs when trying to display model in my application:

jerome_j

  • Administrator
  • *****
  • Posts: 116
    • Bonzai Engine
Re: Fbx files loaded but nothing displayed
« Reply #9 on: June 26, 2012, 10:57:55 AM »
Thanks, looks like to confirm what I've expected. I will make a new build soon with a better compatibility of skinning with more android devices.

In the meantime, you can use cpu skinning as a workaround. This will be much slower, but you'll be able to render the model in the meantime of the new build.
To test in viewer, open shader panel and uncheck hardware skinning (it's not easy to access it on a phone, but you should in landscape mode). By code:
Quote
ShaderGeneratorConfig config = new ShaderGeneratorConfig();
config.skinningEnabled = false; // Skinning in cpu
ShaderGenerator generator = new ShaderGenerator(config);

Edit: As an alternative, you can also run your model throught the Optimizer which will optimize skinning and will fix the shader problem for this model.
One way to do that is during the model reading (not the best, better will be to convert fbx in jmf and run optimizer during jmf writting):
Quote
ModelReaderSettings options = ...;
options.optimizer = Optimizer.getBestOptions(true);
« Last Edit: June 26, 2012, 01:14:49 PM by jerome_j »

Peter Yeremenko

  • Jr. Member
  • **
  • Posts: 9
Re: Fbx files loaded but nothing displayed
« Reply #10 on: June 27, 2012, 05:52:27 AM »
Thank you a lot! It solves the problem. Especially converting to jmf format - works very fast!

jerome_j

  • Administrator
  • *****
  • Posts: 116
    • Bonzai Engine
Re: Fbx files loaded but nothing displayed
« Reply #11 on: July 08, 2012, 04:18:29 PM »
Great !

I've made a new build today (1.2.5 08-07-2012) which improve compatibility of shader.
The best is to use jmf and keep the default value of skinningEnabled (ie true).Anyway, if you have time to test, let me know if your original model can now be rendererd in android without jmf conversion.