summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings/shaders
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/app_settings/shaders')
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl1
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl1
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl6
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl1
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl3
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/postDeferredNoDoFF.glsl3
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl14
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl6
-rw-r--r--indra/newview/app_settings/shaders/class1/lighting/lightFullbrightAlphaMaskF.glsl4
-rw-r--r--indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl1
-rw-r--r--indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl6
-rw-r--r--indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl13
-rw-r--r--indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl6
-rw-r--r--indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsF.glsl4
-rw-r--r--indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsV.glsl8
15 files changed, 60 insertions, 17 deletions
diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl
index dd87ddb330..ef04ef5ce6 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl
@@ -59,6 +59,7 @@ void main()
vec4 pos = vec4(vary_position, 1.0);
vec4 diff= diffuseLookup(vary_texcoord0.xy);
+ diff.rgb = pow(diff.rgb, vec3(2.2));
vec4 col = vec4(vary_ambient + vary_directional.rgb, vertex_color.a);
vec4 color = diff * col;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl
index 36433a5827..b6a9417fe7 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl
@@ -43,6 +43,7 @@ void main()
float shadow = 1.0;
vec4 color = diffuseLookup(vary_texcoord0.xy)*vertex_color;
+ color.rgb = pow(color.rgb, vec3(2.2));
color.rgb = fullbrightAtmosTransport(color.rgb);
diff --git a/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl
index bff87cb6aa..53e5a228fa 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl
@@ -70,6 +70,8 @@ vec4 texture2DLodSpecular(sampler2D projectionMap, vec2 tc, float lod)
{
vec4 ret = texture2DLod(projectionMap, tc, lod);
+ ret.rgb = pow(ret.rgb, vec3(2.2));
+
vec2 dist = tc-vec2(0.5);
float det = max(1.0-lod/(proj_lod*0.5), 0.0);
@@ -85,6 +87,8 @@ vec4 texture2DLodDiffuse(sampler2D projectionMap, vec2 tc, float lod)
{
vec4 ret = texture2DLod(projectionMap, tc, lod);
+ ret.rgb = pow(ret.rgb, vec3(2.2));
+
vec2 dist = vec2(0.5) - abs(tc-vec2(0.5));
float det = min(lod/(proj_lod*0.5), 1.0);
@@ -102,6 +106,8 @@ vec4 texture2DLodAmbient(sampler2D projectionMap, vec2 tc, float lod)
{
vec4 ret = texture2DLod(projectionMap, tc, lod);
+ ret.rgb = pow(ret.rgb, vec3(2.2));
+
vec2 dist = tc-vec2(0.5);
float d = dot(dist,dist);
diff --git a/indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl
index 6e5ac8317b..fa1572e692 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl
@@ -108,6 +108,7 @@ void main()
if (spec.a > 0.0)
{
float sa = dot(normalize(lv-normalize(pos)),norm);
+ spec.rgb += pow(1 - dot(-normalize(pos), norm), 2) * da * 3;
if (sa > 0.0)
{
sa = texture2D(lightFunc, vec2(sa, spec.a)).r * min(dist_atten*4.0, 1.0);
diff --git a/indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl b/indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl
index bf362e21a4..3f57b006cd 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl
@@ -37,6 +37,7 @@ uniform mat4 inv_proj;
uniform vec2 screen_res;
uniform float max_cof;
uniform float res_scale;
+uniform float global_gamma;
VARYING vec2 vary_fragcoord;
@@ -123,6 +124,6 @@ void main()
diff /= w;
}
-
+ diff.rgb = pow(diff.rgb, vec3(1.0/global_gamma));
frag_color = diff;
}
diff --git a/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoDoFF.glsl b/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoDoFF.glsl
index eb5beeef39..c891c4e445 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoDoFF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoDoFF.glsl
@@ -35,12 +35,13 @@ uniform sampler2DRect diffuseRect;
uniform sampler2D bloomMap;
uniform vec2 screen_res;
+uniform float global_gamma;
VARYING vec2 vary_fragcoord;
void main()
{
vec4 diff = texture2DRect(diffuseRect, vary_fragcoord.xy);
-
+ diff.rgb = pow(diff.rgb, vec3(1.0/global_gamma));
vec4 bloom = texture2D(bloomMap, vary_fragcoord.xy/screen_res);
frag_color = diff + bloom;
}
diff --git a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl
index 14eaafeb68..87cdf1026f 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl
@@ -77,6 +77,11 @@ vec3 vary_AtmosAttenuation;
uniform mat4 inv_proj;
uniform vec2 screen_res;
+vec3 samplesRGB(vec3 color)
+{
+ return pow(color, vec3(2.2));
+}
+
vec4 getPosition_d(vec2 pos_screen, float depth)
{
vec2 sc = pos_screen.xy*2.0;
@@ -101,22 +106,21 @@ vec3 getPositionEye()
}
vec3 getSunlitColor()
{
- return vary_SunlitColor;
+ return samplesRGB(vary_SunlitColor) * 4.4;
}
vec3 getAmblitColor()
{
- return vary_AmblitColor;
+ return samplesRGB((vary_AmblitColor)) * 2.2;
}
vec3 getAdditiveColor()
{
- return vary_AdditiveColor;
+ return samplesRGB(vary_AdditiveColor) * 2.2;
}
vec3 getAtmosAttenuation()
{
return vary_AtmosAttenuation;
}
-
void setPositionEye(vec3 v)
{
vary_PositionEye = v;
@@ -310,7 +314,7 @@ void main()
//add environmentmap
vec3 env_vec = env_mat * refnormpersp;
- col = mix(col.rgb, textureCube(environmentMap, env_vec).rgb,
+ col = mix(col.rgb, samplesRGB(textureCube(environmentMap, env_vec).rgb) * 2.2,
max(spec.a-diffuse.a*2.0, 0.0));
}
diff --git a/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl
index cca63872de..9bdf87678f 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl
@@ -72,6 +72,8 @@ vec4 texture2DLodSpecular(sampler2D projectionMap, vec2 tc, float lod)
{
vec4 ret = texture2DLod(projectionMap, tc, lod);
+ ret.rgb = pow(ret.rgb, vec3(2.2));
+
vec2 dist = tc-vec2(0.5);
float det = max(1.0-lod/(proj_lod*0.5), 0.0);
@@ -87,6 +89,8 @@ vec4 texture2DLodDiffuse(sampler2D projectionMap, vec2 tc, float lod)
{
vec4 ret = texture2DLod(projectionMap, tc, lod);
+ ret.rgb = pow(ret.rgb, vec3(2.2));
+
vec2 dist = vec2(0.5) - abs(tc-vec2(0.5));
float det = min(lod/(proj_lod*0.5), 1.0);
@@ -104,6 +108,8 @@ vec4 texture2DLodAmbient(sampler2D projectionMap, vec2 tc, float lod)
{
vec4 ret = texture2DLod(projectionMap, tc, lod);
+ ret.rgb = pow(ret.rgb, vec3(2.2));
+
vec2 dist = tc-vec2(0.5);
float d = dot(dist,dist);
diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightAlphaMaskF.glsl
index 6c34643aab..9543be562b 100644
--- a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightAlphaMaskF.glsl
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightAlphaMaskF.glsl
@@ -37,6 +37,8 @@ vec3 fullbrightScaleSoftClip(vec3 light);
VARYING vec4 vertex_color;
VARYING vec2 vary_texcoord0;
+uniform float texture_gamma;
+
void fullbright_lighting()
{
vec4 color = diffuseLookup(vary_texcoord0.xy) * vertex_color;
@@ -45,7 +47,7 @@ void fullbright_lighting()
{
discard;
}
-
+ color.rgb = pow(color.rgb, vec3(texture_gamma));
color.rgb = fullbrightAtmosTransport(color.rgb);
color.rgb = fullbrightScaleSoftClip(color.rgb);
diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl
index 12706f130b..359864556d 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl
@@ -149,6 +149,7 @@ void main()
}
vec4 diff = diffuseLookup(vary_texcoord0.xy);
+ diff.rgb = pow(diff.rgb, vec3(2.2));
vec4 col = vec4(vary_ambient + vary_directional.rgb*shadow, vertex_color.a);
vec4 color = diff * col;
diff --git a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl
index 5621e47ab7..695887c5ff 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl
@@ -71,6 +71,8 @@ vec4 texture2DLodSpecular(sampler2D projectionMap, vec2 tc, float lod)
{
vec4 ret = texture2DLod(projectionMap, tc, lod);
+ ret.rgb = pow(ret.rgb, vec3(2.2));
+
vec2 dist = tc-vec2(0.5);
float det = max(1.0-lod/(proj_lod*0.5), 0.0);
@@ -86,6 +88,8 @@ vec4 texture2DLodDiffuse(sampler2D projectionMap, vec2 tc, float lod)
{
vec4 ret = texture2DLod(projectionMap, tc, lod);
+ ret.rgb = pow(ret.rgb, vec3(2.2));
+
vec2 dist = vec2(0.5) - abs(tc-vec2(0.5));
float det = min(lod/(proj_lod*0.5), 1.0);
@@ -103,6 +107,8 @@ vec4 texture2DLodAmbient(sampler2D projectionMap, vec2 tc, float lod)
{
vec4 ret = texture2DLod(projectionMap, tc, lod);
+ ret.rgb = pow(ret.rgb, vec3(2.2));
+
vec2 dist = tc-vec2(0.5);
float d = dot(dist,dist);
diff --git a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl
index 457189b48e..bf4c476138 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl
@@ -79,6 +79,11 @@ vec3 vary_AmblitColor;
vec3 vary_AdditiveColor;
vec3 vary_AtmosAttenuation;
+vec3 samplesRGB(vec3 color)
+{
+ return pow(color, vec3(2.2));
+}
+
vec4 getPosition_d(vec2 pos_screen, float depth)
{
vec2 sc = pos_screen.xy*2.0;
@@ -103,15 +108,15 @@ vec3 getPositionEye()
}
vec3 getSunlitColor()
{
- return vary_SunlitColor;
+ return samplesRGB(vary_SunlitColor) * 4.4;
}
vec3 getAmblitColor()
{
- return vary_AmblitColor;
+ return samplesRGB(vary_AmblitColor) * 2.2;
}
vec3 getAdditiveColor()
{
- return vary_AdditiveColor;
+ return samplesRGB(vary_AdditiveColor) * 2.2;
}
vec3 getAtmosAttenuation()
{
@@ -318,7 +323,7 @@ void main()
//add environmentmap
vec3 env_vec = env_mat * refnormpersp;
- col = mix(col.rgb, textureCube(environmentMap, env_vec).rgb,
+ col = mix(col.rgb, samplesRGB(textureCube(environmentMap, env_vec).rgb) * 2.2,
max(spec.a-diffuse.a*2.0, 0.0));
}
diff --git a/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl
index 6d6ad6d565..525dd32106 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl
@@ -71,6 +71,8 @@ vec4 texture2DLodSpecular(sampler2D projectionMap, vec2 tc, float lod)
{
vec4 ret = texture2DLod(projectionMap, tc, lod);
+ ret.rgb = pow(ret.rgb, vec3(2.2));
+
vec2 dist = tc-vec2(0.5);
float det = max(1.0-lod/(proj_lod*0.5), 0.0);
@@ -86,6 +88,8 @@ vec4 texture2DLodDiffuse(sampler2D projectionMap, vec2 tc, float lod)
{
vec4 ret = texture2DLod(projectionMap, tc, lod);
+ ret.rgb = pow(ret.rgb, vec3(2.2));
+
vec2 dist = vec2(0.5) - abs(tc-vec2(0.5));
float det = min(lod/(proj_lod*0.5), 1.0);
@@ -103,6 +107,8 @@ vec4 texture2DLodAmbient(sampler2D projectionMap, vec2 tc, float lod)
{
vec4 ret = texture2DLod(projectionMap, tc, lod);
+ ret.rgb = pow(ret.rgb, vec3(2.2));
+
vec2 dist = tc-vec2(0.5);
float d = dot(dist,dist);
diff --git a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsF.glsl b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsF.glsl
index 765b0927c3..dd7de9f123 100644
--- a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsF.glsl
+++ b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsF.glsl
@@ -27,7 +27,7 @@
VARYING vec3 vary_SunlitColor;
VARYING vec3 vary_AdditiveColor;
VARYING vec3 vary_AtmosAttenuation;
-
+uniform float global_gamma;
vec3 getSunlitColor()
{
return vec3(0,0,0);
@@ -38,7 +38,7 @@ vec3 getAmblitColor()
}
vec3 getAdditiveColor()
{
- return vary_AdditiveColor;
+ return pow(vary_AdditiveColor, vec3(global_gamma)) * global_gamma;
}
vec3 getAtmosAttenuation()
{
diff --git a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsV.glsl b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsV.glsl
index 99dbee15ee..61f3088648 100644
--- a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsV.glsl
+++ b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsV.glsl
@@ -33,18 +33,20 @@ vec3 sunlit_color;
vec3 amblit_color;
vec3 position_eye;
+uniform float global_gamma;
+
vec3 getSunlitColor()
{
- return sunlit_color;
+ return pow(sunlit_color, vec3(global_gamma)) * global_gamma;
}
vec3 getAmblitColor()
{
- return amblit_color;
+ return pow(amblit_color, vec3(global_gamma)) * global_gamma;
}
vec3 getAdditiveColor()
{
- return additive_color;
+ return pow(additive_color, vec3(global_gamma)) * global_gamma;
}
vec3 getAtmosAttenuation()
{