summaryrefslogtreecommitdiff
path: root/src/mesa/main/light.c
diff options
context:
space:
mode:
authorJouk <joukj@tarantella.(none)>2007-06-08 13:38:24 +0200
committerJouk <joukj@tarantella.(none)>2007-06-08 13:38:24 +0200
commit55f8b7053065ce88296608071feed6f9540f6c0d (patch)
tree86ac301ed5805c895985040caf56f857de017233 /src/mesa/main/light.c
parent518f9168862b2096278ae14a65c8c854c208e004 (diff)
parent7b559a91028d297b34df9ec939bd4d00fad6027c (diff)
Merge branch 'master' of git+ssh://joukj@git.freedesktop.org/git/mesa/mesa
Diffstat (limited to 'src/mesa/main/light.c')
-rw-r--r--src/mesa/main/light.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/mesa/main/light.c b/src/mesa/main/light.c
index 92d8a0ae0d..6e057614ba 100644
--- a/src/mesa/main/light.c
+++ b/src/mesa/main/light.c
@@ -1,8 +1,8 @@
/*
* Mesa 3-D graphics library
- * Version: 6.5.3
+ * Version: 7.0
*
- * Copyright (C) 1999-2005 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2007 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"),
@@ -1117,6 +1117,13 @@ compute_light_positions( GLcontext *ctx )
}
light->_VP_inf_spot_attenuation = 1.0;
}
+ else {
+ /* positional light w/ homogeneous coordinate, divide by W */
+ GLfloat wInv = 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) {