diff --git a/indra/llrender/llglslshader.cpp b/indra/llrender/llglslshader.cpp
index 639033f143d965a215bd88ac741bfff436e17279..c03d33080fe796d57d0c8156f53f34da853c7025 100644
--- a/indra/llrender/llglslshader.cpp
+++ b/indra/llrender/llglslshader.cpp
@@ -569,7 +569,7 @@ BOOL LLGLSLShader::mapAttributes(const std::vector<LLStaticHashedString> * attri
                 mAttribute[i] = index;
 #endif
                 mAttributeMask |= 1 << i;
-                LL_DEBUGS("ShaderLoading") << "Attribute " << name << " assigned to channel " << index << LL_ENDL;
+                LL_DEBUGS("ShaderUniform") << "Attribute " << name << " assigned to channel " << index << LL_ENDL;
             }
         }
         if (attributes != NULL)
@@ -581,7 +581,7 @@ BOOL LLGLSLShader::mapAttributes(const std::vector<LLStaticHashedString> * attri
                 if (index != -1)
                 {
                     mAttribute[LLShaderMgr::instance()->mReservedAttribs.size() + i] = index;
-                    LL_DEBUGS("ShaderLoading") << "Attribute " << name << " assigned to channel " << index << LL_ENDL;
+                    LL_DEBUGS("ShaderUniform") << "Attribute " << name << " assigned to channel " << index << LL_ENDL;
                 }
             }
         }
@@ -666,7 +666,7 @@ void LLGLSLShader::mapUniform(GLint index, const vector<LLStaticHashedString> *
         mUniformNameMap[location] = name;
         mUniformMap[hashedName] = location;
 
-        LL_DEBUGS("ShaderLoading") << "Uniform " << name << " is at location " << location << LL_ENDL;
+        LL_DEBUGS("ShaderUniform") << "Uniform " << name << " is at location " << location << LL_ENDL;
     
         //find the index of this uniform
         for (S32 i = 0; i < (S32) LLShaderMgr::instance()->mReservedUniforms.size(); i++)
@@ -714,7 +714,7 @@ GLint LLGLSLShader::mapUniformTextureChannel(GLint location, GLenum type)
         type == GL_SAMPLER_2D_MULTISAMPLE)
     {   //this here is a texture
         glUniform1iARB(location, mActiveTextureChannels);
-        LL_DEBUGS("ShaderLoading") << "Assigned to texture channel " << mActiveTextureChannels << LL_ENDL;
+        LL_DEBUGS("ShaderUniform") << "Assigned to texture channel " << mActiveTextureChannels << LL_ENDL;
         return mActiveTextureChannels++;
     }
     return -1;
@@ -858,7 +858,7 @@ BOOL LLGLSLShader::mapUniforms(const vector<LLStaticHashedString> * uniforms)
 
 	unbind();
 
-	LL_DEBUGS("ShaderLoading") << "Total Uniform Size: " << mTotalUniformSize << LL_ENDL;
+	LL_DEBUGS("ShaderUniform") << "Total Uniform Size: " << mTotalUniformSize << LL_ENDL;
 	return res;
 }
 
diff --git a/indra/newview/app_settings/shaders/class1/deferred/starsF.glsl b/indra/newview/app_settings/shaders/class1/deferred/starsF.glsl
index d7f655709c3234f012eea4e28fa5e45039f6b756..6c616db4423ffa18137f1575ea9cd541489bde18 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 8bc5b063799a77d7edc481fc0283c1577dc319c0..e14d02a4a95b1b86fb76c2f57a42c1dd391f1e36 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;
 }
diff --git a/indra/newview/lldrawpoolwlsky.cpp b/indra/newview/lldrawpoolwlsky.cpp
index 3ba855ac7347fb8c866b51fe1162041247fc62cf..26454d2bd1bee1dfb55995357b62312d5e6c06e6 100644
--- a/indra/newview/lldrawpoolwlsky.cpp
+++ b/indra/newview/lldrawpoolwlsky.cpp
@@ -52,6 +52,8 @@ static LLGLSLShader* sky_shader   = NULL;
 static LLGLSLShader* sun_shader   = NULL;
 static LLGLSLShader* moon_shader  = NULL;
 
+static float sStarTime;
+
 LLDrawPoolWLSky::LLDrawPoolWLSky(void) :
 	LLDrawPool(POOL_WL_SKY)
 {
@@ -235,10 +237,9 @@ void LLDrawPoolWLSky::renderStars(void) const
 	// clamping and allow the star_alpha param to brighten the stars.
 	LLColor4 star_alpha(LLColor4::black);
 
-    // *LAPRAS
-    star_alpha.mV[3] = LLEnvironment::instance().getCurrentSky()->getStarBrightness() / (2.f + ((rand() >> 16)/65535.0f)); // twinkle twinkle
-
-	// If start_brightness is not set, exit
+    star_alpha.mV[3] = LLEnvironment::instance().getCurrentSky()->getStarBrightness() / 512.f;
+    
+	// If star brightness is not set, exit
 	if( star_alpha.mV[3] < 0.001 )
 	{
 		LL_DEBUGS("SKY") << "star_brightness below threshold." << LL_ENDL;
@@ -298,9 +299,8 @@ void LLDrawPoolWLSky::renderStarsDeferred(void) const
 	LLGLSPipelineSkyBox gls_sky;
 	LLGLEnable blend(GL_BLEND);
 	gGL.setSceneBlendType(LLRender::BT_ADD_WITH_ALPHA);
-		
-	// *LAPRAS
-    F32 star_alpha = LLEnvironment::instance().getCurrentSky()->getStarBrightness() / (2.f + ((rand() >> 16)/65535.0f)); // twinkle twinkle
+
+    F32 star_alpha = LLEnvironment::instance().getCurrentSky()->getStarBrightness() / 512.0f;
 
 	// If start_brightness is not set, exit
 	if(star_alpha < 0.001f)
@@ -337,6 +337,11 @@ void LLDrawPoolWLSky::renderStarsDeferred(void) const
 
     gDeferredStarProgram.uniform1f(LLShaderMgr::BLEND_FACTOR, blend_factor);
 	gDeferredStarProgram.uniform1f(sCustomAlpha, star_alpha);
+
+    sStarTime = (F32)LLFrameTimer::getElapsedSeconds() * 0.5f;
+
+    gDeferredStarProgram.uniform1f(LLShaderMgr::WATER_TIME, sStarTime);
+
 	gSky.mVOWLSkyp->drawStars();
 
     gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp
index cd378c0a5614c4be459493dfe31988af1cebdfe8..05c722a114a893e33ea38d111253738e32656c29 100644
--- a/indra/newview/llviewershadermgr.cpp
+++ b/indra/newview/llviewershadermgr.cpp
@@ -46,6 +46,8 @@
 #include "llenvironment.h"
 #include "llatmosphere.h"
 
+#pragma optimize("", off)
+
 #ifdef LL_RELEASE_FOR_DOWNLOAD
 #define UNIFORM_ERRS LL_WARNS_ONCE("Shader")
 #else
diff --git a/indra/newview/llvosky.cpp b/indra/newview/llvosky.cpp
index 81632796e4ba3e5aa85fb77f3c87b93847345a38..d3b1f1459fa62acc152366c8101b9a97b4b419c3 100644
--- a/indra/newview/llvosky.cpp
+++ b/indra/newview/llvosky.cpp
@@ -59,6 +59,8 @@
 #undef min
 #undef max
 
+#pragma optimize("", off)
+
 namespace
 {
     const S32 NUM_TILES_X = 8;
@@ -376,6 +378,9 @@ LLVOSky::LLVOSky(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp)
 	mbCanSelect = FALSE;
 	mUpdateTimer.reset();
 
+    mForceUpdateThrottle.setTimerExpirySec(UPDATE_EXPRY);
+    mForceUpdateThrottle.reset();
+
 	for (S32 i = 0; i < 6; i++)
 	{
 		mSkyTex[i].init();
@@ -585,8 +590,7 @@ void LLVOSky::idleUpdate(LLAgent &agent, const F64 &time)
 }
 
 bool LLVOSky::updateSky()
-{
-    LLTimer forceupdThrottle;
+{    
     LLSettingsSky::ptr_t psky = LLEnvironment::instance().getCurrentSky();
 
     LLColor4 total_ambient = psky->getTotalAmbient();
@@ -640,15 +644,29 @@ bool LLVOSky::updateSky()
         bool light_direction_changed = (dot_lighting < LIGHT_DIRECTION_THRESHOLD);
         bool color_changed = (delta_color.length() >= COLOR_CHANGE_THRESHOLD);
 
-        mForceUpdate = mForceUpdate || light_direction_changed;
-        mForceUpdate = mForceUpdate || color_changed;
-        mForceUpdate = mForceUpdate || !mInitialized;
+        if (light_direction_changed)
+        {
+            mForceUpdate = true;
+        }
+
+        if (color_changed)
+        {
+            mForceUpdate = true;
+        }
+
+        if (!mInitialized)
+        {
+            mForceUpdate = true;
+        }
+        //mForceUpdate = mForceUpdate || light_direction_changed;
+        //mForceUpdate = mForceUpdate || color_changed;
+        //mForceUpdate = mForceUpdate || !mInitialized;
 
-        if (mForceUpdate && forceupdThrottle.hasExpired())
+        if (mForceUpdate && mForceUpdateThrottle.hasExpired())
 		{
             LL_RECORD_BLOCK_TIME(FTM_VOSKY_UPDATEFORCED);
 
-            forceupdThrottle.setTimerExpirySec(UPDATE_EXPRY);
+            mForceUpdateThrottle.setTimerExpirySec(UPDATE_EXPRY);
 
 			LLSkyTex::stepCurrent();			
 		
diff --git a/indra/newview/llvosky.h b/indra/newview/llvosky.h
index 4943c48f7c7187cecdd19edb8bb2a8af2199346e..be69757fc70c9baefdddb33409f7fdc0d2169fbc 100644
--- a/indra/newview/llvosky.h
+++ b/indra/newview/llvosky.h
@@ -338,7 +338,7 @@ class LLVOSky : public LLStaticViewerObject
 	S32					 mDrawRefl;
 
 	LLFrameTimer		mUpdateTimer;
-
+    LLTimer             mForceUpdateThrottle;
 	bool                mHeavenlyBodyUpdated ;
 
     LLAtmospherics      m_legacyAtmospherics;
diff --git a/indra/newview/llvowlsky.cpp b/indra/newview/llvowlsky.cpp
index db9452cce9b5430412144cea338ffdb4ce18c792..741d0e3992b0ae0bc7ce4095c5cebd84271b3943 100644
--- a/indra/newview/llvowlsky.cpp
+++ b/indra/newview/llvowlsky.cpp
@@ -637,7 +637,7 @@ BOOL LLVOWLSky::updateStarGeometry(LLDrawable *drawable)
 		LLVector3 left = at%LLVector3(0,0,1);
 		LLVector3 up = at%left;
 
-		F32 sc = 0.5f+ll_frand()*1.25f;
+		F32 sc = 0.8f + ll_frand()*2.5f;
 		left *= sc;
 		up *= sc;
 
diff --git a/indra/newview/skins/default/xui/en/panel_settings_sky_sunmoon.xml b/indra/newview/skins/default/xui/en/panel_settings_sky_sunmoon.xml
index 4b72bbbe0edc78856ecfe4489793ef15ea0e43b2..0ec3528718a336f2c919fb69ec6c9df0502f5ca8 100644
--- a/indra/newview/skins/default/xui/en/panel_settings_sky_sunmoon.xml
+++ b/indra/newview/skins/default/xui/en/panel_settings_sky_sunmoon.xml
@@ -171,7 +171,7 @@
                     layout="topleft"
                     left_delta="5"
                     min_val="0"
-                    max_val="2"
+                    max_val="512"
                     name="star_brightness"
                     top_delta="15"
                     width="250"