diff options
author | Jacek Antonelli | 2008-08-15 23:45:50 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-08-15 23:45:50 -0500 |
commit | 2a4dea528f670b9bb1f77ef27a8a1dd16603d114 (patch) | |
tree | 95c68e362703c9099d571ecbdc6142b1cda1e005 /linden/indra/newview/lldrawpoolavatar.cpp | |
parent | Second Life viewer sources 1.20.6 (diff) | |
download | meta-impy-2a4dea528f670b9bb1f77ef27a8a1dd16603d114.zip meta-impy-2a4dea528f670b9bb1f77ef27a8a1dd16603d114.tar.gz meta-impy-2a4dea528f670b9bb1f77ef27a8a1dd16603d114.tar.bz2 meta-impy-2a4dea528f670b9bb1f77ef27a8a1dd16603d114.tar.xz |
Second Life viewer sources 1.20.7
Diffstat (limited to '')
-rw-r--r-- | linden/indra/newview/lldrawpoolavatar.cpp | 59 |
1 files changed, 37 insertions, 22 deletions
diff --git a/linden/indra/newview/lldrawpoolavatar.cpp b/linden/indra/newview/lldrawpoolavatar.cpp index 6cfd131..fe5d4cd 100644 --- a/linden/indra/newview/lldrawpoolavatar.cpp +++ b/linden/indra/newview/lldrawpoolavatar.cpp | |||
@@ -32,7 +32,7 @@ | |||
32 | #include "llviewerprecompiledheaders.h" | 32 | #include "llviewerprecompiledheaders.h" |
33 | 33 | ||
34 | #include "lldrawpoolavatar.h" | 34 | #include "lldrawpoolavatar.h" |
35 | #include "llglimmediate.h" | 35 | #include "llrender.h" |
36 | 36 | ||
37 | #include "llvoavatar.h" | 37 | #include "llvoavatar.h" |
38 | #include "m3math.h" | 38 | #include "m3math.h" |
@@ -299,7 +299,7 @@ void LLDrawPoolAvatar::beginSkinned() | |||
299 | } | 299 | } |
300 | 300 | ||
301 | sVertexProgram->enableTexture(LLShaderMgr::BUMP_MAP); | 301 | sVertexProgram->enableTexture(LLShaderMgr::BUMP_MAP); |
302 | glActiveTextureARB(GL_TEXTURE0_ARB); | 302 | gGL.getTexUnit(0)->activate(); |
303 | } | 303 | } |
304 | else | 304 | else |
305 | { | 305 | { |
@@ -319,7 +319,7 @@ void LLDrawPoolAvatar::endSkinned() | |||
319 | { | 319 | { |
320 | sRenderingSkinned = FALSE; | 320 | sRenderingSkinned = FALSE; |
321 | sVertexProgram->disableTexture(LLShaderMgr::BUMP_MAP); | 321 | sVertexProgram->disableTexture(LLShaderMgr::BUMP_MAP); |
322 | glActiveTextureARB(GL_TEXTURE0_ARB); | 322 | gGL.getTexUnit(0)->activate(); |
323 | disable_vertex_weighting(sVertexProgram->mAttribute[LLShaderMgr::AVATAR_WEIGHT]); | 323 | disable_vertex_weighting(sVertexProgram->mAttribute[LLShaderMgr::AVATAR_WEIGHT]); |
324 | if (sShaderLevel >= SHADER_LEVEL_BUMP) | 324 | if (sShaderLevel >= SHADER_LEVEL_BUMP) |
325 | { | 325 | { |
@@ -343,7 +343,7 @@ void LLDrawPoolAvatar::endSkinned() | |||
343 | } | 343 | } |
344 | } | 344 | } |
345 | 345 | ||
346 | glActiveTextureARB(GL_TEXTURE0_ARB); | 346 | gGL.getTexUnit(0)->activate(); |
347 | } | 347 | } |
348 | 348 | ||
349 | 349 | ||
@@ -395,6 +395,31 @@ void LLDrawPoolAvatar::renderAvatars(LLVOAvatar* single_avatar, S32 pass) | |||
395 | return; | 395 | return; |
396 | } | 396 | } |
397 | 397 | ||
398 | if (!single_avatar && !avatarp->isFullyLoaded()) | ||
399 | { | ||
400 | |||
401 | /* // debug code to draw a cube in place of avatar | ||
402 | LLGLSNoTexture gls_no_texture; | ||
403 | LLVector3 pos = avatarp->getPositionAgent(); | ||
404 | |||
405 | gGL.color4f(1.0f, 0.0f, 0.0f, 0.8f); | ||
406 | gGL.begin(GL_LINES); | ||
407 | { | ||
408 | gGL.vertex3fv((pos - LLVector3(0.2f, 0.f, 0.f)).mV); | ||
409 | gGL.vertex3fv((pos + LLVector3(0.2f, 0.f, 0.f)).mV); | ||
410 | gGL.vertex3fv((pos - LLVector3(0.f, 0.2f, 0.f)).mV); | ||
411 | gGL.vertex3fv((pos + LLVector3(0.f, 0.2f, 0.f)).mV); | ||
412 | gGL.vertex3fv((pos - LLVector3(0.f, 0.f, 0.2f)).mV); | ||
413 | gGL.vertex3fv((pos + LLVector3(0.f, 0.f, 0.2f)).mV); | ||
414 | } | ||
415 | gGL.end(); | ||
416 | */ | ||
417 | |||
418 | |||
419 | // don't render please | ||
420 | return; | ||
421 | } | ||
422 | |||
398 | BOOL impostor = avatarp->isImpostor() && !single_avatar; | 423 | BOOL impostor = avatarp->isImpostor() && !single_avatar; |
399 | 424 | ||
400 | if (impostor && pass != 0) | 425 | if (impostor && pass != 0) |
@@ -574,22 +599,12 @@ void LLDrawPoolAvatar::renderForSelect() | |||
574 | BOOL impostor = avatarp->isImpostor(); | 599 | BOOL impostor = avatarp->isImpostor(); |
575 | if (impostor) | 600 | if (impostor) |
576 | { | 601 | { |
577 | glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_ARB); | 602 | gGL.getTexUnit(0)->setTextureColorBlend(LLTexUnit::TBO_REPLACE, LLTexUnit::TBS_VERT_COLOR); |
578 | glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_RGB_ARB, GL_REPLACE); | 603 | gGL.getTexUnit(0)->setTextureAlphaBlend(LLTexUnit::TBO_MULT, LLTexUnit::TBS_TEX_ALPHA, LLTexUnit::TBS_VERT_ALPHA); |
579 | glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_ALPHA_ARB, GL_MODULATE); | ||
580 | |||
581 | glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_RGB_ARB, GL_PRIMARY_COLOR); | ||
582 | glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_RGB_ARB, GL_SRC_COLOR); | ||
583 | |||
584 | glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_ALPHA_ARB, GL_TEXTURE); | ||
585 | glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_ALPHA_ARB, GL_SRC_ALPHA); | ||
586 | |||
587 | glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE1_ALPHA_ARB, GL_PRIMARY_COLOR_ARB); | ||
588 | glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND1_ALPHA_ARB, GL_SRC_ALPHA); | ||
589 | 604 | ||
590 | avatarp->renderImpostor(color); | 605 | avatarp->renderImpostor(color); |
591 | 606 | ||
592 | glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); | 607 | gGL.getTexUnit(0)->setTextureBlendType(LLTexUnit::TB_MULT); |
593 | return; | 608 | return; |
594 | } | 609 | } |
595 | 610 | ||
@@ -598,8 +613,8 @@ void LLDrawPoolAvatar::renderForSelect() | |||
598 | { | 613 | { |
599 | gAvatarMatrixParam = sVertexProgram->mUniform[LLShaderMgr::AVATAR_MATRIX]; | 614 | gAvatarMatrixParam = sVertexProgram->mUniform[LLShaderMgr::AVATAR_MATRIX]; |
600 | } | 615 | } |
601 | glAlphaFunc(GL_GEQUAL, 0.2f); | 616 | gGL.setAlphaRejectSettings(LLRender::CF_GREATER_EQUAL, 0.2f); |
602 | gGL.blendFunc(GL_ONE, GL_ZERO); | 617 | gGL.setSceneBlendType(LLRender::BT_REPLACE); |
603 | 618 | ||
604 | glColor4ubv(color.mV); | 619 | glColor4ubv(color.mV); |
605 | 620 | ||
@@ -620,11 +635,11 @@ void LLDrawPoolAvatar::renderForSelect() | |||
620 | disable_vertex_weighting(sVertexProgram->mAttribute[LLShaderMgr::AVATAR_WEIGHT]); | 635 | disable_vertex_weighting(sVertexProgram->mAttribute[LLShaderMgr::AVATAR_WEIGHT]); |
621 | } | 636 | } |
622 | 637 | ||
623 | glAlphaFunc(GL_GREATER, 0.01f); | 638 | gGL.setAlphaRejectSettings(LLRender::CF_DEFAULT); |
624 | gGL.blendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); | 639 | gGL.setSceneBlendType(LLRender::BT_ALPHA); |
625 | 640 | ||
626 | // restore texture mode | 641 | // restore texture mode |
627 | glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); | 642 | gGL.getTexUnit(0)->setTextureBlendType(LLTexUnit::TB_MULT); |
628 | } | 643 | } |
629 | 644 | ||
630 | //----------------------------------------------------------------------------- | 645 | //----------------------------------------------------------------------------- |