It's a little disheartening to be spending my time trying to recreate something I did in 3rd year.
I need to create a terrain class for my framework and so went about creating it. However, as with rewriting my framework, I wanted to make improvements to the terrain.
In 3rd year I made the diamond layout (as can be seen in my blog post relating to my 3rd year graphics programming development). I do enjoy being able to avoid if statements where possible, but given time is, as ever, constrained I decided to just go for the more readable if statement to generate the diamond pattern. This time around however, not only do you specify the width and height of the terrain, but you can specify the triangle density of both the width and height. Additionally, the terrain calculate the correct UV coordinates.
I need to create a terrain class for my framework and so went about creating it. However, as with rewriting my framework, I wanted to make improvements to the terrain.
In 3rd year I made the diamond layout (as can be seen in my blog post relating to my 3rd year graphics programming development). I do enjoy being able to avoid if statements where possible, but given time is, as ever, constrained I decided to just go for the more readable if statement to generate the diamond pattern. This time around however, not only do you specify the width and height of the terrain, but you can specify the triangle density of both the width and height. Additionally, the terrain calculate the correct UV coordinates.
The picture shows a 50 x 50 unit grid with 100 triangles along one edge and 50 along the other. It's also clear, due to the high density, that there is a texture (the terrain texture used for my last semester coursework) mapped across the terrain. As with my models last semester, I can assign any number of textures to the terrain class. At the moment it just renders using the basic texture shader but my next task is to correctly calculate the normals, binormals and tangents for each vertex. I had planned on just using one big patch for the terrain, running perlin noise through it and being done. However I'm now considering using a cheeky bit of quadtrees and using those to create a basic LOD terrain system so that I can have a more detailed environment. The framework handles a million vertices at the moment fine, however once I start layering on the next lot of effects the amount of verts I'm rendering will become quite valuable. A quadtree system will also allow me to cull terrain patches that don't need to be rendered. I could also obviously dabble in tessellating the terrain. However if I do, it will more likely be just to break up the geometric look of the terrain.
Once I've got normals calculated for the terrain, I'll run a noise algorithm through it and work out whether I want to pursue the quadtree stuff because it will eat up more of my time. While it would be nice, I need to make sure I can meet the requirements for the actual coursework so it may be I'll want to instead focus on creating the racer that will be a key part of the game. I really hope that I'll be able to make something that resembles a next level version of my PS2 podracing game. Even cooler would be if I can get the track to be procedurally generated which it's likely to be, unless I have to compromise and it's instead a race to a random point on the map. Such a compromise certainly wouldn't be the end of the world, it could still be a cool game, but I'll be disappointed in myself.
Once I've got normals calculated for the terrain, I'll run a noise algorithm through it and work out whether I want to pursue the quadtree stuff because it will eat up more of my time. While it would be nice, I need to make sure I can meet the requirements for the actual coursework so it may be I'll want to instead focus on creating the racer that will be a key part of the game. I really hope that I'll be able to make something that resembles a next level version of my PS2 podracing game. Even cooler would be if I can get the track to be procedurally generated which it's likely to be, unless I have to compromise and it's instead a race to a random point on the map. Such a compromise certainly wouldn't be the end of the world, it could still be a cool game, but I'll be disappointed in myself.