This topic has been transferred to this forum: Prog Temp Test.

|
Author Topic:   Texturing
LDA Seumas
unregistered
posted August 26, 1999 12:15 AM           
Tread Marks textures its landscape in a different manner than most 3D polygon based landscape engines I've seen. I didn't know what the techniques were called at the time, but it basically uses "unique texturing" and "detail texturing".

Unique Texturing is where every texel in the world database is used exactly once, or to put it another way, every point of every surface in the world has a texel in a texture map uniquely assigned to that point and only that point. This allows for lighting and other effects to be "baked in" to the texture map, since that modified texel is used exactly once. You can't bake lighting in when using repeating textures, since any changes would show up on multiple pieces of geometry.

Detail Texturing is the process of subtly blending an extra high resolution texture, which is often small and infinitely tiling, over top of a larger texture to add apparent detail, either using a second rendering pass or multi-texturing hardware.

Tread Marks uses a color texture which is at the same resolution as the height map, of 1 texel per square meter. You can see this texture raw by turning off Detail Texturing on the terrain. As you'll see, it's rather blurry, and looks artificial. The detail texture is a tiny, high res, subtle texture which is blindly tiled over the entire landscape to add roughness. It sounds a bit cheezy, but the results are plainly good.

Conceptually, this is almost the inverse of how Quake renders its world using lightmaps. In Quake, the color textures are high-res and tiling, and the lightmaps are super low res and unique. In Tread Marks, the color texture is super low res and unique, and the detail map is high-res and tiling. The results are you get lighting and detailed texturing in two passes, though if you switch down to one pass for low end machines, Tread Marks still gives you high quality lighting, whereas Quake 3 uses vertex lighting for single pass, but retains the high detail textures.

------------------
-- Seumas McNally, Lead Programmer, Longbow Digital Arts

IP:

MarkBatten
Member
posted August 26, 1999 04:55 PM            
Well, that's quite interesting. Time for me to play the test with Detail texturing on and off to observe the difference. Thanks for the response!
Still, there has to be a way to get (even) better looking terrain. The screenshots of Battlezone 2 and Tribes 2 show that it's possible -- their terrain is stunning. While I fiddle, though, I appreciate knowing how you've approached this issue. Thanks!

IP:

MarkBatten
Member
posted August 27, 1999 10:01 AM            
Seumas - I played the TM Test a good bit last night focusing on the texturing. I must say, even with Detail off, your terrain looks surprisingly good for one texel per vertex. Can I ask how big your terrain is? 256x256?
Also wanted to tell you how impressed I was with how you've handled the "edge of the world" issue; the map seems to cycle data around so that it's impossible to reach the edge, which is a nice touch.

IP:

LDA Seumas
unregistered
posted August 27, 1999 04:04 PM           
Mark,

You could only say it's "one texel per vertex" at the highest tessellation level (10,000 tris, and then only close stuff), at lower levels there are a lot more texels per displayed vertex. Try F5 for WireFrame mode to see the polygons themselves, and to get a good look at how the LOD works.

The current maps are 1024x1024 cells, or about a kilometer square. And thanks, the wrapping world is something I rather like myself. It's pretty easy to do with a height field, and voxel games like Comanche have used wrapping terrains in the past. It works best with fanciful geography though, as not many places in the real world have matching edges at opportune locations.

------------------
-- Seumas McNally, Lead Programmer, Longbow Digital Arts

IP:

Naysayer
New Member
posted August 27, 1999 09:58 PM            
For what it's worth, my last two games (which were basically two generations of the same game) used "unique texturing" for software rendering. (But for hardware rendering, they used lightmaps that were unique, layered on textures that were not necessarily unique, but often were.)

Unique texturing is a good approach because it helps eliminate tiling, and having a bunch of tiled patterns all over the place is a good way to make a scene look artificial.

The thing is, those two games of mine would take major speed hits when doing dynamic lighting on portions of the terrain that were very close; a given explosion might light up 9 or 10 128x128 textures, which would have to be recomputed every frame. Consequently I recommended that people turn off dynamic lighting when running in software mode.

I think that Tread Marks does not have this problem because the texel density is a lot lower. If I understand correctly, there is (effectively) a 1024x1024 texture slapped across the whole world. Since explosions are gonna be small compared to the whole world, the effects of dynamic lighting might be at most, what... 50x50? Not bad at all to do that every frame.

-J.

IP:

LDA Seumas
unregistered
posted August 27, 1999 10:15 PM           
Right, if all 3D cards supported 1024x1024 textures, and could page regions of those big textures in and out of on board ram as needed or not needed for rendering (such as the Permedia-3 does), then I could use one big texture. As it is I cut it into 64x64 texel chunks, which matches the size of my base binary triangle tree blocks, so the rendering process involves binding a texture, and rendering all triangles in two binary triangle trees, then binding another texture, etc.

I don't actually do any sort of dynamic lighting in Tread Marks yet, except for the re-shading that occurs when the landscape is deformed by a crater or hill being generated. I use a lot of additive blended explosion effects, though, which gives the impression of dynamic lighting moreso than plain alpha blended effects. Since I currently do quite a bit of dynamic texture updating for the tread marks with minimal noticeable speed hit, I will add dynamic colored lighting at some point as well. (And shadows too.)

What were those last two games projects of yours, if I might ask?

------------------
-- Seumas McNally, Lead Programmer, Longbow Digital Arts

IP:

ostra
Member
posted September 08, 1999 12:00 PM            
Hi!
I'm new to his board. Seumas, did you tried using vertex coloring for the terrain? Since at the highest tesselation level you have one texel per triangle, why not use vertex coloring? Sure, in regions with lower tesselation, the terrain looks better with the texture applied, but this regions are usually far away from the viewer, so it might not be noticeable. That way, you could have an extra texture pass for the terrain (may be some kind of bump mapping, or another detail texture), or spend the fillrate on other things (trees).
By!
Marco

IP:

LDA Seumas
unregistered
posted September 08, 1999 12:38 PM           
I'm pretty sure Vertex Coloring would not work very well with my terrain. Even though the MAX tessellation has two triangles per height sample, that is only practical on very fast card/computer combinations, and isn't used in the majority of cases. Most of the time, especially in the distance, the triangles get very large, and you can't notice the difference in terrain shape. Try hitting the F5 key to turn on Wire-Frame mode in the Test to see what I mean. If you look at those big triangles, you'll see a lot of lighting detail still present in the texture, though, and you can imagine how flat and ugly they'd look if all that lighting detail suddenly went away.

Also, vertex lighting wouldn't by itself gain me an extra pass. I'd also have to convert my textures to non-unique, repeating textures of a detail sufficient to be able to skip the detail texturing pass. That would just totally change the philisophical direction of the engine, and make it like half the other terrain engines out there. Another thing is that vertex lighting is hard to do well with LOD, as the lighting changes when the triangle mesh changes. With light mapping or lighting baked into a unique texture, the lighting detail and the triangle mesh detail are completely disconnected, which is good, because the two have very different perceived error curves.

------------------
-- Seumas McNally, Lead Programmer, Longbow Digital Arts

IP: