102 if (
ctx->Light.ShadeModel!=
mode) {
155 if (
ctx->NewModelViewMatrix) {
159 direction,
ctx->ModelViewInv);
167 if (
ctx->Light.Light[
l].SpotExponent !=
params[0]) {
185 ctx->Light.Light[
l].ConstantAttenuation =
params[0];
192 ctx->Light.Light[
l].LinearAttenuation =
params[0];
199 ctx->Light.Light[
l].QuadraticAttenuation =
params[0];
244 params[0] =
ctx->Light.Light[
l].ConstantAttenuation;
247 params[0] =
ctx->Light.Light[
l].LinearAttenuation;
250 params[0] =
ctx->Light.Light[
l].QuadraticAttenuation;
306 params[0] =
ctx->Light.Light[
l].ConstantAttenuation;
309 params[0] =
ctx->Light.Light[
l].LinearAttenuation;
312 params[0] =
ctx->Light.Light[
l].QuadraticAttenuation;
424 VB->MaterialMask[
VB->Count] |= bitmask;
429 mat =
ctx->Light.Material;
459 if (
mat[0].Shininess != shininess) {
460 mat[0].Shininess = shininess;
466 if (
mat[1].Shininess != shininess) {
467 mat[1].Shininess = shininess;
495 ctx->Light.ColorMaterialFace =
face;
507 ctx->Light.ColorMaterialMode =
mode;
551 if (
ctx->Light.ColorMaterialEnabled) {
554 bitmask &=
~ctx->Light.ColorMaterialBitmask;
599 params[0] =
ctx->Light.Material[
f].AmbientIndex;
600 params[1] =
ctx->Light.Material[
f].DiffuseIndex;
601 params[2] =
ctx->Light.Material[
f].SpecularIndex;
713 double exponent =
l->SpotExponent;
717 l->SpotExpTable[0][0] = 0.0;
727 l->SpotExpTable[
i][0] = tmp;
730 l->SpotExpTable[
i][1] =
l->SpotExpTable[
i+1][0] -
l->SpotExpTable[
i][0];
745 m->ShineTable[0] = 0.0F;
750 m->ShineTable[
i] = 0.0F;
753 m->ShineTable[
i] =
x;
757 m->ShineTable[
i] = -1.0;
775 if (!
ctx->Light.Enabled) {
782 ctx->Light.FirstEnabled =
NULL;
784 ctx->Light.Light[
i].NextEnabled =
NULL;
785 if (
ctx->Light.Light[
i].Enabled) {
790 ctx->Light.FirstEnabled = &
ctx->Light.Light[
i];
792 prev_enabled = &
ctx->Light.Light[
i];
797 for (side=0; side<2; side++) {
798 ctx->Light.BaseColor[side][0] =
ctx->Light.Material[side].Emission[0]
799 +
ctx->Light.Model.Ambient[0] *
ctx->Light.Material[side].Ambient[0];
800 ctx->Light.BaseColor[side][1] =
ctx->Light.Material[side].Emission[1]
801 +
ctx->Light.Model.Ambient[1] *
ctx->Light.Material[side].Ambient[1];
802 ctx->Light.BaseColor[side][2] =
ctx->Light.Material[side].Emission[2]
803 +
ctx->Light.Model.Ambient[2] *
ctx->Light.Material[side].Ambient[2];
804 ctx->Light.BaseColor[side][3]
805 =
MIN2(
ctx->Light.Material[side].Diffuse[3], 1.0F );
811 for (side=0; side<2; side++) {
814 ctx->Light.BaseColor[side][0] +=
light->Ambient[0] *
mat->Ambient[0];
815 ctx->Light.BaseColor[side][1] +=
light->Ambient[1] *
mat->Ambient[1];
816 ctx->Light.BaseColor[side][2] +=
light->Ambient[2] *
mat->Ambient[2];
818 light->MatAmbient[side][0] =
light->Ambient[0] *
mat->Ambient[0];
819 light->MatAmbient[side][1] =
light->Ambient[1] *
mat->Ambient[1];
820 light->MatAmbient[side][2] =
light->Ambient[2] *
mat->Ambient[2];
822 light->MatDiffuse[side][0] =
light->Diffuse[0] *
mat->Diffuse[0];
823 light->MatDiffuse[side][1] =
light->Diffuse[1] *
mat->Diffuse[1];
824 light->MatDiffuse[side][2] =
light->Diffuse[2] *
mat->Diffuse[2];
826 light->MatSpecular[side][0] =
light->Specular[0] *
mat->Specular[0];
827 light->MatSpecular[side][1] =
light->Specular[1] *
mat->Specular[1];
828 light->MatSpecular[side][2] =
light->Specular[2] *
mat->Specular[2];
836 light->h_inf_norm[2] += 1.0F;
844 + 0.59F *
light->Diffuse[1]
845 + 0.11F *
light->Diffuse[2];
847 + 0.59F *
light->Specular[1]
848 + 0.11F *
light->Specular[2];
855 if (
ctx->Light.BaseColor[0][0]<0.0F
856 ||
ctx->Light.BaseColor[0][1]<0.0F
857 ||
ctx->Light.BaseColor[0][2]<0.0F
858 ||
ctx->Light.BaseColor[0][3]<0.0F
859 ||
ctx->Light.BaseColor[1][0]<0.0F
860 ||
ctx->Light.BaseColor[1][1]<0.0F
861 ||
ctx->Light.BaseColor[1][2]<0.0F
862 ||
ctx->Light.BaseColor[1][3]<0.0F
863 ||
ctx->Light.Model.LocalViewer
864 ||
ctx->Light.ColorMaterialEnabled) {
869 if (
light->Position[3]!=0.0F
870 ||
light->SpotCutoff!=180.0F
871 ||
light->MatDiffuse[0][0]<0.0F
872 ||
light->MatDiffuse[0][1]<0.0F
873 ||
light->MatDiffuse[0][2]<0.0F
874 ||
light->MatSpecular[0][0]<0.0F
875 ||
light->MatSpecular[0][1]<0.0F
876 ||
light->MatSpecular[0][2]<0.0F
877 ||
light->MatDiffuse[1][0]<0.0F
878 ||
light->MatDiffuse[1][1]<0.0F
879 ||
light->MatDiffuse[1][2]<0.0F
880 ||
light->MatSpecular[1][0]<0.0F
881 ||
light->MatSpecular[1][1]<0.0F
882 ||
light->MatSpecular[1][2]<0.0F) {
_STLP_DECLSPEC complex< float > _STLP_CALL cos(const complex< float > &)
void gl_problem(const GLcontext *ctx, const char *s)
void gl_error(GLcontext *ctx, GLenum error, const char *s)
void gl_analyze_modelview_matrix(GLcontext *ctx)
#define FRONT_SHININESS_BIT
#define FRONT_SPECULAR_BIT
#define FRONT_INDEXES_BIT
#define FRONT_DIFFUSE_BIT
#define BACK_MATERIAL_BITS
#define BACK_EMISSION_BIT
#define FRONT_MATERIAL_BITS
#define FRONT_AMBIENT_BIT
#define BACK_SPECULAR_BIT
#define BACK_SHININESS_BIT
#define FRONT_EMISSION_BIT
double pow(double x, double y)
#define GL_AMBIENT_AND_DIFFUSE
#define GL_FRONT_AND_BACK
GLint GLint GLint GLint GLint x
#define GL_QUADRATIC_ATTENUATION
#define GL_INVALID_OPERATION
#define GL_LIGHT_MODEL_LOCAL_VIEWER
#define GL_LINEAR_ATTENUATION
#define GL_SPOT_DIRECTION
#define GL_LIGHT_MODEL_TWO_SIDE
#define GL_CONSTANT_ATTENUATION
#define GL_LIGHT_MODEL_AMBIENT
GLenum GLuint GLint GLenum face
GLenum const GLfloat * params
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum light
#define INSIDE_BEGIN_END(CTX)
#define COPY_3V(DST, SRC)
#define COPY_4V(DST, SRC)
void gl_GetMaterialfv(GLcontext *ctx, GLenum face, GLenum pname, GLfloat *params)
void gl_GetLightiv(GLcontext *ctx, GLenum light, GLenum pname, GLint *params)
GLuint gl_material_bitmask(GLenum face, GLenum pname)
void gl_Lightfv(GLcontext *ctx, GLenum light, GLenum pname, const GLfloat *params, GLint nparams)
void gl_GetLightfv(GLcontext *ctx, GLenum light, GLenum pname, GLfloat *params)
void gl_compute_spot_exp_table(struct gl_light *l)
void gl_set_material(GLcontext *ctx, GLuint bitmask, const GLfloat *params)
void gl_ColorMaterial(GLcontext *ctx, GLenum face, GLenum mode)
void gl_update_lighting(GLcontext *ctx)
void gl_ShadeModel(GLcontext *ctx, GLenum mode)
void gl_compute_material_shine_table(struct gl_material *m)
void gl_Materialfv(GLcontext *ctx, GLenum face, GLenum pname, const GLfloat *params)
void gl_GetMaterialiv(GLcontext *ctx, GLenum face, GLenum pname, GLint *params)
void gl_LightModelfv(GLcontext *ctx, GLenum pname, const GLfloat *params)
struct gl_light * NextEnabled
#define CLAMP(f, min, max)
struct vertex_buffer * VB