Mesh Combiner
-
- Competition winner
- Posts: 1123
- Joined: Sun Jun 10, 2007 11:14 pm
Re: Mesh Combiner
There are countless minecraft clones out there, I'll bet there are at least a few open source ones that you could look at
Problem on 64-bit machines
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
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
Re: Problem on 64-bit machines
You can find it on the IrrExt projectKuzy wrote:Does anyone have the actual source of the mesh combiner. The newest link is dead...
http://irrext.svn.sourceforge.net/viewv ... hCombiner/
Re: Mesh Combiner
My problem with 64bit machines was caused by memory leaks and is now solved with the actual version.
Re: Mesh Combiner
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():
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:
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?
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():
Code: Select all
irr::core::stringc textureName = "PackedTexture";
newTexture = driver->addTexture(textureName, packedImage);
newTexture->regenerateMipMapLevels();
textureName += globalPackedTextureCount;
globalPackedTextureCount++;
return newTexture;
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);
}
Re: Mesh Combiner
First off Ducky, this is a great piece of kit, hat off to you my son .
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?
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?
-
- Posts: 758
- Joined: Mon Mar 31, 2008 3:32 pm
- Location: Bulgaria
Re: Mesh Combiner
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..."
Re: Mesh Combiner
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/v ... =1&t=44177
Perhaps someone can explain the solution better?
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/v ... =1&t=44177
Perhaps someone can explain the solution better?
Re: Mesh Combiner
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:
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;
}
Re: Mesh Combiner
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?
Re: Mesh Combiner
Welcome minecraft cloner.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?
It is possible, if you make it possible
Working on game: Marrbles (Currently stopped).
Re: Mesh Combiner
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
Real value in social networks is not about "increasing" number of followers, but about getting in touch with Amazing people.
- by Me
Re: Mesh Combiner
Hey I liked terraria!
But that was quite a long time ago
But that was quite a long time ago
Re: Mesh Combiner
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.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?