[no bug]OBJ loader doesn't check index count

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.
Post Reply
hendu
Posts: 2600
Joined: Sat Dec 18, 2010 12:53 pm

[no bug]OBJ loader doesn't check index count

Post by hendu »

Trying to load the Stanford dragon res3 (converted to obj) happily loads the 150k index file to a u16 buffer and claims it's EIT_16BIT.

I'd expect either an error, an automatic splitting to 65k meshbuffers, or automatic moving to 32bit indices.
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: OBJ loader doesn't check index count

Post by CuteAlien »

I think there's some console-warning, but I agree that this is maybe not enough.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
hendu
Posts: 2600
Joined: Sat Dec 18, 2010 12:53 pm

Re: OBJ loader doesn't check index count

Post by hendu »

http://www.2shared.com/file/GURZl5Ks/dragon2obj.html

This is the model. Also there was no warning.
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: OBJ loader doesn't check index count

Post by CuteAlien »

No warnings, but looks correct here and only seems to have around 23000 vertices. So I don' t think it needs a larger buffer.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
hendu
Posts: 2600
Joined: Sat Dec 18, 2010 12:53 pm

Re: OBJ loader doesn't check index count

Post by hendu »

edit: That's correct, but the index count is huge, near 150k.

edit2: Heh, I'm failing completely here aren't I? Somehow mixed things up and thought it meant the indices were also limited.
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: OBJ loader doesn't check index count

Post by CuteAlien »

Yeah, can be confusing at times :-)
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
hendu
Posts: 2600
Joined: Sat Dec 18, 2010 12:53 pm

Re: [no bug]OBJ loader doesn't check index count

Post by hendu »

Hm, even though I didn't see the bug, wouldn't it still exist if I were to load an OBJ file with over 65k verts?

On a quick glance I couldn't find any such checks in the OBJ loader code.
mongoose7
Posts: 1227
Joined: Wed Apr 06, 2011 12:13 pm

Re: [no bug]OBJ loader doesn't check index count

Post by mongoose7 »

Well, all the OBJs I load have groups and materials. Every group+material is assigned to a new buffer.

I suppose all your OBJs are just grey.
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: [no bug]OBJ loader doesn't check index count

Post by CuteAlien »

Not sure right now where the check is - I only remember getting console warnings when loading .obj files with more than 65k vertices. Probably the check is somewhere in the mesh itself. Automatically using 32-bit indices instead would certainly be a nicer feature, but I think no-one has implemented that so far.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Re: [no bug]OBJ loader doesn't check index count

Post by hybrid »

No, the check is in the driver upon rendering.
Post Reply