Sunday, March 20, 2011

Magically, a YouTube video. Also I really need to learn HLSL.

Made some great progress these last few days.  First off, the obligatory pictures:



As you can see, I've been toying around with my world gen algorithm.  It finally looks somewhat presentable.  It's very heavy on the top side and I'm not generating any caves yet, but it's still really fun to toy around in.
On the technical side, I'm finally generating the mesh more efficiently.  I'm using indexes so I only have to use 4 vertex points instead of 6 to create 2 triangles.  I also had an issue before with generating faces at the edges of chunks.  I was only checking for cubes inside the current chunk, so when I got to the edge the algorithm thought that there were no cubes on the other side and built a face there.  This wasted a lot of memory if there was a cube in another chunk there, so I'm now checking outside of the chunk when I hit the edge.  Before I threw that in there, for 9 chunks with seed 1143 (my test seed) I was drawing 348,552 triangles with 116,184 indexes.  After I fixed that glitch, my triangles went down to 190,812 and indexes down to 63,604.  This lets me add a lot more chunks before running out of memory.

I also fixed a glitch I had with my textures.  Nothing fancy but at least it doesn't look as crappy.  As my title says, though, I really need to learn HLSL.




Until next time..

No comments: