

You could give each vertex of the terrain additional values to tell the shader how much % of each texture should be visible at that point. Therefore most games are using shaders to mix/blend between tiles.Ĭurrently you can use 8 textures in a single shader. But otherwise you might end up drawing hundreds of transitions (and you need a huge atlas texture to fit everything inside it). If you have only a few surfaces, or no "natural" textures, this might not be a big problem. I'm not sure, but I think older games like GTA1/2 did it like this.īUT, if you want smooth transitions (grass to sand, sand to gravel, and so on), you have to draw all possible transitions on that "atlas" image. No difficult shading, no blending, and only 1 texture is used to render the entire terrain.

By shifting the texture coordinates, you can assign 1 tile to each quad on your terrain.

Inside this big image, all tiles are placed. The most simple way is to make 1 big "atlas" texture. The further away the terrain, the less detail(polygons) it gets.Īs for the tiling, this also depends on the quality you want to have. But if your terrain is really huge (or very detailed), you should look at ROAM algorithms like suggested earlier. I think a modern card can render hunders of thousands polygons without a sweat when using VBO's. Or use Vertex Buffer Objects (VBO) for a more optimized approach. If your terrain is relative small/undetailed (less than ten thousand polygons or something), you can just render the whole thing on a normal way. >1) If I decide to use a tile-based system, would this be the most efficient way to draw the terrain?ĭepends on your implementation of course. It will give you a huge jump in the right direction, and you can start learning how to make a game instead of making a renderer. It's not quite "free" like Ogre, but it won't cost you anything right now. Read some terrain tutorials and learn a little about them. There are many many more problems you need to solve. You will learn a lot making a terrain engine, but you will also be years away from producing a game. If your goal is to create an RPG, you may be on the wrong track. I admit that I am building one right now. A lot (or perhaps all) graphics developers do one. Check it out.Ĭoding a terrain engine is fun. Geoclipmapping is the modern way of getting this done. It can be more efficient to send a flat grid of vertices to the graphics card, and displace them once per frame using a vertex shader. The FPU doesn't really mind so many vertices any more. There are algorithms to reduce the number of vertices, such as adaptive meshes. A vertex array is not the most efficent way of delivering them to the GPU. Yes, there is a regular grid of vertices, and you displace the height value based on the texture.
