summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2013-04-18 19:21:08 -0500
committerDave Parks <davep@lindenlab.com>2013-04-18 19:21:08 -0500
commit509c35d5bae7dbd938198c3e038011932693ff36 (patch)
treee5d68e48e792a554097ba085b34d6cadd4062c32
parent28fcb3d54987a056b3dfe4d1d01a75339f8e6689 (diff)
NORSPEC-90 Cleanup avatar alpha shaders
-rw-r--r--indra/newview/app_settings/settings.xml2
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl17
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl10
-rw-r--r--indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl7
-rw-r--r--indra/newview/app_settings/shaders/class2/deferred/alphaV.glsl6
-rw-r--r--indra/newview/lldrawable.cpp2
-rw-r--r--indra/newview/llviewershadermgr.cpp7
7 files changed, 20 insertions, 31 deletions
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index 84b2bde206..eb5c9cc5c0 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -8072,7 +8072,7 @@
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
- <integer>1</integer>
+ <integer>0</integer>
</map>
<key>RenderDebugNormalScale</key>
<map>
diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl
index 94ce8a658a..495ed33e9e 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl
@@ -35,16 +35,10 @@ out vec4 frag_color;
#define frag_color gl_FragColor
#endif
-uniform sampler2DRect depthMap;
-
#if INDEX_MODE != INDEXED
uniform sampler2D diffuseMap;
#endif
-#if INDEX_MODE == INDEXED
-vec4 diffuseLookup(vec2 texcoord);
-#endif
-
uniform vec2 screen_res;
vec3 atmosLighting(vec3 light);
@@ -57,27 +51,16 @@ VARYING vec3 vary_position;
VARYING vec3 vary_pointlight_col;
VARYING vec2 vary_texcoord0;
VARYING vec3 vary_norm;
-VARYING mat3 vary_rotation;
#if INDEX_MODE != NON_INDEXED_NO_COLOR
VARYING vec4 vertex_color;
#endif
-uniform mat4 inv_proj;
-
uniform vec4 light_position[8];
uniform vec3 light_direction[8];
uniform vec3 light_attenuation[8];
uniform vec3 light_diffuse[8];
-uniform samplerCube environmentMap;
-uniform mat3 env_mat;
-
-uniform vec4 specular_color;
-
-
-uniform float shadow_offset;
-
vec3 calcDirectionalLight(vec3 n, vec3 l)
{
float a = pow(max(dot(n,l),0.0), 0.7);
diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl
index 76277069d5..4c26621a88 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl
@@ -38,7 +38,9 @@ ATTRIBUTE vec3 position;
void passTextureIndex();
#endif
ATTRIBUTE vec3 normal;
+#if INDEX_MODE != NON_INDEXED_NO_COLOR
ATTRIBUTE vec4 diffuse_color;
+#endif
ATTRIBUTE vec2 texcoord0;
#if HAS_SKIN
@@ -72,8 +74,6 @@ VARYING vec2 vary_texcoord0;
VARYING vec3 vary_norm;
uniform float near_clip;
-uniform float shadow_offset;
-uniform float shadow_bias;
uniform vec4 light_position[8];
uniform vec3 light_direction[8];
@@ -162,9 +162,13 @@ void main()
#endif
vary_norm = norm;
-
+ vary_position = pos.xyz;
+
calcAtmospherics(pos.xyz);
+#if INDEX_MODE == NON_INDEXED_NO_COLOR
+ vec4 diffuse_color = vec4(1,1,1,1);
+#endif
//vec4 color = calcLighting(pos.xyz, norm, diffuse_color, vec4(0.));
vec4 col = vec4(0.0, 0.0, 0.0, diffuse_color.a);
diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl
index c765962352..76a045a3bb 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl
@@ -56,10 +56,7 @@ VARYING vec3 vary_fragcoord;
VARYING vec3 vary_position;
VARYING vec3 vary_pointlight_col;
VARYING vec2 vary_texcoord0;
-VARYING vec2 vary_texcoord1;
-VARYING vec2 vary_texcoord2;
VARYING vec3 vary_norm;
-VARYING mat3 vary_rotation;
#if INDEX_MODE != NON_INDEXED_NO_COLOR
VARYING vec4 vertex_color;
@@ -69,15 +66,11 @@ uniform mat4 shadow_matrix[6];
uniform vec4 shadow_clip;
uniform float shadow_bias;
-uniform mat4 inv_proj;
-
uniform vec4 light_position[8];
uniform vec3 light_direction[8];
uniform vec3 light_attenuation[8];
uniform vec3 light_diffuse[8];
-uniform vec4 specular_color;
-
vec3 calcDirectionalLight(vec3 n, vec3 l)
{
float a = pow(max(dot(n,l),0.0), 0.7);
diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaV.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaV.glsl
index 63953b37bf..44abbdfe54 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/alphaV.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/alphaV.glsl
@@ -38,7 +38,9 @@ ATTRIBUTE vec3 position;
void passTextureIndex();
#endif
ATTRIBUTE vec3 normal;
+#if INDEX_MODE != NON_INDEXED_NO_COLOR
ATTRIBUTE vec4 diffuse_color;
+#endif
ATTRIBUTE vec2 texcoord0;
#if HAS_SKIN
@@ -167,6 +169,10 @@ void main()
calcAtmospherics(pos.xyz);
+#if INDEX_MODE == NON_INDEXED_NO_COLOR
+ vec4 diffuse_color = vec4(1,1,1,1);
+#endif
+
//vec4 color = calcLighting(pos.xyz, norm, diffuse_color, vec4(0.));
vec4 col = vec4(0.0, 0.0, 0.0, diffuse_color.a);
diff --git a/indra/newview/lldrawable.cpp b/indra/newview/lldrawable.cpp
index e9895a6e10..fe058cf094 100644
--- a/indra/newview/lldrawable.cpp
+++ b/indra/newview/lldrawable.cpp
@@ -484,7 +484,7 @@ void LLDrawable::makeActive()
}
llassert(isAvatar() || isRoot() || mParent->isActive());
- }
+}
void LLDrawable::makeStatic(BOOL warning_enabled)
diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp
index 2442e04a42..499f6a848c 100644
--- a/indra/newview/llviewershadermgr.cpp
+++ b/indra/newview/llviewershadermgr.cpp
@@ -1588,8 +1588,11 @@ BOOL LLViewerShaderMgr::loadShadersDeferred()
gDeferredAvatarAlphaProgram.mFeatures.isAlphaLighting = true;
gDeferredAvatarAlphaProgram.mFeatures.disableTextureIndex = true;
gDeferredAvatarAlphaProgram.mShaderFiles.clear();
- gDeferredAvatarAlphaProgram.mShaderFiles.push_back(make_pair("deferred/avatarAlphaNoColorV.glsl", GL_VERTEX_SHADER_ARB));
- gDeferredAvatarAlphaProgram.mShaderFiles.push_back(make_pair("deferred/alphaNonIndexedNoColorF.glsl", GL_FRAGMENT_SHADER_ARB));
+ gDeferredAvatarAlphaProgram.mShaderFiles.push_back(make_pair("deferred/alphaV.glsl", GL_VERTEX_SHADER_ARB));
+ gDeferredAvatarAlphaProgram.mShaderFiles.push_back(make_pair("deferred/alphaF.glsl", GL_FRAGMENT_SHADER_ARB));
+ gDeferredAvatarAlphaProgram.addPermutation("INDEX_MODE", "3");
+ gDeferredAvatarAlphaProgram.addPermutation("HAS_SKIN", "0");
+ gDeferredAvatarAlphaProgram.addPermutation("IS_AVATAR_SKIN", "1");
gDeferredAvatarAlphaProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED];
success = gDeferredAvatarAlphaProgram.createShader(NULL, &mAvatarUniforms);