summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
Diffstat (limited to 'indra')
-rw-r--r--indra/llrender/llshadermgr.cpp13
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/materialF.glsl30
2 files changed, 34 insertions, 9 deletions
diff --git a/indra/llrender/llshadermgr.cpp b/indra/llrender/llshadermgr.cpp
index bce3720d3b..896dd566c1 100644
--- a/indra/llrender/llshadermgr.cpp
+++ b/indra/llrender/llshadermgr.cpp
@@ -570,9 +570,20 @@ static std::string get_object_log(GLhandleARB ret)
//dump shader source for debugging
void LLShaderMgr::dumpShaderSource(U32 shader_code_count, GLcharARB** shader_code_text)
{
- for (GLuint i = 0; i < shader_code_count; i++)
+ for (U32 i = 0; i < shader_code_count; i++)
{
+ GLcharARB *line = shader_code_text[i];
+ size_t len = strlen( line );
+ GLcharARB last = len > 0 ? line[len - 1] : 0;
+
+ // LL_ENDL already outputs a newline so temporarily strip off the end newline to prevent EVERY line outputting an (extra) blank line
+ if (last == '\n')
+ line[len - 1] = 0;
+
LL_SHADER_LOADING_WARNS() << i << ": " << shader_code_text[i] << LL_ENDL;
+
+ if (last == '\n')
+ line[len - 1] = '\n';
}
LL_SHADER_LOADING_WARNS() << LL_ENDL;
}
diff --git a/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl b/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl
index 9505f2eb74..c23314a4b9 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl
@@ -264,8 +264,7 @@ void main()
tnorm = vary_normal;
#endif
- norm.xyz = tnorm;
- norm.xyz = normalize(norm.xyz);
+ norm.xyz = normalize(tnorm.xyz);
vec2 abnormal = encode_normal(norm.xyz);
@@ -277,7 +276,24 @@ void main()
final_color.a = max(final_color.a, emissive_brightness);
- vec4 final_normal = vec4(abnormal, env_intensity, 0.0);
+ // Texture
+ // [x] Full Bright Object
+ // Shininess (specular)
+ // [X] Texture
+ // Environment Intensity = 1
+ // NOTE: There are two shaders that are used depending on the EI byte value:
+ // EI = 0 fullbright
+ // EI > 0 .. 255 material
+ // When it is passed to us it is normalized.
+ // We can either modify the output environment intensity
+ // OR
+ // adjust the final color via:
+ // final_color *= 0.666666;
+ // We remap the environment intensity to closely simulate what non-EEP is doing.
+ // At midnight the brightness is exact.
+ // At midday the brightness is very close.
+ float ei = env_intensity*0.5 + 0.5;
+ vec4 final_normal = vec4(abnormal, ei, 0.0);
vec4 final_specular = spec;
final_specular.a = specular_color.a;
@@ -316,11 +332,8 @@ void main()
vec3 refnormpersp = normalize(reflect(pos.xyz, norm.xyz));
- float da = dot(normalize(norm.xyz), normalize(light_dir.xyz));
- da = clamp(da, -1.0, 1.0);
-
- float final_da = da;
- final_da = clamp(final_da, 0.0, 1.0);
+ float da = dot(norm.xyz, normalize(light_dir.xyz));
+ float final_da = clamp(da, 0.0, 1.0);
float ambient = da;
ambient *= 0.5;
@@ -458,3 +471,4 @@ vec3 post_atmo = color.rgb;
#endif
}
+