Thursday, 5 June 2008

Built dungeon areas

Fiddling with the density function for walls to try to get nice big blocks. This may not be that useful in the long run as it's entirely possible that some nice textures will entirely suffice, leaving the density function to handle larger features. Good practise though.

I also changed the way normals are calculated. Rather than using the gradient of the density function, vertex normals are calculated in a conventional manner by averaging the normals of all triangles containing the vertex. This removes many very nasty artefacts caused by the low sampling rate of the mesh generating step. The big problem is that it causes some new artefacts at the borders of mesh chunks, because some of the triangle information is not available.

I could generate extra polys purely for the purpose of sorting out these normals, or I could revert to using the density gradient at the edges of a chunk. Neither option fills me with glee.

Behold, new walls, broken floor, and some visible seams where the normals on adjacent chunks don't match (especially visible where it bisects blocks on the wall to the right). I also boosted the brightness and contrast in this image, for no real reason other than to make everything a bit clearer. I have to say, the first person view feels really pants without a ceiling. I really should try to decide where I'm going and either put the ceiling back, or stop using the free camera.


No comments: