Mesh Combiner

Announce new projects or updates of Irrlicht Engine related tools, games, and applications.
Also check the Wiki
jaeg
Posts: 52
Joined: Thu Jun 28, 2007 11:20 pm

Post by jaeg »

The examples performance is amazing but I'm having trouble compiling it with Code::Blocks. I've got the dependencies right so I'm guessing it's the incompatibilities between languages.
I'm getting errors like:

C:\Users\John\Downloads\Mesh Combiner\CMeshCombiner.h|23|error: `rects' was not declared in this scope|
C:\Users\John\Downloads\Mesh Combiner\CMeshCombiner.h|23|error: `&' cannot appear in a constant-expression|
C:\Users\John\Downloads\Mesh Combiner\CMeshCombiner.h|23|error: `>>' should be `> >' within a nested template argument list|
C:\Users\John\Downloads\Mesh Combiner\CMeshCombiner.h|23|error: `packed' was not declared in this scope|
C:\Users\John\Downloads\Mesh Combiner\CMeshCombiner.h|23|error: `&' cannot appear in a constant-expression|
C:\Users\John\Downloads\Mesh Combiner\CMeshCombiner.h|23|error: `>>' should be `> >' within a nested template argument list|
C:\Users\John\Downloads\Mesh Combiner\CMeshCombiner.h|54|error: `rectangles' was not declared in this scope|
C:\Users\John\Downloads\Mesh Combiner\CMeshCombiner.h|54|error: `>>' should be `> >' within a nested template argument list|
||=== Build finished: 8 errors, 0 warnings ===|
Computer Science Major - Ball State University
Eigen
Competition winner
Posts: 375
Joined: Fri Jan 27, 2006 2:01 pm
Location: Estonia
Contact:

Post by Eigen »

You have to change all >> to > > (with a space between).

Like this:

irr::core::array<irr::core::rect<irr::u32> >
_ph_
Posts: 8
Joined: Tue Aug 24, 2010 10:38 am

Post by _ph_ »

Thanks Lonesome Ducky for your cool special scene node!

This is what i get with 50*50 (so 2500) dwarf :

Image

_ph_
jaeg
Posts: 52
Joined: Thu Jun 28, 2007 11:20 pm

Post by jaeg »

Thanks Eigen. I should probably learn to take a closer look at the error messages. I thought at first it wanted me to turn all >> into just > and well that just made an even bigger mess. I got it working now thanks. :)

This will prove very helpful for my city I've been working on. I've been having a terrible time with all the segments I've been using to form the roads slowing things down this will make things so much easier.

EDIT

I have a question. Can I do my collision detection the same as before or is there a why to do the detection with the combined mesh?
Computer Science Major - Ball State University
pepeshka
Posts: 29
Joined: Wed Jul 02, 2008 8:42 pm

Post by pepeshka »

Awesome work Ducky, thanks!
DGENXP
Posts: 124
Joined: Tue Dec 27, 2005 2:49 am
Contact:

Post by DGENXP »

This is potentially a great piece of code but i find when i compile and run it i get no FPS Boost whatsoever though i tried the examples and they clearly did is there something specific i have to do to get this running at the optimal speed because i fail to see it?
Someone once said A Jack of all trades is a master of none.

Join the Community at the RB3D Forums:

http://www.rpbuilder.org/forum
slavik262
Posts: 753
Joined: Sun Nov 22, 2009 9:25 pm
Location: Wisconsin, USA

Post by slavik262 »

Combining meshes just reduces overhead if there's a large number of meshes, since drawing each individually wastes time. If you have a relatively small number of meshes or a fast processor, the boost may be negligible.
DGENXP
Posts: 124
Joined: Tue Dec 27, 2005 2:49 am
Contact:

Post by DGENXP »

I understand the concept of this the problem is however the source code does not increase the frame rate on my computer - the pair of exe files shows the difference clearly 24FPS on the Scene node 700+ on the combiner file but the code does not seem to increase the frame rate, it is like the scene node one - is there something I need to change in the code to get the Frame rate boost or a button to press to activate it??
Someone once said A Jack of all trades is a master of none.

Join the Community at the RB3D Forums:

http://www.rpbuilder.org/forum
slavik262
Posts: 753
Joined: Sun Nov 22, 2009 9:25 pm
Location: Wisconsin, USA

Post by slavik262 »

Dumb question, but do you have vsync enabled?
Lonesome Ducky
Competition winner
Posts: 1123
Joined: Sun Jun 10, 2007 11:14 pm

Post by Lonesome Ducky »

Less than ~800 nodes will not be a significant speed increase.

For testing it out from the source, there should be a line:

Code: Select all

bool useMeshCombiner = false
set it to true to use it, and vice versa.
jaeg wrote: I have a question. Can I do my collision detection the same as before or is there a why to do the detection with the combined mesh?
It can be done the same way, although it would be wise to turn it into an OctreeMesh to make collision detection faster.
barakatx2
Posts: 14
Joined: Tue Aug 24, 2010 7:00 am

Post by barakatx2 »

This is an awesome library! It saved me a huge headache but I am having one problem with it. I think this might be because I'm combining grids of cubes into one mesh. Can you take a look at this and see if you recognize why there are lines between the tiles? I have tried adjusting the texture padding but the lines do not go away.

Image
pepeshka
Posts: 29
Joined: Wed Jul 02, 2008 8:42 pm

Post by pepeshka »

barakatx2,

I had a similar problem - are you changing your camera's near value? If so, try leaving it default.
barakatx2
Posts: 14
Joined: Tue Aug 24, 2010 7:00 am

Post by barakatx2 »

pepeshka wrote:barakatx2,

I had a similar problem - are you changing your camera's near value? If so, try leaving it default.

Code: Select all

scene::ICameraSceneNode* cam = smgr->addCameraSceneNodeFPS(0,50.0f,0.1f);
cam->setPosition(core::vector3df(0.0f,10.0f,0.0f));
That's all I've done with the camera for the screenshot I took. I checked what the near value is for that camera and it is 1.0. Is that the problem?
Lonesome Ducky
Competition winner
Posts: 1123
Joined: Sun Jun 10, 2007 11:14 pm

Post by Lonesome Ducky »

Try using the tiling texture padding technique, and set the texture padding to a very large amount. This problem haunted me the whole time, and tiling with huge texture padding is the only solution I could find, sorry :cry: . I'll take a look at my code again and see if I can find a better solution, but that's all I can think of for now.

EDIT: If irrlicht has a way of changing MipMap bias, you can change it to a further value as well.
barakatx2
Posts: 14
Joined: Tue Aug 24, 2010 7:00 am

Post by barakatx2 »

Lonesome Ducky wrote:Try using the tiling texture padding technique, and set the texture padding to a very large amount. This problem haunted me the whole time, and tiling with huge texture padding is the only solution I could find, sorry :cry: . I'll take a look at my code again and see if I can find a better solution, but that's all I can think of for now.

EDIT: If irrlicht has a way of changing MipMap bias, you can change it to a further value as well.
Actually, I just tried this without combining all the nodes and just having the nodes separate, and it has the same visual problem. So this has nothing to do with your combiner, sorry! I would still like to figure out why it is doing that though. I will make a new post in the beginner's help section.
Post Reply