Logarithm with any base in PS3.0

Started by
1 comment, last by simonjacoby 13 years ago
Hi,

the topic says it all. Does anyone know a trick so that I can (efficiently) perform a logarithm with any base using only the instructions available in pixel shader 3.0? Basically I want an inverse of pow(x,y).

Afaik in PS3.0 there is only log, log10 and log2 which performs logarithm of bases e, 10 and 2 respectively, but no general version that can perform for any base.

Any ideas are very much appreciated!

/Simon
Advertisement
log_b(x) = log(x)/log(b)
Great, thanks!

Now that I see it, I vaguely remember that from math class years ago ;)

Thanks again :)

/Simon

This topic is closed to new replies.

Advertisement