diff options
Diffstat (limited to 'linden/indra/newview/lldrawpoolbump.cpp')
-rw-r--r-- | linden/indra/newview/lldrawpoolbump.cpp | 35 |
1 files changed, 18 insertions, 17 deletions
diff --git a/linden/indra/newview/lldrawpoolbump.cpp b/linden/indra/newview/lldrawpoolbump.cpp index 68fa934..0dd11d6 100644 --- a/linden/indra/newview/lldrawpoolbump.cpp +++ b/linden/indra/newview/lldrawpoolbump.cpp | |||
@@ -53,7 +53,7 @@ | |||
53 | #include "llviewerimagelist.h" | 53 | #include "llviewerimagelist.h" |
54 | #include "pipeline.h" | 54 | #include "pipeline.h" |
55 | #include "llspatialpartition.h" | 55 | #include "llspatialpartition.h" |
56 | #include "llglslshader.h" | 56 | #include "llviewershadermgr.h" |
57 | 57 | ||
58 | //#include "llimagebmp.h" | 58 | //#include "llimagebmp.h" |
59 | //#include "../tools/imdebug/imdebug.h" | 59 | //#include "../tools/imdebug/imdebug.h" |
@@ -100,7 +100,7 @@ void LLStandardBumpmap::restoreGL() | |||
100 | gStandardBumpmapList[LLStandardBumpmap::sStandardBumpmapCount++] = LLStandardBumpmap("Darkness"); // BE_DARKNESS | 100 | gStandardBumpmapList[LLStandardBumpmap::sStandardBumpmapCount++] = LLStandardBumpmap("Darkness"); // BE_DARKNESS |
101 | 101 | ||
102 | std::string file_name = gDirUtilp->getExpandedFilename( LL_PATH_APP_SETTINGS, "std_bump.ini" ); | 102 | std::string file_name = gDirUtilp->getExpandedFilename( LL_PATH_APP_SETTINGS, "std_bump.ini" ); |
103 | LLFILE* file = LLFile::fopen( file_name.c_str(), "rt" ); /*Flawfinder: ignore*/ | 103 | LLFILE* file = LLFile::fopen( file_name, "rt" ); /*Flawfinder: ignore*/ |
104 | if( !file ) | 104 | if( !file ) |
105 | { | 105 | { |
106 | llwarns << "Could not open std_bump <" << file_name << ">" << llendl; | 106 | llwarns << "Could not open std_bump <" << file_name << ">" << llendl; |
@@ -177,7 +177,7 @@ LLDrawPoolBump::LLDrawPoolBump() | |||
177 | 177 | ||
178 | void LLDrawPoolBump::prerender() | 178 | void LLDrawPoolBump::prerender() |
179 | { | 179 | { |
180 | mVertexShaderLevel = LLShaderMgr::getVertexShaderLevel(LLShaderMgr::SHADER_OBJECT); | 180 | mVertexShaderLevel = LLViewerShaderMgr::instance()->getVertexShaderLevel(LLViewerShaderMgr::SHADER_OBJECT); |
181 | } | 181 | } |
182 | 182 | ||
183 | // static | 183 | // static |
@@ -333,7 +333,7 @@ void LLDrawPoolBump::beginShiny(bool invisible) | |||
333 | LLCubeMap* cube_map = gSky.mVOSkyp ? gSky.mVOSkyp->getCubeMap() : NULL; | 333 | LLCubeMap* cube_map = gSky.mVOSkyp ? gSky.mVOSkyp->getCubeMap() : NULL; |
334 | if( cube_map ) | 334 | if( cube_map ) |
335 | { | 335 | { |
336 | if (!invisible && LLShaderMgr::getVertexShaderLevel(LLShaderMgr::SHADER_OBJECT) > 0 ) | 336 | if (!invisible && LLViewerShaderMgr::instance()->getVertexShaderLevel(LLViewerShaderMgr::SHADER_OBJECT) > 0 ) |
337 | { | 337 | { |
338 | LLMatrix4 mat; | 338 | LLMatrix4 mat; |
339 | mat.initRows(LLVector4(gGLModelView+0), | 339 | mat.initRows(LLVector4(gGLModelView+0), |
@@ -343,23 +343,23 @@ void LLDrawPoolBump::beginShiny(bool invisible) | |||
343 | shader->bind(); | 343 | shader->bind(); |
344 | LLVector3 vec = LLVector3(gShinyOrigin) * mat; | 344 | LLVector3 vec = LLVector3(gShinyOrigin) * mat; |
345 | LLVector4 vec4(vec, gShinyOrigin.mV[3]); | 345 | LLVector4 vec4(vec, gShinyOrigin.mV[3]); |
346 | shader->uniform4fv(LLShaderMgr::SHINY_ORIGIN, 1, vec4.mV); | 346 | shader->uniform4fv(LLViewerShaderMgr::SHINY_ORIGIN, 1, vec4.mV); |
347 | if (mVertexShaderLevel > 1) | 347 | if (mVertexShaderLevel > 1) |
348 | { | 348 | { |
349 | cube_map->setMatrix(1); | 349 | cube_map->setMatrix(1); |
350 | // Make sure that texture coord generation happens for tex unit 1, as that's the one we use for | 350 | // Make sure that texture coord generation happens for tex unit 1, as that's the one we use for |
351 | // the cube map in the one pass shiny shaders | 351 | // the cube map in the one pass shiny shaders |
352 | cube_channel = shader->enableTexture(LLShaderMgr::ENVIRONMENT_MAP, GL_TEXTURE_CUBE_MAP_ARB); | 352 | cube_channel = shader->enableTexture(LLViewerShaderMgr::ENVIRONMENT_MAP, GL_TEXTURE_CUBE_MAP_ARB); |
353 | cube_map->enableTexture(cube_channel); | 353 | cube_map->enableTexture(cube_channel); |
354 | cube_map->enableTextureCoords(1); | 354 | cube_map->enableTextureCoords(1); |
355 | diffuse_channel = shader->enableTexture(LLShaderMgr::DIFFUSE_MAP); | 355 | diffuse_channel = shader->enableTexture(LLViewerShaderMgr::DIFFUSE_MAP); |
356 | } | 356 | } |
357 | else | 357 | else |
358 | { | 358 | { |
359 | cube_channel = 0; | 359 | cube_channel = 0; |
360 | diffuse_channel = -1; | 360 | diffuse_channel = -1; |
361 | cube_map->setMatrix(0); | 361 | cube_map->setMatrix(0); |
362 | cube_map->enable(shader->enableTexture(LLShaderMgr::ENVIRONMENT_MAP, GL_TEXTURE_CUBE_MAP_ARB)); | 362 | cube_map->enable(shader->enableTexture(LLViewerShaderMgr::ENVIRONMENT_MAP, GL_TEXTURE_CUBE_MAP_ARB)); |
363 | } | 363 | } |
364 | cube_map->bind(); | 364 | cube_map->bind(); |
365 | } | 365 | } |
@@ -423,13 +423,13 @@ void LLDrawPoolBump::endShiny(bool invisible) | |||
423 | 423 | ||
424 | if (!invisible && mVertexShaderLevel > 1) | 424 | if (!invisible && mVertexShaderLevel > 1) |
425 | { | 425 | { |
426 | shader->disableTexture(LLShaderMgr::ENVIRONMENT_MAP, GL_TEXTURE_CUBE_MAP_ARB); | 426 | shader->disableTexture(LLViewerShaderMgr::ENVIRONMENT_MAP, GL_TEXTURE_CUBE_MAP_ARB); |
427 | 427 | ||
428 | if (LLShaderMgr::getVertexShaderLevel(LLShaderMgr::SHADER_OBJECT) > 0) | 428 | if (LLViewerShaderMgr::instance()->getVertexShaderLevel(LLViewerShaderMgr::SHADER_OBJECT) > 0) |
429 | { | 429 | { |
430 | if (diffuse_channel != 0) | 430 | if (diffuse_channel != 0) |
431 | { | 431 | { |
432 | shader->disableTexture(LLShaderMgr::DIFFUSE_MAP); | 432 | shader->disableTexture(LLViewerShaderMgr::DIFFUSE_MAP); |
433 | } | 433 | } |
434 | } | 434 | } |
435 | 435 | ||
@@ -443,6 +443,7 @@ void LLDrawPoolBump::endShiny(bool invisible) | |||
443 | } | 443 | } |
444 | } | 444 | } |
445 | 445 | ||
446 | gGL.getTexUnit(0)->activate(); | ||
446 | LLImageGL::unbindTexture(0, GL_TEXTURE_2D); | 447 | LLImageGL::unbindTexture(0, GL_TEXTURE_2D); |
447 | gGL.getTexUnit(0)->setTextureBlendType(LLTexUnit::TB_MULT); | 448 | gGL.getTexUnit(0)->setTextureBlendType(LLTexUnit::TB_MULT); |
448 | 449 | ||
@@ -483,15 +484,15 @@ void LLDrawPoolBump::beginFullbrightShiny() | |||
483 | shader->bind(); | 484 | shader->bind(); |
484 | LLVector3 vec = LLVector3(gShinyOrigin) * mat; | 485 | LLVector3 vec = LLVector3(gShinyOrigin) * mat; |
485 | LLVector4 vec4(vec, gShinyOrigin.mV[3]); | 486 | LLVector4 vec4(vec, gShinyOrigin.mV[3]); |
486 | shader->uniform4fv(LLShaderMgr::SHINY_ORIGIN, 1, vec4.mV); | 487 | shader->uniform4fv(LLViewerShaderMgr::SHINY_ORIGIN, 1, vec4.mV); |
487 | 488 | ||
488 | cube_map->setMatrix(1); | 489 | cube_map->setMatrix(1); |
489 | // Make sure that texture coord generation happens for tex unit 1, as that's the one we use for | 490 | // Make sure that texture coord generation happens for tex unit 1, as that's the one we use for |
490 | // the cube map in the one pass shiny shaders | 491 | // the cube map in the one pass shiny shaders |
491 | cube_channel = shader->enableTexture(LLShaderMgr::ENVIRONMENT_MAP, GL_TEXTURE_CUBE_MAP_ARB); | 492 | cube_channel = shader->enableTexture(LLViewerShaderMgr::ENVIRONMENT_MAP, GL_TEXTURE_CUBE_MAP_ARB); |
492 | cube_map->enableTexture(cube_channel); | 493 | cube_map->enableTexture(cube_channel); |
493 | cube_map->enableTextureCoords(1); | 494 | cube_map->enableTextureCoords(1); |
494 | diffuse_channel = shader->enableTexture(LLShaderMgr::DIFFUSE_MAP); | 495 | diffuse_channel = shader->enableTexture(LLViewerShaderMgr::DIFFUSE_MAP); |
495 | 496 | ||
496 | cube_map->bind(); | 497 | cube_map->bind(); |
497 | } | 498 | } |
@@ -531,7 +532,7 @@ void LLDrawPoolBump::endFullbrightShiny() | |||
531 | 532 | ||
532 | if (diffuse_channel != 0) | 533 | if (diffuse_channel != 0) |
533 | { | 534 | { |
534 | shader->disableTexture(LLShaderMgr::DIFFUSE_MAP); | 535 | shader->disableTexture(LLViewerShaderMgr::DIFFUSE_MAP); |
535 | } | 536 | } |
536 | gGL.getTexUnit(0)->activate(); | 537 | gGL.getTexUnit(0)->activate(); |
537 | glEnable(GL_TEXTURE_2D); | 538 | glEnable(GL_TEXTURE_2D); |
@@ -556,7 +557,7 @@ void LLDrawPoolBump::renderGroup(LLSpatialGroup* group, U32 type, U32 mask, BOOL | |||
556 | for (LLSpatialGroup::drawmap_elem_t::iterator k = draw_info.begin(); k != draw_info.end(); ++k) | 557 | for (LLSpatialGroup::drawmap_elem_t::iterator k = draw_info.begin(); k != draw_info.end(); ++k) |
557 | { | 558 | { |
558 | LLDrawInfo& params = **k; | 559 | LLDrawInfo& params = **k; |
559 | 560 | ||
560 | applyModelMatrix(params); | 561 | applyModelMatrix(params); |
561 | 562 | ||
562 | params.mVertexBuffer->setBuffer(mask); | 563 | params.mVertexBuffer->setBuffer(mask); |
@@ -851,7 +852,7 @@ LLImageGL* LLBumpImageList::getBrightnessDarknessImage(LLViewerImage* src_image, | |||
851 | bump->setExplicitFormat(GL_ALPHA8, GL_ALPHA); | 852 | bump->setExplicitFormat(GL_ALPHA8, GL_ALPHA); |
852 | 853 | ||
853 | // Note: this may create an LLImageGL immediately | 854 | // Note: this may create an LLImageGL immediately |
854 | src_image->setLoadedCallback( callback_func, 0, TRUE, new LLUUID(src_image->getID()) ); | 855 | src_image->setLoadedCallback( callback_func, 0, TRUE, FALSE, new LLUUID(src_image->getID()) ); |
855 | bump = (*entries_list)[src_image->getID()]; // In case callback was called immediately and replaced the image | 856 | bump = (*entries_list)[src_image->getID()]; // In case callback was called immediately and replaced the image |
856 | 857 | ||
857 | // bump_total++; | 858 | // bump_total++; |