diff options
author | Graham Linden <graham@lindenlab.com> | 2018-09-04 23:43:39 +0100 |
---|---|---|
committer | Graham Linden <graham@lindenlab.com> | 2018-09-04 23:43:39 +0100 |
commit | a65afc30a968c752f1e252258e6917554a78f56a (patch) | |
tree | bb711036e634883453cd48140dd1478c761f2f71 /indra/newview/app_settings | |
parent | 32631f09a57548c2bbf7e09211a2053ff2e4e47d (diff) | |
parent | 0a78e9271c524c92cb8b1965e9a6081d4f700437 (diff) |
Merge
Diffstat (limited to 'indra/newview/app_settings')
-rw-r--r-- | indra/newview/app_settings/shaders/class1/deferred/starsF.glsl | 23 | ||||
-rw-r--r-- | indra/newview/app_settings/shaders/class1/deferred/starsV.glsl | 4 |
2 files changed, 23 insertions, 4 deletions
diff --git a/indra/newview/app_settings/shaders/class1/deferred/starsF.glsl b/indra/newview/app_settings/shaders/class1/deferred/starsF.glsl index d7f655709c..4ae3f7b76f 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/starsF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/starsF.glsl @@ -26,19 +26,26 @@ /*[EXTRA_CODE_HERE]*/ #ifdef DEFINE_GL_FRAGCOLOR -out vec4 frag_color; +out vec4 frag_data[3]; #else -#define frag_color gl_FragColor +#define frag_data gl_FragData #endif VARYING vec4 vertex_color; VARYING vec2 vary_texcoord0; +VARYING vec2 screenpos; uniform sampler2D diffuseMap; uniform sampler2D altDiffuseMap; uniform float blend_factor; uniform float custom_alpha; uniform vec4 sunlight_color; +uniform float time; + +float twinkle(){ + float d = fract(screenpos.x + screenpos.y); + return abs(d); +} void main() { @@ -46,6 +53,14 @@ void main() vec4 col_b = texture2D(diffuseMap, vary_texcoord0.xy); vec4 col = mix(col_b, col_a, blend_factor); col.rgb *= vertex_color.rgb; - col.a *= custom_alpha; - frag_color = col; + + float factor = smoothstep(0.0f, 0.9f, custom_alpha); + + col.a = (col.a * factor) * 32.0f; + col.a *= twinkle(); + + frag_data[0] = col; + frag_data[1] = vec4(0.0f); + frag_data[2] = vec4(0.0, 1.0, 0.0, 1.0); } + diff --git a/indra/newview/app_settings/shaders/class1/deferred/starsV.glsl b/indra/newview/app_settings/shaders/class1/deferred/starsV.glsl index 8bc5b06379..e14d02a4a9 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/starsV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/starsV.glsl @@ -25,6 +25,7 @@ uniform mat4 texture_matrix0; uniform mat4 modelview_projection_matrix; +uniform float time; ATTRIBUTE vec3 position; ATTRIBUTE vec4 diffuse_color; @@ -32,11 +33,14 @@ ATTRIBUTE vec2 texcoord0; VARYING vec4 vertex_color; VARYING vec2 vary_texcoord0; +VARYING vec2 screenpos; void main() { //transform vertex gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0); + float t = mod(time, 1.25f); + screenpos = position.xy * vec2(t, t); vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy; vertex_color = diffuse_color; } |