Mesh Combiner

Announce new projects or updates of Irrlicht Engine related tools, games, and applications.
Also check the Wiki

Re: Mesh Combiner

Postby Lonesome Ducky » Tue Oct 04, 2011 3:03 am

There are countless minecraft clones out there, I'll bet there are at least a few open source ones that you could look at
User avatar
Lonesome Ducky
Competition winner
 
Posts: 1123
Joined: Sun Jun 10, 2007 11:14 pm

Problem on 64-bit machines

Postby Kuzy » Tue Feb 14, 2012 10:13 am

Does anyone have the actual source of the mesh combiner. The newest link is dead...

My mesh combiner crashes on some 64bit-machines while it runs without any problem on any x86 machine.
Does anyone have a clue why?

Thanks in advance
Kuzy
Kuzy
 
Posts: 21
Joined: Fri Feb 18, 2011 10:30 am

Re: Problem on 64-bit machines

Postby RdR » Tue Feb 14, 2012 2:45 pm

Kuzy wrote:Does anyone have the actual source of the mesh combiner. The newest link is dead...


You can find it on the IrrExt project
http://irrext.svn.sourceforge.net/viewv ... hCombiner/
User avatar
RdR
Competition winner
 
Posts: 273
Joined: Tue Mar 29, 2011 2:58 pm

Re: Mesh Combiner

Postby Kuzy » Tue Feb 14, 2012 3:18 pm

Thanks RdR.
Kuzy
 
Posts: 21
Joined: Fri Feb 18, 2011 10:30 am

Re: Mesh Combiner

Postby Kuzy » Tue Feb 21, 2012 8:12 am

My problem with 64bit machines was caused by memory leaks and is now solved with the actual version.
Kuzy
 
Posts: 21
Joined: Fri Feb 18, 2011 10:30 am

Re: Mesh Combiner

Postby pepeshka » Mon Feb 27, 2012 8:18 pm

Hey Ducky,

I've noticed my memory usage shoots up when using the mesh combiner, even with meshes that have a lot of repeated textures. It looks like the project is saving copies of the same texture over and over in the bottom of PackTextures():

cpp Code: Select all
irr::core::stringc textureName = "PackedTexture";
        newTexture = driver->addTexture(textureName, packedImage);
        newTexture->regenerateMipMapLevels();
        textureName += globalPackedTextureCount;
        globalPackedTextureCount++;
        return newTexture;


That's adding a new texture each time with a unique name if I'm not mistaken. Wouldn't it be better to give each packed texture a unique name (based on the textures that went into making it), then retrieve any that have already been saved:

cpp Code: Select all
irr::core::stringc textureName = "PT";
        for (int i = 0; i < textures.size(); i++)
        {
                irr::io::SNamedPath s = textures[i]->getName();
                textureName += textures[i]->getName();
        }
        newTexture = driver->getTexture(textureName);
        if (newTexture == NULL)
        {
                newTexture = driver->addTexture(textureName, packedImage);
        }


I've done this in my project and my memory usage is now just a tad over what it would be without the combiner at all, which is really killer. Do you see any downside to this?
pepeshka
 
Posts: 29
Joined: Wed Jul 02, 2008 8:42 pm

Re: Mesh Combiner

Postby Supanova » Sat Jul 14, 2012 4:42 pm

First off Ducky, this is a great piece of kit, hat off to you my son :D.

The issue we have, is I'm sure something we have done wrong..

We are currently converting an old 2d game, and it's kicking and screaming all the way...

Bit of background... The host sends the client individual tiles, and [6][6] array of how they are orientated. Currently the client takes these individual tiles, shoves them into the 6x6 mesh and lets your combiner take over. Each individual tiles has it's own texture, which are not always the same.

The issue comes with lighting. I've tried normalizing the normals, and rotating the individual tiles every which way on all 3 axis, but it has no effect. In fact the screenie below has the tiles out of alignment....

A perfect example of this is shown below

What can we do to prevent this?

Image
Supanova
 
Posts: 6
Joined: Sun Jun 10, 2012 5:46 pm

Re: Mesh Combiner

Postby shadowslair » Sun Jul 15, 2012 8:21 am

Don`t normalize normals of planar surfaces like the tiles you use, and for better results don`t use per-vertex lighting.
"Although we walk on the ground and step in the mud... our dreams and endeavors reach the immense skies..."
User avatar
shadowslair
 
Posts: 758
Joined: Mon Mar 31, 2008 3:32 pm
Location: Bulgaria

Re: Mesh Combiner

Postby Supanova » Sun Jul 15, 2012 10:26 pm

I'm afraid I've tried your suggestions, but had no positive outcome.

I did find one other post with what appears to be the same problem, however their solution is somewhat vague....


http://irrlicht.sourceforge.net/forum/viewtopic.php?f=1&t=44177

Perhaps someone can explain the solution better?
Supanova
 
Posts: 6
Joined: Sun Jun 10, 2012 5:46 pm

Re: Mesh Combiner

Postby mongoose7 » Mon Jul 16, 2012 12:28 pm

He may have been animating his cubes. Anyway, he was using cubes, not planes. It is probably best to create your own planes - I see that that is what I have done:

cpp Code: Select all
static IMesh *createPlaneMesh(float size)
{
    SMeshBuffer *buffer = new SMeshBuffer();
 
    // Create indices
    const u16 u[6] = { 0,2,1,  0,3,2 };
 
    buffer->Indices.set_used(6);
 
    for (u32 i=0; i<6; ++i)
        buffer->Indices[i] = u[i];
 
 
    // Create vertices
    video::SColor clr(255,255,255,255);
 
    buffer->Vertices.reallocate(4);
 
    buffer->Vertices.push_back(video::S3DVertex(0,0,0,
        0, 0,-1, clr, 0.0, 1.0));
    buffer->Vertices.push_back(video::S3DVertex(1,0,0,
        0, 0,-1, clr, 1.0, 1.0));
    buffer->Vertices.push_back(video::S3DVertex(1,1,0,
        0, 0,-1, clr, 1.0, 0.0));
    buffer->Vertices.push_back(video::S3DVertex(0,1,0,
        0, 0,-1, clr, 0.0, 0.0));
 
    // Recalculate bounding box
    buffer->BoundingBox.reset(0,0,0);
 
    for (u32 i=0; i<4; ++i)
    {
        buffer->Vertices[i].Pos -= core::vector3df(0.5f, 0.5f, 0.0f);
        buffer->Vertices[i].Pos *= size;
        buffer->BoundingBox.addInternalPoint(buffer->Vertices[i].Pos);
    }
 
    SMesh* mesh = new SMesh;
    mesh->addMeshBuffer(buffer);
    buffer->drop();
 
    mesh->recalculateBoundingBox();
    return mesh;
}
mongoose7
 
Posts: 1227
Joined: Wed Apr 06, 2011 12:13 pm

Re: Mesh Combiner

Postby sievi1 » Sun Nov 18, 2012 6:45 pm

Im new to irrlicht and have just got the mesh combiner to work. however i was wondering if there is any way to delete a part of the newly created mesh. lets say that i combine 10 cubes into one mesh but want to delete the central cube. is that possible?
sievi1
 
Posts: 1
Joined: Sat Nov 17, 2012 10:26 am

Re: Mesh Combiner

Postby serengeor » Sun Nov 18, 2012 8:15 pm

sievi1 wrote:Im new to irrlicht and have just got the mesh combiner to work. however i was wondering if there is any way to delete a part of the newly created mesh. lets say that i combine 10 cubes into one mesh but want to delete the central cube. is that possible?

Welcome minecraft cloner.
It is possible, if you make it possible :)
Working on game: Marrbles (Currently stopped).
User avatar
serengeor
 
Posts: 1712
Joined: Tue Jan 13, 2009 7:34 pm
Location: Lithuania

Re: Mesh Combiner

Postby REDDemon » Sun Nov 18, 2012 8:53 pm

lol why no one makes terraria clones ? i'm only terraria fan here? XD.
Junior Irrlicht Developer.
Real value in social networks is not about "increasing" number of followers, but about getting in touch with Amazing people.
- by Me
User avatar
REDDemon
Developer
 
Posts: 1044
Joined: Tue Aug 31, 2010 8:06 pm
Location: Genova (Italy)

Re: Mesh Combiner

Postby ACE247 » Sun Nov 18, 2012 9:03 pm

Hey I liked terraria! :)
But that was quite a long time ago
ACE247
 
Posts: 704
Joined: Tue Mar 16, 2010 12:31 am

Re: Mesh Combiner

Postby JimmyRobo » Mon Nov 19, 2012 12:49 am

sievi1 wrote:Im new to irrlicht and have just got the mesh combiner to work. however i was wondering if there is any way to delete a part of the newly created mesh. lets say that i combine 10 cubes into one mesh but want to delete the central cube. is that possible?


Easy (but slow) way: delete the combined mesh and generate a new one from your world data. If you "chunk" your world (which is how I believe most minecraft style engines work) then you can just detect a chunk-change, destroy it and regenerate it. If its too slow, reduce chunk size or actually remove it from the combined mesh (which should be easy if you have only same-sized cubes. The advantage of chunking is that you can have massively large worlds by only have meshes generated for the visible part you're in.
JimmyRobo
 
Posts: 5
Joined: Sat Nov 17, 2012 3:28 pm

PreviousNext

Return to Project Announcements

Who is online

Users browsing this forum: No registered users and 1 guest