summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings
diff options
context:
space:
mode:
authorGraham Linden <graham@lindenlab.com>2018-09-04 23:08:20 +0100
committerGraham Linden <graham@lindenlab.com>2018-09-04 23:08:20 +0100
commit2e55eae9cc6ebff303c8f322c71fec9c20e42bd8 (patch)
treeea4259bc673bbac6715cc0269a4cc6de3c8a9958 /indra/newview/app_settings
parentd1d248973d577d314bba16dc9f2977a7125b5f0d (diff)
Merge and fix MAINT-9087 and MAINT-9084
Diffstat (limited to 'indra/newview/app_settings')
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/starsF.glsl21
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/starsV.glsl4
2 files changed, 21 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..6c616db442 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,12 @@ 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;
+ col.a = (col.a * custom_alpha) * 8.0f;
+ col.a += twinkle() * 2.0f;
+ col.a = max(0.0f, col.a);
+
+ 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;
}