posted May 20, 2000 04:47 AM
Yeah - if a geometry node has no color texture associated with it because the texture tree is shallower at that location, then it uses the texture of its nearest textured ancestor. The texture coordinates must be scaled appropriately.I don't really use a lightmap, the texture is the final illumination, but conceptually, my lighting is just your standard diffuse dot product sampled from a height map. I take the cross product and normalize to find the surface normal from the height map at each texel(performing a square root), do the dot product, and then multiply this illumination by the color texel evaluated at that same point. To conserve memory, I actually don't store the 66x66 height and color fractals, so part of this loop involves generating both of them as well. I have a way of doing all this junk fairly quickly.
On an Athlon 600, it is taking about 1 millisecond to generate the final 64x64 texture which is pretty darn good. (thats like 150 clocks per texel) I am guessing that something funny is going on - either microsoft has implemented 3DNow optimization in msdev, or the Athlon is just a funny and very fast chip. On a P3 600, it takes about 3.5 milliseconds to generate the same texture. Thats about 500 clock cycles per texel, which is unfortunately quite slow.
This is a frame-coherent LOD, so decisions to generate new textures or new grids are always implicit in the split operations.
In any case, I only have enough time to split 1-5 nodes every frame - which is a pretty tight budget. Maintaining full detail with this budget requires a priority model more advanced than typical, and a further seperation of the quadtree that is used for rendering and the quadtree that is stored in memory can help considerably, so that you can eliminate the overhead down to just a texture download. It needs visibility eventually - an overdraw of 3 means you are using at least 3 times as much texture memory as you could be using. (With a perfect mapping and no overdraw, 16 megs of texture memory should be sufficient to texture the full viewing sphere at 800x600)
On current systems, the texture download is slow enough that rapid flicks of the camera are going to result in a noticeable loss of detail - and its hard to completely hide this. But future systems should remove this limitation with the advent of AGPx4 and faster buses and texture download rates. Nvidia says they are going to greatly improve their download rate in NV20.