PropertyValue
rdfs:label
  • Buckyball
  • Buckyball
rdfs:comment
  • Drawing lots of textures with OpenGL can be slow, especially if we do it in several passes, or by rebinding textures a lot. That is why we need to pack textures into texture pages, and use several texture units with multitexturing to draw several texture at once. This presents some problems, as Freeciv uses plenty of layers of information, and graphics card today do not have very many texture units. Basically, the number of passes we need to do (redrawing everything) is texture pages / texture units. So the fewer texture pages we need, the better. We can assume that everyone today have 4 texture units on their graphics cards. But Freeciv has many more layers, and we want to finish drawing the terrain with one pass. We do this by rendering many of the possible combinations beforehand and st
dcterms:subject
abstract
  • Drawing lots of textures with OpenGL can be slow, especially if we do it in several passes, or by rebinding textures a lot. That is why we need to pack textures into texture pages, and use several texture units with multitexturing to draw several texture at once. This presents some problems, as Freeciv uses plenty of layers of information, and graphics card today do not have very many texture units. Basically, the number of passes we need to do (redrawing everything) is texture pages / texture units. So the fewer texture pages we need, the better. We can assume that everyone today have 4 texture units on their graphics cards. But Freeciv has many more layers, and we want to finish drawing the terrain with one pass. We do this by rendering many of the possible combinations beforehand and storing them in the texture pages. However, texture pages are not infinitely large, either, we can assume a maximum of 2048x2048 for modern cards, less for older ones, so we need to keep the number of combinations down. We have lots of basic tiles, which we'll call pies, because they taste so good and get cut up into neat triangular slices. The slices again are composed of layers of good tasting textures, where each layer corresponds to one texture page that is applied on the slice. For terrain, the first texture page will contain basic terrain slices. No combinations are created here, making terrain types easily modifiable. The second texture page contains irrigation, farmland and rivers. Since you cannot have irrigation and farmland at the same time, and we have five basic river directions (including origin), the number of combinations here is 3 * 5 + 2 = 17. The third texture page contains road, rail and fortress wall. Since you cannot have road and rail at the same time, and we have 6 basic directions for road and rail (no origin, but each direction has to have the option of going in toward pie center for cities), the number of combinations here is 6 * 2 * 2 = 24. Cities are done in a separate, second pass, added on pies as rectangular textures. The hut, airbase, fallout and pollution specials cannot be combined with cities, and would very much like occupy the larger center of the pie, and are therefore added in this pass. Mines are added in this pass, too, because although you can build both mine and city on the same tile in Freeciv, you only ever see the city (this combination should be considered a misfeature, but that is another matter). Units and their attributes are done in a third, separate pass, also as rectangular textures.