Xmas tree Obj and 3DS meshes not loading all details

You discovered a bug in the engine, and you are sure that it is not a problem of your code? Just post it in here. Please read the bug posting guidelines first.
robmar
Posts: 1125
Joined: Sun Aug 14, 2011 11:30 pm

Xmas tree Obj and 3DS meshes not loading all details

Post by robmar »

Is Irrlicht unable to load more complex meshes, like trees?

Here is a link to an obj file that irrlicht loads but dumps nearly all of the pine needles:- http://www.sendspace.com/file/bgmh37

I tried with 3DS fromat, does the same, and smoothing does not work.

The mesh works fine in Max and Blender.

It would be nice to be able to make a nice xmas tree scene with Irrlicht!

Any ideas welcome!
smso
Posts: 246
Joined: Fri Jun 04, 2010 3:28 pm
Location: Hong Kong

Re: Xmas tree Obj and 3DS meshes not loading all details

Post by smso »

Are there too many vertices for the u16 index type?

See:
http://irrlicht.sourceforge.net/forum/v ... ices+limit

and:
http://irrlicht.sourceforge.net/forum/v ... ices+limit

Regards,
smso
robmar
Posts: 1125
Joined: Sun Aug 14, 2011 11:30 pm

Re: Xmas tree Obj and 3DS meshes not loading all details

Post by robmar »

Thanks for that. The tree has 7 materials, so I guess it must be split into the coresponding groups. I´ll check the counts tomorrow and see.

I guess the U16 index can´t just be changed to u32...?
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Re: Xmas tree Obj and 3DS meshes not loading all details

Post by hybrid »

Well, two things for the u16: You could use the special mesh/buffer type that supports 32bit indices, but the loaders don't. And you don't want to render meshbuffers with more than 10.000 tris, hence no need for more than 16bit indices.
The console would output a warning, though, if you render more than 65k indices.
robmar
Posts: 1125
Joined: Sun Aug 14, 2011 11:30 pm

Re: Xmas tree Obj and 3DS meshes not loading all details

Post by robmar »

Just checked and am getting 1.3 million vertices and the mentioned warning is going to the log.

The tree mesh, which is available on the SendSpace link I listed here earlier, has 7 materials, so its already split into groups/meshes.

I´m not a Blender expert so not sure how to split it further.

Could someone take a look at the obj and advise how best to handle it, editing the mesh or changing irrlicht, then maybe we could make a nice Irrlicht xmas scene... just an idea..
robmar
Posts: 1125
Joined: Sun Aug 14, 2011 11:30 pm

Re: Xmas tree Obj and 3DS meshes not loading all details

Post by robmar »

As every other 3D program and its dog can load this mesh, I would think that Irrlicht should to, and perhaps issue a warning...

I guess I will see if I can increase the indicies to support more vertices in the loaders... happy christmas! :|
mss
Posts: 24
Joined: Mon Oct 29, 2012 6:41 pm

Re: Xmas tree Obj and 3DS meshes not loading all details

Post by mss »

That model has over 1,000,000 vertices and 700,000 faces, and You ABSOLUTELY MAD if you think this is going to work in Irrlicht or any other game engine.

Try using the Sapling add on to make a tree -- It can be turned on in blender:
File -> User preferences -> addons -> Add Curve -> Sapling [X]

I took that model and knocked it down a few hundred thousand polies and re-exported it to obj.

You can download it from http://vital.lcarscom.com/Pine.zip
hendu
Posts: 2600
Joined: Sat Dec 18, 2010 12:53 pm

Re: Xmas tree Obj and 3DS meshes not loading all details

Post by hendu »

It does print a warning:
robmar wrote:Just checked and am getting 1.3 million vertices and the mentioned warning is going to the log.
Yep, same as mss, that model would run seconds per frame.
robmar
Posts: 1125
Joined: Sun Aug 14, 2011 11:30 pm

Re: Xmas tree Obj and 3DS meshes not loading all details

Post by robmar »

The frame rate will be low I know, but if Blender can show it, why not irrlicht.

Your model has the same problem I guess as only the trunk, a couple of branches, and a few needles show when I load it with Irrlicht.
robmar
Posts: 1125
Joined: Sun Aug 14, 2011 11:30 pm

Re: Xmas tree Obj and 3DS meshes not loading all details

Post by robmar »

So I´ve exported the model without the needles and that is within limits.

The plan is to export a few needles as one mesh, then paste em all over the tree, but Blender is hanging when I try to split them.

Too many I guess in one mesh!!! Any Blener experts about?
robmar
Posts: 1125
Joined: Sun Aug 14, 2011 11:30 pm

Re: Xmas tree Obj and 3DS meshes not loading all details

Post by robmar »

So I checked through the Obj loader code, and all vertices are loaded, but the drawing code uses as we know the u16 for indices and faces.

I went thro the code and using a #define, recompiled with u32 for indicies and faces.

The result after loading large 1.3 million vertice meshes was distorted rendering, a few of the vertices were quite wrong.

Maybe I missed an u16 in a for-loop somewhere though! May take a while to go through it all.
Nadro
Posts: 1648
Joined: Sun Feb 19, 2006 9:08 am
Location: Warsaw, Poland

Re: Xmas tree Obj and 3DS meshes not loading all details

Post by Nadro »

1.3 million verts? You have to split this model inside an Irrlicht from smaller parts. How many mesh buffers/materials do You have on Your model? Please don't tell me that just 1 :P

Please remember that renderers in graphic engines are optimized for display smaller tris grups with high performance, 3D Modelling tools are optimized for display high poly models, but not with high FPS.
Library helping with network requests, tasks management, logger etc in desktop and mobile apps: https://github.com/GrupaPracuj/hermes
robmar
Posts: 1125
Joined: Sun Aug 14, 2011 11:30 pm

Re: Xmas tree Obj and 3DS meshes not loading all details

Post by robmar »

well its a tree in this case, so there is the trunk, broughs, twigs, 6 materials for 6 meshbuffers, and 1 massive mesh buffer for all the needles. Total 7.

Should the needles be best separated into two separate meshes, a ring of needles for the ends of all twigs, and a small row of needles that can be duplciated and placed along the sides of twigs?

I´ve done the separation into 21 mesh buffers and its fine, the problem is that sometimes I just want to load some mesh, and not spend time in Blender or whatever with it.

I guess its not critical, its just that so far all other software can load any mesh as long as the system has the memory.
mss
Posts: 24
Joined: Mon Oct 29, 2012 6:41 pm

Re: Xmas tree Obj and 3DS meshes not loading all details

Post by mss »

robmar wrote:well its a tree in this case, so there is the trunk, broughs, twigs, 6 materials for 6 meshbuffers, and 1 massive mesh buffer for all the needles. Total 7.
Should the needles be best separated into two separate meshes, a ring of needles for the ends of all twigs, and a small row of needles that can be duplicated and placed along the sides of twigs?
The needles are double-sided faces, so in order to see them from both sides in Irrlicht you have to disable backface culling per material that is used by the needles.
robmar
Posts: 1125
Joined: Sun Aug 14, 2011 11:30 pm

Re: Xmas tree Obj and 3DS meshes not loading all details

Post by robmar »

did that already. with the tree loaded the FPS takes quite a hit, I guess its just too complex an object to run in real-time well.

I´ve seen some RT 3D that handles trees on large landscapes from that french guy, had thought they were meshes but guess he´s using another technique..
Post Reply