mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 13:28:06 +02:00
if light position is local, treat it as a homogeneous coord and divide by W (see bug 11009)
This commit is contained in:
parent
d38b74a316
commit
724a155552
2 changed files with 10 additions and 2 deletions
|
|
@ -39,6 +39,7 @@ TBD
|
|||
<li>Specifying an invalid texture unit as a sampler could lead to a crash
|
||||
<li>The GLX protocol request for glXDestroyPBuffer() was incorrect (bug 10983)
|
||||
<li>ARB vp state.light[n].half value was incorrect (bug 10987)
|
||||
<li>Fixed a positional light source bug (bug 11009)
|
||||
</ul>
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue