summaryrefslogtreecommitdiff
path: root/src/mesa/main/light.h
diff options
context:
space:
mode:
authorKeith Whitwell <keith@tungstengraphics.com>2001-02-06 04:06:34 +0000
committerKeith Whitwell <keith@tungstengraphics.com>2001-02-06 04:06:34 +0000
commitd1baa05439c7157eeca42ec191d5375821725bdd (patch)
treebfd3ff31b803f177d678ab3b6783b876c1938fec /src/mesa/main/light.h
parent8fd9f1748d12751683cf8039401a7f7f66ab73fa (diff)
Use a lookup table to compute exponents in tnl fogging code. Slightly
clean up the shine table lookup macro.
Diffstat (limited to 'src/mesa/main/light.h')
-rw-r--r--src/mesa/main/light.h11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/mesa/main/light.h b/src/mesa/main/light.h
index f737abf4e4..b39aa002d8 100644
--- a/src/mesa/main/light.h
+++ b/src/mesa/main/light.h
@@ -1,4 +1,4 @@
-/* $Id: light.h,v 1.8 2000/12/26 05:09:29 keithw Exp $ */
+/* $Id: light.h,v 1.9 2001/02/06 04:06:35 keithw Exp $ */
/*
* Mesa 3-D graphics library
@@ -82,13 +82,12 @@ _mesa_GetMaterialiv( GLenum face, GLenum pname, GLint *params );
#define GET_SHINE_TAB_ENTRY( table, dp, result ) \
do { \
struct gl_shine_tab *_tab = table; \
- if (dp>1.0) \
+ float f = (dp * (SHINE_TABLE_SIZE-1)); \
+ int k = (int) f; \
+ if (k > SHINE_TABLE_SIZE-2) \
result = pow( dp, _tab->shininess ); \
- else { \
- float f = (dp * (SHINE_TABLE_SIZE-1)); \
- int k = (int) f; \
+ else \
result = _tab->tab[k] + (f-k)*(_tab->tab[k+1]-_tab->tab[k]); \
- } \
} while (0)