Sunday, November 30, 2008

Random Transitions and Tiling issues

The latest implementation had seems at the edges of each repeating texture tile possibly due to bilinear filtering. I tried to fix this by offsetting the uv by 1.0 and scaling the actual image down by 2 pixels but this makes the tiles not repeat exactly. Still it is much better than the obvious seams before. I also added a noise texture that I use to randomize transitions between tiles.

Currently my look up table (LUT) only has 5 entries based on altitude only. Eventually I will make one that also incorporates slope.



This is a screenshot of the terrain with the more random transitions. I have 16 texture slots to play with so I will probably mess around with the look up table next before moving on to things like fixing my GLSL normal shading.

Also, something I forgot to mention in my last post was that the height maps are now randomly generated use FBM noise. I create 6 1024x1024 height maps on start up and save them to disk for the next time I run the program because my height map generation algorithm isn't optimized yet and takes a good 10-20 seconds to complete, which adds up when you're adjusting and recompiling frequently. The height maps are named in such a way that they are specific to the seed used for the noise, the size of the map, and the face on the 3D cube.

Saturday, November 29, 2008

Finally got to a good stopping point so here are some pictures of the latest progress.



A textured and shaded planet.



A view from further away with updates frozen.



Wireframe view of planet with updates frozen.

What I've implemented was vertex position and normal sharing between different faces and levels of the quadtree because calculations would be slightly different and you would get seams at the edges of a cube face.

Next I spent some time investigating Ysaneya's subtiling textures using a single texture pack and a slope/altitude look up table

While getting making the Ogre material and glsl shader I happened upon ml278 the 3d Planetary Surveyor which is something very similar to what I'm trying to accomplish! The developer had implemented a version of Ysaneya's subtiling in a glsl and Ogre, so I started with the open source shader he had and tweaked it to make it work in this program.

I still have a small 1 pixel seam around the edges of each texture when they repeat so I have to determine where that's coming from. I also need to add some noise between levels so that the transition isn't so obvious. Then, maybe I'll work on the water and atmosphere, or on the annoying popping effects when the lod levels change.

And, of course, the texture tiling is obvious from far away so I'll need to implement some kind of blurring or dirt map to make it less so.

Sunday, November 9, 2008

Normals Appeased

I finally decided to use the standard mesh layout for height maps instead of the diamond pattern you see in ROAM implementations and the normals now look fine. Before switching to this standard triangle layout I tried several other normal calculation methods, but still got those ugly cross hatches that you see in my previous posts.

Here's what the normals look like fixed:


And the wireframe version:


I still need to cache the vertex normals and tangents for the edges of each mesh to make the transition from large meshes to smaller resolution meshes seamless. Right now there are seams that I had fixed in my previous version that used the diamond pattern mesh.

After I fix that I plan on moving from a static image that is loaded from disk to a random image generated by the program so that I can test different planets.

After getting that working I'll need to fix some issues that come up when calculating normals that are on the edges of two (or three) faces. I will probably do some kind of vertex normal/tangent sharing similar to how I will share edge normals between separate quad tree nodes on the same face.

Here's a cute screenshot I took when debuggin the normals: