Fast integer log2?

Started by
19 comments, last by Charles B 19 years, 9 months ago
Yes in terrain rendering for instance (say geomipmap with geomorphing), at each vertex or triangle, check if you need to subdivide (higher LOD)

metric error/view distance -> LOD

by doing :

LOD = _log2(err)-_log2(dist); // no need to remove the bias then

Or with more precision :
LOD = _log2(err/dist);

"Coding math tricks in asm is more fun than Java"

This topic is closed to new replies.

Advertisement