projects
/
mesa.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
mesa: refactor: move glReadPixels code into new readpix.c file
[mesa.git]
/
src
/
mesa
/
main
/
light.c
diff --git
a/src/mesa/main/light.c
b/src/mesa/main/light.c
index 92d8a0ae0d4c7dfca11dfb2bd4b35062b593c20b..f37d1f216fc94796212de3ea1d1f2375903727ca 100644
(file)
--- a/
src/mesa/main/light.c
+++ b/
src/mesa/main/light.c
@@
-1,8
+1,8
@@
/*
* Mesa 3-D graphics library
/*
* Mesa 3-D graphics library
- * Version:
6.5.3
+ * Version:
7.0
*
*
- * Copyright (C) 1999-200
5
Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-200
7
Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@
-1117,6
+1117,13
@@
compute_light_positions( GLcontext *ctx )
}
light->_VP_inf_spot_attenuation = 1.0;
}
}
light->_VP_inf_spot_attenuation = 1.0;
}
+ else {
+ /* positional light w/ homogeneous coordinate, divide by W */
+ GLfloat wInv = (GLfloat)1.0 / light->_Position[3];
+ light->_Position[0] *= wInv;
+ light->_Position[1] *= wInv;
+ light->_Position[2] *= wInv;
+ }
if (light->_Flags & LIGHT_SPOT) {
if (ctx->_NeedEyeCoords) {
if (light->_Flags & LIGHT_SPOT) {
if (ctx->_NeedEyeCoords) {
@@
-1350,6
+1357,7
@@
_mesa_init_lighting( GLcontext *ctx )
/* Miscellaneous */
ctx->Light._NeedEyeCoords = GL_FALSE;
ctx->_NeedEyeCoords = GL_FALSE;
/* Miscellaneous */
ctx->Light._NeedEyeCoords = GL_FALSE;
ctx->_NeedEyeCoords = GL_FALSE;
+ ctx->_ForceEyeCoords = GL_FALSE;
ctx->_ModelViewInvScale = 1.0;
}
ctx->_ModelViewInvScale = 1.0;
}