I am trying to make a minecraft clone (sorry, I know lots of people do this), and I've been using polyvox to manage my terrain data. This is what I've been able to come up with:
http://s11.postimage.org/3wwax7ryr/image.jpg
I'm actually looking to create something along the lines of this:

That's from the Accidental Noise library's entry about minecraft terrain generation on their website.
The BasicExample from the PolyVox examples also features something like this.
The shadows in my code look really weird. Do I have odd color parameters that create this weird look, or did I do something else? I'll try to post relevant code:
Code: Select all
E_DRIVER_TYPE driver;
if (render == "Direct3D 8")
driver = EDT_DIRECT3D8;
else if (render == "Direct3D 9")
driver = EDT_DIRECT3D9;
else if (render == "OpenGL")
driver = EDT_OPENGL;
else
driver = EDT_SOFTWARE;
IrrlichtDevice* device = createDevice(driver, dimension2d<u32>(resx,resy), 32, fullscreen, true, false, 0);
ISceneManager* smgr = device->getSceneManager();
IVideoDriver* vdri = device->getVideoDriver();
IGUIEnvironment* gui = device->getGUIEnvironment();
ILightSceneNode* light = smgr->addLightSceneNode(0, core::vector3df(0,256,0),
video::SColorf(1.0f, 0.6f, 0.7f, 1.0f), 800.0f);
Code: Select all
smgr->setShadowColor(SColor(150,0,0,0));
for (int x = 32*-2; x < 32*2; x+=32)
for (int y = 64; y < 128+32; y+=32)
for (int z = 32*-2; z < 32*2; z+=32)
{
SMesh* mesh = worldman->generateMesh(Region(x,y,z,x+32,y+32,z+32));
IMeshSceneNode* node = smgr->addMeshSceneNode(mesh);
node->setMaterialFlag(video::EMF_LIGHTING, true);
node->setMaterialFlag(video::EMF_BACK_FACE_CULLING, false);
node->setPosition(vector3df(x,y,z));
}
I use a nested-for loop to generate the chunks, and I get about 30-40 fps with this, but its still only a few chunks:
Code: Select all
for (int x = 32*-2; x < 32*2; x+=32)
for (int y = 64; y < 64+32; y+=32)
for (int z = 32*-2; z < 32*2; z+=32)