Terrain help

Started by
5 comments, last by chosendl 17 years, 1 month ago
Dear Thread reader, I'm working on a simple multiplayer game wich will be using the terrain engine wich I'm writing right now. The problem is that my litle brother needs to be able to play the game and his computer doesn't do shaders a old geforce 4 mx. I own the book Real Time 3D Terrain Engines but it uses shaders for the texturing. So I tough about a other way to do the texturing and came up with the following idea. I color the terrain vertices acording to the ground type (white = snow, brown = dirt) and then I create a few detail maps for each type and put them in one texture, then I change the texture cordinates per vertex so they use the right detail map. The only problem I came across is that I can't use index buffers becouse every triangle needs different texture coordinates for the detail map, so I wanted to ask. Is it possible to create a different tex coord for every entry in the index buffer, and is it even possible what I'm thinking. Tjaalie, I didn't start programming yet becouse I wanted to know if I was going to slove this issue becouse it would be another unfinshed project of mine.
if (*pYou == ASSHOLE) { pYou->Die(); delete pYou; };
Advertisement
I assume that when you say indexed you mean you are using triangle strips? If this is so, you should use triangleslists instead. This way each triangle will have its own vertices and its own texture coordinates. I have found that the difference in speed between the two is not much.
No I mean index buffers, this way I create a grid of vertices:

* * * ** * * ** * * *


Then I use index buffers to create triangles:

*-*-*|/|/|*-*-*


As you can see the second vertex is used twice, so if the first one is a snow thing and the second one is rock then there will be a problem when the texture the detail texture is like this.

*-------*-------*-------*|       |       |       ||       |       |       || Snow  | Dirt  | Rock  |   |       |       |       |*-------*-------*-------*


They only way to solve this problem I can think of is to only use vertex buffers and use DrawPrimitive but this will take a greater amount of vram and doesn't allow me to create different index buffers for different distances.

Tjaalie
if (*pYou == ASSHOLE) { pYou->Die(); delete pYou; };
*BUMP*
if (*pYou == ASSHOLE) { pYou->Die(); delete pYou; };
tjaalie, I was sitting with a similar problem and an array of completely seperate triangles was the only way around it. Like that you can apply any portion of the texture image (sand, rock, ect.) to any triangle.

Obviously this is more expensive, but what else!?
There must be an other way. How did old games do this? I mean it was possible to do this without shaders and slower cards. Is it possible to use a detail texture and vertex color togetter?
if (*pYou == ASSHOLE) { pYou->Die(); delete pYou; };
I doubt it, perhaps you can use two textures on one vertex, with alpha channels you can fade them into each other, to create a smooth transition, but again this is using seperate triangles. I think i saw age of empires 2 do this.

This topic is closed to new replies.

Advertisement