hardcoded meshes

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!
Post Reply
psychophoniac
Posts: 101
Joined: Wed Dec 03, 2008 5:33 pm
Location: ger

hardcoded meshes

Post by psychophoniac »

hi,
i looked at the sourcecode of irrklang some days ago and i saw i gives me the possibility to save sound files in "code", so i can hardcode them.
so now i had the idea of "hardcoding" meshes, something like saving them in a string and load them from there then, maybe write a converter, wich makes a scenenode from it on runtime.
question now is, does this make sense`? one plus would be that you would'nt have to load any meshes from files anymore, and i can imagine that it would load somewhat faster...
and for meshes like a simple bar or a lowPoly model it wouldnt be THAT big...
what do you think? has anyone experience in this?
i love skateboarding!
Lil Margin
Posts: 212
Joined: Sun Jul 19, 2009 4:24 am
Location: Netherlands Antilles, Curacao

Post by Lil Margin »

I haven't tried yet but you can try loading the mesh with irrlicht and then save it to a file and see if that file loads faster then file formats like .3ds,etc
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Post by Acki »

there are some progs out like bin2ascii or bin2hex...
with it you can make text files out of your mesh(es) that you can include to your source code (the BuiltInFont.h is an example of this using a bitmap)...
then it should be no problem to make a memory read file out of it and load the mesh...
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
psychophoniac
Posts: 101
Joined: Wed Dec 03, 2008 5:33 pm
Location: ger

Post by psychophoniac »

yes, this is what i mean. the question was if i would somehow benefit from it ( besides having no more seperate mesh files...)?
i love skateboarding!
Katsankat
Posts: 178
Joined: Sun Mar 12, 2006 4:15 am
Contact:

Post by Katsankat »

ASCII is inside the exe, thus loaded by the exe loader of the OS and duplicated in memory! However for my last demo I grouped several files as a single zip; for security reasons not performances or memory. From the performances point of view it avoids to read on hard disk, expensive system calls (relatively expensive)... But well... loading time is done for this.
psychophoniac
Posts: 101
Joined: Wed Dec 03, 2008 5:33 pm
Location: ger

Post by psychophoniac »

ok thanks, thats what i want to know.
i love skateboarding!
Post Reply