summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl9
-rw-r--r--indra/newview/lldrawpoolalpha.cpp11
2 files changed, 14 insertions, 6 deletions
diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl
index 638a0f4e15..38afd82c8d 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl
@@ -56,6 +56,10 @@ VARYING vec3 vary_norm;
VARYING vec4 vertex_color; //vertex color should be treated as sRGB
#endif
+#ifdef FOR_IMPOSTOR
+uniform float minimum_alpha;
+#endif
+
uniform mat4 proj_mat;
uniform mat4 inv_proj;
uniform vec2 screen_res;
@@ -204,10 +208,13 @@ void main()
// Insure we don't pollute depth with invis pixels in impostor rendering
//
- if (final_alpha < 0.01)
+ if (final_alpha < minimum_alpha)
{
discard;
}
+
+ color.rgb = diffuse_srgb.rgb;
+ color.a = final_alpha;
#else
vec3 light_dir = (sun_up_factor == 1) ? sun_dir: moon_dir;
diff --git a/indra/newview/lldrawpoolalpha.cpp b/indra/newview/lldrawpoolalpha.cpp
index 29d855fb93..a2b263f34e 100644
--- a/indra/newview/lldrawpoolalpha.cpp
+++ b/indra/newview/lldrawpoolalpha.cpp
@@ -106,7 +106,7 @@ static void prepare_alpha_shader(LLGLSLShader* shader, bool textureGamma, bool d
if (LLPipeline::sImpostorRender)
{
- shader->setMinimumAlpha(0.5f);
+ shader->setMinimumAlpha(0.1f);
}
else
{
@@ -130,14 +130,15 @@ void LLDrawPoolAlpha::renderPostDeferred(S32 pass)
deferred_render = TRUE;
// prepare shaders
- emissive_shader = (LLPipeline::sUnderWaterRender) ? &gObjectEmissiveWaterProgram : &gObjectEmissiveProgram;
+ emissive_shader = (LLPipeline::sRenderDeferred) ? &gDeferredEmissiveProgram :
+ (LLPipeline::sUnderWaterRender) ? &gObjectEmissiveWaterProgram : &gObjectEmissiveProgram;
prepare_alpha_shader(emissive_shader, true, false);
- fullbright_shader = (LLPipeline::sImpostorRender) ? &gDeferredFullbrightProgram :
+ fullbright_shader = (LLPipeline::sImpostorRender) ? &gDeferredFullbrightAlphaMaskProgram :
(LLPipeline::sUnderWaterRender) ? &gDeferredFullbrightWaterProgram : &gDeferredFullbrightProgram;
prepare_alpha_shader(fullbright_shader, true, false);
- simple_shader = (LLPipeline::sImpostorRender) ? &gDeferredAlphaImpostorProgram :
+ simple_shader = (LLPipeline::sImpostorRender) ? &gDeferredAlphaImpostorProgram :
(LLPipeline::sUnderWaterRender) ? &gDeferredAlphaWaterProgram : &gDeferredAlphaProgram;
prepare_alpha_shader(simple_shader, false, true); //prime simple shader (loads shadow relevant uniforms)
@@ -207,7 +208,7 @@ void LLDrawPoolAlpha::render(S32 pass)
F32 minimum_alpha = 0.f;
if (LLPipeline::sImpostorRender)
{
- minimum_alpha = 0.5f;
+ minimum_alpha = 0.1f;
}
prepare_forward_shader(fullbright_shader, minimum_alpha);
prepare_forward_shader(simple_shader, minimum_alpha);