Jump to content

  • Log In with Google      Sign In   
  • Create Account






Block by Block

Posted by studentTeacher, 06 July 2013 · 174 views

voxel rendering openGL chunk terrain procedural project evolution
SO.... I've had a few days to start hammering thing out, and things are going pretty well! Getting the renderer up on line and dealing with window creation and all that stuff was quick, and so I began working on my data structures and algorithms for storing data, optimizing it for rendering, and keeping everything to as little code for a user of the engine to have to type as possible. As of right now, without a World-class coded yet, the run() function looks like this:
void run() 
{
    int w = 640;
    int h = 480;
    Application app(w, h, "Evolution, Pre-Alpha 0.01");
    Renderer r(w, h);

    ChunkManager cm(&r);

    //to-be "world" class...
    for (int x = -5; x < 5; x++) {
        for (int z = -5; z < 5; z++) {
            for (int y = 0; y < 2; y++) {
                cm.createChunk(x, y, z);
            }
        }
    }

    while (!app.getApplicationInputManager()->quit()) {
        app.getApplicationInputManager()->onUpdate();

        //render here

        cm.render();

        SDL_GL_SwapBuffers();

    }
}
Feel's pretty good to me, for a start! The chunks render perfectly, and rendering chunks takes one call per chunk. Once the mesh class is completed, it'll be able to make optimized meshes for each chunk and allow me to start working with complete terrain.

The big problem I'm running into now is occluding hidden faces. Doing a simple back-face culling with openGL and frustum culling has made even a world with 4 billion blocks semi-playable at 20 fps (see photos below), but I still think there is much more I can do in optimizing the renderer.

Wish me luck! I'll be back soon Posted Image

--
ST

Some photo's of the work, runs at 20 FPS:

Attached Image
Attached Image
Attached Image




September 2014 »

S M T W T F S
 123456
78910111213
14151617181920
21 222324252627
282930    

Recent Comments

PARTNERS