Browse Source

mesa: fix incorrect transformation of GL_SPOT_DIRECTION

This was changed between GL 1.0 and 1.1.  Mesa still had the 1.0 behaviour.
tags/mesa_7_3_rc2
Brian Paul 16 years ago
parent
commit
c12d24b513
3 changed files with 15 additions and 1 deletions
  1. 1
    0
      docs/relnotes-7.3.html
  2. 2
    1
      src/mesa/main/light.c
  3. 12
    0
      src/mesa/math/m_matrix.h

+ 1
- 0
docs/relnotes-7.3.html View File

@@ -46,6 +46,7 @@ tbd
<li>Fix for wglCreateLayerContext() in WGL/Windows driver
<li>Build fixes for OpenBSD and gcc 2.95
<li>GLSL preprocessor handles #pragma now
<li>Fix incorrect transformation of GL_SPOT_DIRECTION
</ul>

<h2>Changes</h2>

+ 2
- 1
src/mesa/main/light.c View File

@@ -208,7 +208,8 @@ _mesa_Lightfv( GLenum light, GLenum pname, const GLfloat *params )
if (_math_matrix_is_dirty(ctx->ModelviewMatrixStack.Top)) {
_math_matrix_analyse(ctx->ModelviewMatrixStack.Top);
}
TRANSFORM_NORMAL(temp, params, ctx->ModelviewMatrixStack.Top->inv);
TRANSFORM_DIRECTION(temp, params, ctx->ModelviewMatrixStack.Top->m);
NORMALIZE_3FV(temp);
params = temp;
break;
case GL_SPOT_EXPONENT:

+ 12
- 0
src/mesa/math/m_matrix.h View File

@@ -189,6 +189,18 @@ do { \
} while (0)


/**
* Transform a direction by a matrix.
*/
#define TRANSFORM_DIRECTION( TO, DIR, MAT ) \
do { \
TO[0] = DIR[0] * MAT[0] + DIR[1] * MAT[4] + DIR[2] * MAT[8]; \
TO[1] = DIR[0] * MAT[1] + DIR[1] * MAT[5] + DIR[2] * MAT[9]; \
TO[2] = DIR[0] * MAT[2] + DIR[1] * MAT[6] + DIR[2] * MAT[10];\
} while (0)



/*@}*/



Loading…
Cancel
Save