Merge branch 'master' of git://github.com/Shyotl/SingularityViewer

This commit is contained in:
Latif Khalifa
2013-11-13 20:12:25 +01:00
3 changed files with 31 additions and 51 deletions

View File

@@ -668,10 +668,6 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade
}
}
static const LLCachedControl<bool> SHPackDeferredNormals("SHPackDeferredNormals",false);
if(SHPackDeferredNormals)
text[count++] = strdup("#define PACK_NORMALS\n");
if(defines)
{
for (std::map<std::string,std::string>::iterator iter = defines->begin(); iter != defines->end(); ++iter)

View File

@@ -74,6 +74,10 @@ uniform float shadow_bias;
uniform sampler2D diffuseMap;
#endif
#ifdef IS_AVATAR_SKIN
uniform float minimum_alpha;
#endif
VARYING vec3 vary_fragcoord;
VARYING vec3 vary_position;
VARYING vec2 vary_texcoord0;
@@ -454,7 +458,33 @@ vec3 fullbrightScaleSoftClip(vec3 light)
void main()
{
#ifdef USE_INDEXED_TEX
vec4 diff = diffuseLookup(vary_texcoord0.xy);
#else
vec4 diff = texture2D(diffuseMap,vary_texcoord0.xy);
#endif
#ifdef USE_VERTEX_COLOR
float final_alpha = diff.a * vertex_color.a;
diff.rgb *= vertex_color.rgb;
#else
float final_alpha = diff.a;
#endif
#ifdef IS_AVATAR_SKIN
if(final_alpha < minimum_alpha)
{
discard;
}
#endif
#ifdef FOR_IMPOSTOR
// Insure we don't pollute depth with invis pixels in impostor rendering
//
if (final_alpha < 0.01)
{
discard;
}
#endif
vec4 pos = vec4(vary_position, 1.0);
float shadow = 1.0;
@@ -528,37 +558,10 @@ void main()
}
#endif
#ifdef USE_INDEXED_TEX
vec4 diff = diffuseLookup(vary_texcoord0.xy);
#else
vec4 diff = texture2D(diffuseMap,vary_texcoord0.xy);
#endif
#ifdef FOR_IMPOSTOR
#ifdef USE_VERTEX_COLOR
float final_alpha = diff.a * vertex_color.a;
diff.rgb *= vertex_color.rgb;
#else
float final_alpha = diff.a;
#endif
// Insure we don't pollute depth with invis pixels in impostor rendering
//
if (final_alpha < 0.01)
{
discard;
}
vec4 color = vec4(diff.rgb,final_alpha);
#else
#ifdef USE_VERTEX_COLOR
float final_alpha = diff.a * vertex_color.a;
diff.rgb *= vertex_color.rgb;
#else
float final_alpha = diff.a;
#endif
vec4 gamma_diff = diff;
diff.rgb = srgb_to_linear(diff.rgb);

View File

@@ -37,8 +37,6 @@
#include "llviewershadermgr.h"
#include "llrender.h"
#define GE_FORCE_WORKAROUND LL_DARWIN
static LLGLSLShader* simple_shader = NULL;
static LLGLSLShader* fullbright_shader = NULL;
@@ -664,13 +662,6 @@ void LLDrawPoolFullbrightAlphaMask::beginPostDeferredPass(S32 pass)
else
{
// Work-around until we can figure out why the right shader causes
// the GeForce driver to go tango uniform on OS X 10.6.8 only
//
#if GE_FORCE_WORKAROUND
gObjectFullbrightAlphaMaskProgram.bind();
gObjectFullbrightAlphaMaskProgram.uniform1f(LLShaderMgr::TEXTURE_GAMMA, 2.2f);
#else
if (LLPipeline::sUnderWaterRender)
{
gDeferredFullbrightAlphaMaskWaterProgram.bind();
@@ -681,7 +672,6 @@ void LLDrawPoolFullbrightAlphaMask::beginPostDeferredPass(S32 pass)
gDeferredFullbrightAlphaMaskProgram.bind();
gDeferredFullbrightAlphaMaskProgram.uniform1f(LLShaderMgr::TEXTURE_GAMMA, 2.2f);
}
#endif
}
}
@@ -704,13 +694,6 @@ void LLDrawPoolFullbrightAlphaMask::endPostDeferredPass(S32 pass)
}
else
{
// Work-around until we can figure out why the right shader causes
// the GeForce driver to go tango uniform on OS X 10.6.8 only
//
#if GE_FORCE_WORKAROUND
gObjectFullbrightAlphaMaskProgram.unbind();
#else
if (LLPipeline::sUnderWaterRender)
{
gDeferredFullbrightAlphaMaskWaterProgram.unbind();
@@ -719,8 +702,6 @@ void LLDrawPoolFullbrightAlphaMask::endPostDeferredPass(S32 pass)
{
gDeferredFullbrightAlphaMaskProgram.unbind();
}
#endif
}
LLRenderPass::endRenderPass(pass);
}