Skip to content

Commit 133dffb

Browse files
committed
Merge branch 'master' of git://github.com/Shyotl/SingularityViewer
2 parents 6bd9649 + 01e27ea commit 133dffb

3 files changed

Lines changed: 31 additions & 51 deletions

File tree

indra/llrender/llshadermgr.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -668,10 +668,6 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade
668668
}
669669
}
670670

671-
static const LLCachedControl<bool> SHPackDeferredNormals("SHPackDeferredNormals",false);
672-
if(SHPackDeferredNormals)
673-
text[count++] = strdup("#define PACK_NORMALS\n");
674-
675671
if(defines)
676672
{
677673
for (std::map<std::string,std::string>::iterator iter = defines->begin(); iter != defines->end(); ++iter)

indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl

Lines changed: 31 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,10 @@ uniform float shadow_bias;
7474
uniform sampler2D diffuseMap;
7575
#endif
7676

77+
#ifdef IS_AVATAR_SKIN
78+
uniform float minimum_alpha;
79+
#endif
80+
7781
VARYING vec3 vary_fragcoord;
7882
VARYING vec3 vary_position;
7983
VARYING vec2 vary_texcoord0;
@@ -454,7 +458,33 @@ vec3 fullbrightScaleSoftClip(vec3 light)
454458

455459
void main()
456460
{
457-
461+
#ifdef USE_INDEXED_TEX
462+
vec4 diff = diffuseLookup(vary_texcoord0.xy);
463+
#else
464+
vec4 diff = texture2D(diffuseMap,vary_texcoord0.xy);
465+
#endif
466+
#ifdef USE_VERTEX_COLOR
467+
float final_alpha = diff.a * vertex_color.a;
468+
diff.rgb *= vertex_color.rgb;
469+
#else
470+
float final_alpha = diff.a;
471+
#endif
472+
473+
#ifdef IS_AVATAR_SKIN
474+
if(final_alpha < minimum_alpha)
475+
{
476+
discard;
477+
}
478+
#endif
479+
#ifdef FOR_IMPOSTOR
480+
// Insure we don't pollute depth with invis pixels in impostor rendering
481+
//
482+
if (final_alpha < 0.01)
483+
{
484+
discard;
485+
}
486+
#endif
487+
458488
vec4 pos = vec4(vary_position, 1.0);
459489

460490
float shadow = 1.0;
@@ -528,37 +558,10 @@ void main()
528558
}
529559
#endif
530560

531-
#ifdef USE_INDEXED_TEX
532-
vec4 diff = diffuseLookup(vary_texcoord0.xy);
533-
#else
534-
vec4 diff = texture2D(diffuseMap,vary_texcoord0.xy);
535-
#endif
536561

537562
#ifdef FOR_IMPOSTOR
538-
539-
#ifdef USE_VERTEX_COLOR
540-
float final_alpha = diff.a * vertex_color.a;
541-
diff.rgb *= vertex_color.rgb;
542-
#else
543-
float final_alpha = diff.a;
544-
#endif
545-
546-
// Insure we don't pollute depth with invis pixels in impostor rendering
547-
//
548-
if (final_alpha < 0.01)
549-
{
550-
discard;
551-
}
552563
vec4 color = vec4(diff.rgb,final_alpha);
553564
#else
554-
555-
#ifdef USE_VERTEX_COLOR
556-
float final_alpha = diff.a * vertex_color.a;
557-
diff.rgb *= vertex_color.rgb;
558-
#else
559-
float final_alpha = diff.a;
560-
#endif
561-
562565

563566
vec4 gamma_diff = diff;
564567
diff.rgb = srgb_to_linear(diff.rgb);

indra/newview/lldrawpoolsimple.cpp

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,6 @@
3737
#include "llviewershadermgr.h"
3838
#include "llrender.h"
3939

40-
#define GE_FORCE_WORKAROUND LL_DARWIN
41-
4240
static LLGLSLShader* simple_shader = NULL;
4341
static LLGLSLShader* fullbright_shader = NULL;
4442

@@ -664,13 +662,6 @@ void LLDrawPoolFullbrightAlphaMask::beginPostDeferredPass(S32 pass)
664662
else
665663
{
666664

667-
// Work-around until we can figure out why the right shader causes
668-
// the GeForce driver to go tango uniform on OS X 10.6.8 only
669-
//
670-
#if GE_FORCE_WORKAROUND
671-
gObjectFullbrightAlphaMaskProgram.bind();
672-
gObjectFullbrightAlphaMaskProgram.uniform1f(LLShaderMgr::TEXTURE_GAMMA, 2.2f);
673-
#else
674665
if (LLPipeline::sUnderWaterRender)
675666
{
676667
gDeferredFullbrightAlphaMaskWaterProgram.bind();
@@ -681,7 +672,6 @@ void LLDrawPoolFullbrightAlphaMask::beginPostDeferredPass(S32 pass)
681672
gDeferredFullbrightAlphaMaskProgram.bind();
682673
gDeferredFullbrightAlphaMaskProgram.uniform1f(LLShaderMgr::TEXTURE_GAMMA, 2.2f);
683674
}
684-
#endif
685675
}
686676

687677
}
@@ -704,13 +694,6 @@ void LLDrawPoolFullbrightAlphaMask::endPostDeferredPass(S32 pass)
704694
}
705695
else
706696
{
707-
708-
// Work-around until we can figure out why the right shader causes
709-
// the GeForce driver to go tango uniform on OS X 10.6.8 only
710-
//
711-
#if GE_FORCE_WORKAROUND
712-
gObjectFullbrightAlphaMaskProgram.unbind();
713-
#else
714697
if (LLPipeline::sUnderWaterRender)
715698
{
716699
gDeferredFullbrightAlphaMaskWaterProgram.unbind();
@@ -719,8 +702,6 @@ void LLDrawPoolFullbrightAlphaMask::endPostDeferredPass(S32 pass)
719702
{
720703
gDeferredFullbrightAlphaMaskProgram.unbind();
721704
}
722-
#endif
723-
724705
}
725706
LLRenderPass::endRenderPass(pass);
726707
}

0 commit comments

Comments
 (0)