From: Jacob Lifshay Date: Tue, 11 Apr 2023 06:07:08 +0000 (-0700) Subject: add notes on pow's use in 3D graphics X-Git-Tag: opf_rfc_ls012_v1~8 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d5f837fe00e4f3c9efaeca49fdbb29a0c11fe0df;p=libreriscv.git add notes on pow's use in 3D graphics --- diff --git a/openpower/transcendentals.mdwn b/openpower/transcendentals.mdwn index 86edb7f30..9e6b86118 100644 --- a/openpower/transcendentals.mdwn +++ b/openpower/transcendentals.mdwn @@ -436,6 +436,11 @@ CBRT, POW, POWN, POWR, ROOTN These are simply much more complex to implement in hardware, and typically will only be put into HPC applications. +Note that `pow` is commonly used in Blinn-Phong shading (the shading model used +by OpenGL 1.0 and commonly used by shader authors that need basic 3D graphics +with specular highlights), however it can be sufficiently emulated using +`pow(b, n) = exp2(n*log2(b))`. + * **Zfrsqrt**: Reciprocal square-root. ## Trigonometric subsets @@ -529,6 +534,10 @@ high-performance or correctly-rounding): ASINH( x ) = ln( x + SQRT(x**2+1)) +`pow` sufficient for 3D Graphics: + + pow(b, x) = exp2(x * log2(b)) + # Evaluation and commentary Moved to [[discussion]]