diff options
author | Keith Whitwell <[email protected]> | 2000-11-16 21:05:34 +0000 |
---|---|---|
committer | Keith Whitwell <[email protected]> | 2000-11-16 21:05:34 +0000 |
commit | 23caf20169ac38436ee9c13914f1d6aa7cf6bb5e (patch) | |
tree | 21307f7bbcaf9ee1e841d7e7bee130570a7b5b95 /src/mesa/main/light.h | |
parent | 179516673211a2350e479d5321840291f339f5dd (diff) |
Move the transform and lighting code to two new directories
math: Provides basic matrix and vector functionality that
might be useful to multiple software t&l
implementations, and is used by core mesa to
manage the Model, Project, etc matrices.
tnl: The real transform & lighting code from core mesa,
including everything from glVertex3f through vertex
buffer handling, transformation, clipping, lighting
and handoff to a driver for rasterization.
The interfaces of these can be further tightened up, but the basic
splitting up of state and code move is done.
Diffstat (limited to 'src/mesa/main/light.h')
-rw-r--r-- | src/mesa/main/light.h | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/src/mesa/main/light.h b/src/mesa/main/light.h index 78178f982b8..4c2589fbf47 100644 --- a/src/mesa/main/light.h +++ b/src/mesa/main/light.h @@ -1,4 +1,4 @@ -/* $Id: light.h,v 1.4 2000/10/28 18:34:48 brianp Exp $ */ +/* $Id: light.h,v 1.5 2000/11/16 21:05:35 keithw Exp $ */ /* * Mesa 3-D graphics library @@ -31,13 +31,6 @@ #include "types.h" -struct gl_shine_tab { - struct gl_shine_tab *next, *prev; - GLfloat tab[SHINE_TABLE_SIZE+1]; - GLfloat shininess; - GLuint refcount; -}; - extern void _mesa_ShadeModel( GLenum mode ); @@ -94,6 +87,23 @@ extern void _mesa_GetMaterialiv( GLenum face, GLenum pname, GLint *params ); +/* Lerp between adjacent values in the f(x) lookup table, giving a + * continuous function, with adequeate overall accuracy. (Though + * still pretty good compared to a straight lookup). + */ +#define GET_SHINE_TAB_ENTRY( table, dp, result ) \ +do { \ + struct gl_shine_tab *_tab = table; \ + if (dp>1.0) \ + result = pow( dp, _tab->shininess ); \ + else { \ + float f = (dp * (SHINE_TABLE_SIZE-1)); \ + int k = (int) f; \ + result = _tab->tab[k] + (f-k)*(_tab->tab[k+1]-_tab->tab[k]); \ + } \ +} while (0) + + extern GLuint gl_material_bitmask( GLcontext *ctx, GLenum face, GLenum pname, @@ -112,8 +122,6 @@ extern void gl_update_lighting( GLcontext *ctx ); extern void gl_compute_light_positions( GLcontext *ctx ); -extern void gl_update_normal_transform( GLcontext *ctx ); - extern void gl_update_material( GLcontext *ctx, const struct gl_material src[2], GLuint bitmask ); |