Friday, December 21, 2012

Shaders

Hi all. Most of my time these last few days has been taken up by participating in the LD25 voting and we're leaving to visit the in-laws tomorrow so don't expect any posts for the next week.

I have however started messing around with my old Project Vox renderer though; optimizing it a bit and making the shader a bit more realistic. Times like these I can really appreciate the work done by people like Wollay and Gavan Woolery. I've gotten the engine fairly fast now but I'm not happy with it at all since it takes over 1GB of memory to render a 400x400 map.

Will see if I can do anything about that. Here's a screenshot:


EDIT: VBOs are so last year. I rewrote the engine to use Display Lists that take up a hell of a lot less memory. I have a 1000x1000 map working using only about 300MB of memory.

3 comments:

  1. What is contained in that 1 GiB?

    ReplyDelete
    Replies
    1. Every chunk has a corresponding VBO. The VBO needs to contain the position [x, y, z] of every vertex for every voxel as well as an RGB value to cater for soft shading.

      That's 7 chars (plus one for padding) bringing us to 32 bytes per vertex.

      For a 16x16x16 chunk and taking into account that every voxel has up to 24 vertices we get:
      16x16x16x24x32 = 3MB per chunk.

      Delete
  2. Display lists are actually deprecated in opengl 3.1 and will eventually be removed. So they are actually "so last year", not vbos.

    ReplyDelete