diff options
Diffstat (limited to 'linden/indra/newview/llcubemap.cpp')
-rw-r--r-- | linden/indra/newview/llcubemap.cpp | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/linden/indra/newview/llcubemap.cpp b/linden/indra/newview/llcubemap.cpp index 4406bc8..415b849 100644 --- a/linden/indra/newview/llcubemap.cpp +++ b/linden/indra/newview/llcubemap.cpp | |||
@@ -176,8 +176,6 @@ void LLCubeMap::bind() | |||
176 | 176 | ||
177 | glTexParameteri(GL_TEXTURE_CUBE_MAP_ARB, GL_TEXTURE_MAG_FILTER, GL_LINEAR); | 177 | glTexParameteri(GL_TEXTURE_CUBE_MAP_ARB, GL_TEXTURE_MAG_FILTER, GL_LINEAR); |
178 | glTexParameteri(GL_TEXTURE_CUBE_MAP_ARB, GL_TEXTURE_MIN_FILTER, (use_cube_mipmaps? GL_LINEAR_MIPMAP_LINEAR : GL_LINEAR)); | 178 | glTexParameteri(GL_TEXTURE_CUBE_MAP_ARB, GL_TEXTURE_MIN_FILTER, (use_cube_mipmaps? GL_LINEAR_MIPMAP_LINEAR : GL_LINEAR)); |
179 | |||
180 | glTexEnvi (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); | ||
181 | } | 179 | } |
182 | else | 180 | else |
183 | { | 181 | { |
@@ -220,11 +218,23 @@ void LLCubeMap::setMatrix(S32 stage) | |||
220 | { | 218 | { |
221 | mMatrixStage = stage; | 219 | mMatrixStage = stage; |
222 | glActiveTextureARB(GL_TEXTURE0_ARB+stage); | 220 | glActiveTextureARB(GL_TEXTURE0_ARB+stage); |
221 | |||
222 | F32 mat[16]; | ||
223 | |||
224 | glGetFloatv(GL_MODELVIEW_MATRIX, mat); | ||
225 | |||
226 | LLVector3 x(mat); | ||
227 | LLVector3 y(mat+4); | ||
228 | LLVector3 z(mat+8); | ||
229 | |||
230 | LLMatrix3 mat3; | ||
231 | mat3.setRows(x,y,z); | ||
232 | LLMatrix4 trans(mat3); | ||
233 | trans.transpose(); | ||
234 | |||
223 | glMatrixMode(GL_TEXTURE); | 235 | glMatrixMode(GL_TEXTURE); |
224 | glPushMatrix(); | 236 | glPushMatrix(); |
225 | LLMatrix4 tmat; | 237 | glLoadMatrixf((F32 *)trans.mMatrix); |
226 | gCamera->getRotMatrixToParent(tmat); | ||
227 | glLoadMatrixf((F32 *)tmat.mMatrix); | ||
228 | glMatrixMode(GL_MODELVIEW); | 238 | glMatrixMode(GL_MODELVIEW); |
229 | } | 239 | } |
230 | 240 | ||