Extreme detail mapping techniques

MisterMayhem

06-03-2008 23:14:50

I've seen an approach in some games where a greyscale texture is used to add detail close up, but fade out at a distance, probably beyond its last useful mipmap. From what I've read, this black and white detail texture averages out to half-values, and modulates the underlying pass, brighter where it exceeds half-value, and darker where it is below. This allows for it to seemlessly fade with distance.

It is a fairly effective approach used by the Torque engine, and I think I've seen it in the PC Halo demo on rocks and things. It is efficient in that it isn't in effect for polys that are far away.

My concern is that a naive approach would have too much overdraw for all the far away polys. I wonder if anyone has dealt with this approach effectively and efficiently? I think it would really add to the already great terrain.

jjp

07-03-2008 10:13:46

Each detail texture you want to use just costs you an additional texture unit. Actually no problem at all to do that efficiently. Though I wouldn't use detail textures nowdays but normal maps.

You could write a shader to start fading out the detail/normal map and make use of the material level of detail to use a technique without the detail/normal map for distant objects. But it might well be that such an optimization isn't even necessary.

MisterMayhem

07-03-2008 14:44:09

Well the issue is that this technique uses tiling to the extreme, so you might have crazy fill rate for far away polys, causing severe impacts.

With well made textures you barely notice the tiling. A shader isn't needed to fade the detail, mip-mapping does this automatically, such that at a distance you can't notice it pop off. the lowest mip-map is probably automatically half-values anyway, losing all the detail.

Yeah normal mapping is another thought, but overkill for what I'm aiming for, and I like what I've seen of this simpler detail mapping.

I guess a shader might be the key to making it efficient, in turning it off at a distance. It seems to be somewhat common approach so I was hoping not to reinvent.

Good point about material LOD. Something to consider.

I'll post here if I find or make something good of it.

jjp

07-03-2008 17:18:31

The fillrate cost increases with the number of texture samples needed for a fragment. It doesn't matter (well, indirectly it does because of caching etc.) if you tile a texture a lot or not. So the cost is the same, regardless how far away the fragment is.