Mesh Loading

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

I would advise making all your necessary things seperate files and then using IrrEdit to bring them together and loading the resulting .irr file into your game. It's the whole point of IrrEdit and it's a very common practice and saves a lot of time and effort.

It looks like you've got a stack of tyres there on the course. If you then wanted two stacks of types with your approach that would make your .b3d file larger and more complicated with the added tyres but if you used IrrEdit you'd just have one .b3d for one stack of tyres and then place multiple copies of it (multiple nodes) and it would just save on disc space and performance too probably...

If all the polys are in one scene node then they may all have to be rendered every single frame (unless you use something like and oct tree node but they're probably not perfect...). If you've got the tyres as a seperate node to the ground then when the tyres can't be seen by the camera they won't be rendered and you'll get a better frame rate. I'm sure it's find with your current setup of the ground and one stack of tyres but i'm sure you'll add more things around the edges of the track and then that'll just be more stuff that has to be rendered every frame rather than only those bits that are actually visible.

Feel free to do what you want, continue down the difficult path of trying to get the group information out of the single .b3d file, this is just advice that might help you out.

My final comment will be that you seem to be thinking as a modeller rather than a games programmer.
Image Image Image
xray
Posts: 231
Joined: Fri Feb 02, 2007 1:06 pm
Location: Germany, Munich
Contact:

Post by xray »

Ok thanks JP for your comment, I will try the .irr solution!
JP wrote: My final comment will be that you seem to be thinking as a modeller rather than a games programmer.
When you are working alone on a games project than you have to think as a modeller and a programmer... and sometimes you are more to one side than the other.
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Post by Acki »

this reminds me on an idea I have, but not done yet...
the idea is to get all the mesh buffers from a mesh, check what texture is applied to them and create the collision materials (for Newton) depending on the texture the mesh buffer has...
I had this idea when I created my own maps for "Tactical Ops"...
the editor (basically the UT editor) does it the same way, you assign materials to the textures... ;)
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
Halifax
Posts: 1424
Joined: Sun Apr 29, 2007 10:40 pm
Location: $9D95

Post by Halifax »

Acki wrote:this reminds me on an idea I have, but not done yet...
the idea is to get all the mesh buffers from a mesh, check what texture is applied to them and create the collision materials (for Newton) depending on the texture the mesh buffer has...
Yeah, that would be beneficial. It's like a unified material system. I did this as well, but also included sounds with the materials.
TheQuestion = 2B || !2B
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Post by Acki »

Halifax wrote:but also included sounds with the materials.
right, I forgot to mention this, I also thought about this... ;)
(the UT editor does this as well)
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
dlangdev
Posts: 1324
Joined: Tue Aug 07, 2007 7:28 pm
Location: Beaverton OR
Contact:

Post by dlangdev »

Acki wrote:
Halifax wrote:but also included sounds with the materials.
right, I forgot to mention this, I also thought about this... ;)
(the UT editor does this as well)
Acki: Do you use the UT editor (UnrealEd) T3D or UTM file format? Just wondering. I'm looking for the spec, maybe you can send it to me. I want to play around with UnrealEd sometime later.

Thanks.
Image
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Post by Acki »

dlangdev wrote:Do you use the UT editor (UnrealEd) T3D or UTM file format? Just wondering. I'm looking for the spec, maybe you can send it to me. I want to play around with UnrealEd sometime later.
I used "TO:AoT Ed 2.0" (year 2002), it's UnrealEd with modifications for "Tactical Ops - Assault on Terror"...
The map format (extension) is "UNR"...
Unfortunately I have no spec for it, but I know how to create everything that's possible, I just need to dig it out from the deep of my head !!! ;)
but remember I know this all for "TO:AoT", so if you want to create maps for another game, then for sure there are other actors that I don't know...
but the basics should be the same, anyways... :lol:

so if you need help with it then feel free to ask me via eMail !!! ;)
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
xray
Posts: 231
Joined: Fri Feb 02, 2007 1:06 pm
Location: Germany, Munich
Contact:

Post by xray »

JP wrote: I would advise making all your necessary things seperate files and then using IrrEdit to bring them together and loading the resulting .irr file into your game. It's the whole point of IrrEdit and it's a very common practice and saves a lot of time and effort.
I tried this but without success. First I saved all meshes out of giles to seperate b3d files and loaded them into irrEdit. But first thing ist that they dont appear at the right position as I exported them out of giles. I rechecked them seperately in giles to make sure the position was exported right, and they did. Second problem is that when I want to load the exported .irr scene into irrlicht, it crashes with the error "file format seems to be unsupported"

By the way to my actual question, if the mesh buffer is limited to an amount of vertices?
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Yes, the current stable SDK is limited to 65535 vertices per buffer.
You have to load the .irr file via loadScene, check tutorial 15.
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

yeah smgr->loadScene to load the .irr file.

when you load things into irredit it often chooses seemingly arbitrary positions to place them rather than at the origin but each model can then be positions by moving it around with the mouse (grab the axes arrows on it and move) or by setting its position in the properties tab. If you've exported them from giles in specific locations then i guess you can just set all their positions to 0,0,0 and they'll all line up nicely, if not then just rearrange them as necessary!
Image Image Image
xray
Posts: 231
Joined: Fri Feb 02, 2007 1:06 pm
Location: Germany, Munich
Contact:

Post by xray »

Ok thanks, I will try this. But one more question: when I loaded the .irr file over loadScene, how can I access to a specific node ? for example the asphalt street or something else...
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Give the separate nodes a distinct name in the .irr file, then you can access the nodes via the name. If you want to enumerate all nodes loaded and do somethign with kinds of nodes check tutorial 15 (in SVN/trunk) which shows how to do stuff with .irr files. Also in SVN/trunk we have a new callback method which is called after a new node is loaded, so you can check each node for certain properties already on load.
Post Reply