diff options
Diffstat (limited to '')
-rw-r--r-- | linden/indra/newview/lldrawpoolbump.cpp | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/linden/indra/newview/lldrawpoolbump.cpp b/linden/indra/newview/lldrawpoolbump.cpp index 916454c..b0b8b02 100644 --- a/linden/indra/newview/lldrawpoolbump.cpp +++ b/linden/indra/newview/lldrawpoolbump.cpp | |||
@@ -4,6 +4,7 @@ | |||
4 | * | 4 | * |
5 | * Copyright (c) 2003-2007, Linden Research, Inc. | 5 | * Copyright (c) 2003-2007, Linden Research, Inc. |
6 | * | 6 | * |
7 | * Second Life Viewer Source Code | ||
7 | * The source code in this file ("Source Code") is provided by Linden Lab | 8 | * The source code in this file ("Source Code") is provided by Linden Lab |
8 | * to you under the terms of the GNU General Public License, version 2.0 | 9 | * to you under the terms of the GNU General Public License, version 2.0 |
9 | * ("GPL"), unless you have obtained a separate licensing agreement | 10 | * ("GPL"), unless you have obtained a separate licensing agreement |
@@ -35,6 +36,7 @@ | |||
35 | #include "llimagegl.h" | 36 | #include "llimagegl.h" |
36 | #include "m3math.h" | 37 | #include "m3math.h" |
37 | #include "m4math.h" | 38 | #include "m4math.h" |
39 | #include "v4math.h" | ||
38 | 40 | ||
39 | #include "llagent.h" | 41 | #include "llagent.h" |
40 | #include "llcubemap.h" | 42 | #include "llcubemap.h" |
@@ -46,7 +48,7 @@ | |||
46 | #include "llviewercamera.h" | 48 | #include "llviewercamera.h" |
47 | #include "llviewerimagelist.h" | 49 | #include "llviewerimagelist.h" |
48 | #include "pipeline.h" | 50 | #include "pipeline.h" |
49 | 51 | #include "llglslshader.h" | |
50 | 52 | ||
51 | //#include "llimagebmp.h" | 53 | //#include "llimagebmp.h" |
52 | //#include "../tools/imdebug/imdebug.h" | 54 | //#include "../tools/imdebug/imdebug.h" |
@@ -160,7 +162,7 @@ LLDrawPoolBump::LLDrawPoolBump() | |||
160 | 162 | ||
161 | void LLDrawPoolBump::prerender() | 163 | void LLDrawPoolBump::prerender() |
162 | { | 164 | { |
163 | mVertexShaderLevel = gPipeline.getVertexShaderLevel(LLPipeline::SHADER_OBJECT); | 165 | mVertexShaderLevel = LLShaderMgr::getVertexShaderLevel(LLShaderMgr::SHADER_OBJECT); |
164 | } | 166 | } |
165 | 167 | ||
166 | // static | 168 | // static |
@@ -201,6 +203,11 @@ void LLDrawPoolBump::render(S32 pass) | |||
201 | { | 203 | { |
202 | LLFastTimer t(LLFastTimer::FTM_RENDER_BUMP); | 204 | LLFastTimer t(LLFastTimer::FTM_RENDER_BUMP); |
203 | 205 | ||
206 | if (!gPipeline.hasRenderType(LLDrawPool::POOL_SIMPLE)) | ||
207 | { | ||
208 | return; | ||
209 | } | ||
210 | |||
204 | switch( pass ) | 211 | switch( pass ) |
205 | { | 212 | { |
206 | case 0: | 213 | case 0: |
@@ -253,14 +260,17 @@ void LLDrawPoolBump::beginShiny() | |||
253 | cube_map->setMatrix(0); | 260 | cube_map->setMatrix(0); |
254 | cube_map->bind(); | 261 | cube_map->bind(); |
255 | 262 | ||
256 | if (gPipeline.getVertexShaderLevel(LLPipeline::SHADER_OBJECT) > 0) | 263 | if (LLShaderMgr::getVertexShaderLevel(LLShaderMgr::SHADER_OBJECT) > 0) |
257 | { | 264 | { |
258 | LLMatrix4 mat; | 265 | LLMatrix4 mat; |
259 | glGetFloatv(GL_MODELVIEW_MATRIX, (F32*) mat.mMatrix); | 266 | mat.initRows(LLVector4(gGLModelView+0), |
260 | gPipeline.mObjectShinyProgram.bind(); | 267 | LLVector4(gGLModelView+4), |
261 | LLVector3 vec = LLVector3(gPipeline.mShinyOrigin) * mat; | 268 | LLVector4(gGLModelView+8), |
262 | LLVector4 vec4(vec, gPipeline.mShinyOrigin.mV[3]); | 269 | LLVector4(gGLModelView+12)); |
263 | glUniform4fvARB(gPipeline.mObjectShinyProgram.mUniform[LLPipeline::GLSL_SHINY_ORIGIN], 1, | 270 | gObjectShinyProgram.bind(); |
271 | LLVector3 vec = LLVector3(gShinyOrigin) * mat; | ||
272 | LLVector4 vec4(vec, gShinyOrigin.mV[3]); | ||
273 | glUniform4fvARB(gObjectShinyProgram.mUniform[LLShaderMgr::SHINY_ORIGIN], 1, | ||
264 | vec4.mV); | 274 | vec4.mV); |
265 | } | 275 | } |
266 | else | 276 | else |
@@ -380,9 +390,9 @@ void LLDrawPoolBump::endShiny() | |||
380 | cube_map->disable(); | 390 | cube_map->disable(); |
381 | cube_map->restoreMatrix(); | 391 | cube_map->restoreMatrix(); |
382 | 392 | ||
383 | if (gPipeline.getVertexShaderLevel(LLPipeline::SHADER_OBJECT) > 0) | 393 | if (LLShaderMgr::getVertexShaderLevel(LLShaderMgr::SHADER_OBJECT) > 0) |
384 | { | 394 | { |
385 | gPipeline.mObjectShinyProgram.unbind(); | 395 | gObjectShinyProgram.unbind(); |
386 | } | 396 | } |
387 | 397 | ||
388 | glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); | 398 | glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); |