diff options
author | Dave Parks <davep@lindenlab.com> | 2011-08-19 15:00:48 -0500 |
---|---|---|
committer | Dave Parks <davep@lindenlab.com> | 2011-08-19 15:00:48 -0500 |
commit | 0e496309d6cb7581c9f69b7da244699c382750ac (patch) | |
tree | ea8f36edbac232448d2aa1d7f7d407d9df999b6e /indra/newview/app_settings/shaders/class1/deferred | |
parent | f40d2c5afb78f4a17b4753c42f6756dbd76a18c8 (diff) | |
parent | 428c762a3ea6caec277d915b8b175403cf3f52dd (diff) |
merge
Diffstat (limited to 'indra/newview/app_settings/shaders/class1/deferred')
7 files changed, 115 insertions, 6 deletions
diff --git a/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskF.glsl new file mode 100644 index 0000000000..338d0ebb2b --- /dev/null +++ b/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskF.glsl @@ -0,0 +1,30 @@ +/** + * @file diffuseF.glsl + * + * $LicenseInfo:firstyear=2007&license=viewerlgpl$ + * $/LicenseInfo$ + */ + + +uniform float minimum_alpha; +uniform float maximum_alpha; + +uniform sampler2D diffuseMap; + +varying vec3 vary_normal; + +void main() +{ + vec4 col = gl_Color * texture2D(diffuseMap, gl_TexCoord[0].xy) * gl_Color; + + if (col.a < minimum_alpha || col.a > maximum_alpha) + { + discard; + } + + gl_FragData[0] = vec4(col.rgb, 0.0); + gl_FragData[1] = vec4(0,0,0,0); // spec + vec3 nvn = normalize(vary_normal); + gl_FragData[2] = vec4(nvn.xy * 0.5 + 0.5, nvn.z, 0.0); +} + diff --git a/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskIndexedF.glsl b/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskIndexedF.glsl new file mode 100644 index 0000000000..0671cb94bd --- /dev/null +++ b/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskIndexedF.glsl @@ -0,0 +1,26 @@ +/** + * @file diffuseAlphaMaskIndexedF.glsl + * + * $LicenseInfo:firstyear=2007&license=viewerlgpl$ + * $/LicenseInfo$ + */ + +varying vec3 vary_normal; + +uniform float minimum_alpha; +uniform float maximum_alpha; + +void main() +{ + vec4 col = diffuseLookup(gl_TexCoord[0].xy) * gl_Color; + + if (col.a < minimum_alpha || col.a > maximum_alpha) + { + discard; + } + + gl_FragData[0] = vec4(col.rgb, 0.0); + gl_FragData[1] = vec4(0,0,0,0); + vec3 nvn = normalize(vary_normal); + gl_FragData[2] = vec4(nvn.xy * 0.5 + 0.5, nvn.z, 0.0); +} diff --git a/indra/newview/app_settings/shaders/class1/deferred/impostorF.glsl b/indra/newview/app_settings/shaders/class1/deferred/impostorF.glsl index f1e9955bb6..7337f853a5 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/impostorF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/impostorF.glsl @@ -23,6 +23,8 @@ * $/LicenseInfo$ */ +uniform float minimum_alpha;
+uniform float maximum_alpha;
uniform sampler2D diffuseMap; @@ -32,6 +34,12 @@ uniform sampler2D specularMap; void main() { vec4 col = texture2D(diffuseMap, gl_TexCoord[0].xy); + + if (col.a < minimum_alpha || col.a > maximum_alpha)
+ {
+ discard;
+ }
+ gl_FragData[0] = vec4(col.rgb, col.a * 0.005); gl_FragData[1] = texture2D(specularMap, gl_TexCoord[0].xy); gl_FragData[2] = vec4(texture2D(normalMap, gl_TexCoord[0].xy).xyz, 0.0); diff --git a/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskF.glsl new file mode 100644 index 0000000000..e24d0b666e --- /dev/null +++ b/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskF.glsl @@ -0,0 +1,27 @@ +/** + * @file shadowAlphaMaskF.glsl + * + * $LicenseInfo:firstyear=2007&license=viewerlgpl$ + * $/LicenseInfo$ + */ + +uniform float minimum_alpha; +uniform float maximum_alpha; + +uniform sampler2D diffuseMap; + +varying vec4 post_pos; + +void main() +{ + float alpha = texture2D(diffuseMap, gl_TexCoord[0].xy).a * gl_Color.a; + + if (alpha < minimum_alpha || alpha > maximum_alpha) + { + discard; + } + + gl_FragColor = vec4(1,1,1,1); + + gl_FragDepth = max(post_pos.z/post_pos.w*0.5+0.5, 0.0); +} diff --git a/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskV.glsl b/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskV.glsl new file mode 100644 index 0000000000..58e9bcec58 --- /dev/null +++ b/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskV.glsl @@ -0,0 +1,23 @@ +/** + * @file shadowAlphaMaskV.glsl + * + * $LicenseInfo:firstyear=2007&license=viewerlgpl$ + * $/LicenseInfo$ + */ + + + +varying vec4 post_pos; + +void main() +{ + //transform vertex + vec4 pos = gl_ModelViewProjectionMatrix*gl_Vertex; + + post_pos = pos; + + gl_Position = vec4(pos.x, pos.y, pos.w*0.5, pos.w); + + gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0; + gl_FrontColor = gl_Color; +} diff --git a/indra/newview/app_settings/shaders/class1/deferred/shadowF.glsl b/indra/newview/app_settings/shaders/class1/deferred/shadowF.glsl index b687d97da0..785fe0084f 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/shadowF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/shadowF.glsl @@ -25,13 +25,11 @@ -uniform sampler2D diffuseMap; - varying vec4 post_pos; void main() { - gl_FragColor = vec4(1,1,1,texture2D(diffuseMap, gl_TexCoord[0].xy).a * gl_Color.a); + gl_FragColor = vec4(1,1,1,1); gl_FragDepth = max(post_pos.z/post_pos.w*0.5+0.5, 0.0); } diff --git a/indra/newview/app_settings/shaders/class1/deferred/shadowV.glsl b/indra/newview/app_settings/shaders/class1/deferred/shadowV.glsl index 394fedf28f..66fee10887 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/shadowV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/shadowV.glsl @@ -35,7 +35,4 @@ void main() post_pos = pos; gl_Position = vec4(pos.x, pos.y, pos.w*0.5, pos.w); - - gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0; - gl_FrontColor = gl_Color; } |