summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Pohoreski <ptolemy@lindenlab.com>2020-06-05 17:12:14 +0000
committerMichael Pohoreski <ptolemy@lindenlab.com>2020-06-05 17:12:14 +0000
commitafb9c52a00d91c674d1cc48a7b16dd7e2db8cf8f (patch)
treee5801dbc7b5ab6a1b7a354ec8072c70f56357be4
parentd1ed4deba0a8d895a78c871b551b47c353d54ab8 (diff)
parent25e6f789079e127fda89deb8e4b5debb3fe7d0b7 (diff)
Merged in SL-13084 (pull request #137)
SL-13084 [EEP] cloud texture is rendered backwards Approved-by: Dave Houlton <euclid@lindenlab.com>
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/cloudsV.glsl7
-rw-r--r--indra/newview/app_settings/shaders/class2/windlight/cloudsV.glsl36
-rw-r--r--indra/newview/llsettingsvo.cpp11
3 files changed, 36 insertions, 18 deletions
diff --git a/indra/newview/app_settings/shaders/class1/deferred/cloudsV.glsl b/indra/newview/app_settings/shaders/class1/deferred/cloudsV.glsl
index caa4fe1f65..495daa2db6 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/cloudsV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/cloudsV.glsl
@@ -70,15 +70,18 @@ uniform float cloud_scale;
// NOTE: Keep these in sync!
// indra\newview\app_settings\shaders\class1\deferred\skyV.glsl
// indra\newview\app_settings\shaders\class1\deferred\cloudsV.glsl
+// indra\newview\app-settings\shaders\class2\windlight\cloudsV.glsl
// indra\newview\lllegacyatmospherics.cpp
+// indra\newview\llsettingsvo.cpp
void main()
{
-
// World / view / projection
gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0);
// Texture coords
- vary_texcoord0 = texcoord0;
+ // SL-13084 EEP added support for custom cloud textures -- flip them horizontally to match the preview of Clouds > Cloud Scroll
+ vary_texcoord0 = vec2( -texcoord0.x, texcoord0.y ); // See: LLSettingsVOSky::applySpecial
+
vary_texcoord0.xy -= 0.5;
vary_texcoord0.xy /= cloud_scale;
vary_texcoord0.xy += 0.5;
diff --git a/indra/newview/app_settings/shaders/class2/windlight/cloudsV.glsl b/indra/newview/app_settings/shaders/class2/windlight/cloudsV.glsl
index 2c1475d547..a4389f62dc 100644
--- a/indra/newview/app_settings/shaders/class2/windlight/cloudsV.glsl
+++ b/indra/newview/app_settings/shaders/class2/windlight/cloudsV.glsl
@@ -36,6 +36,7 @@ ATTRIBUTE vec2 texcoord0;
VARYING vec4 vary_CloudColorSun;
VARYING vec4 vary_CloudColorAmbient;
VARYING float vary_CloudDensity;
+
VARYING vec2 vary_texcoord0;
VARYING vec2 vary_texcoord1;
VARYING vec2 vary_texcoord2;
@@ -66,13 +67,31 @@ uniform vec4 cloud_color;
uniform float cloud_scale;
+// NOTE: Keep these in sync!
+// indra\newview\app_settings\shaders\class1\deferred\skyV.glsl
+// indra\newview\app_settings\shaders\class1\deferred\cloudsV.glsl
+// indra\newview\app-settings\shaders\class2\windlight\cloudsV.glsl
+// indra\newview\lllegacyatmospherics.cpp
+// indra\newview\llsettingsvo.cpp
void main()
{
-
// World / view / projection
gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0);
- vary_texcoord0 = texcoord0;
+ // Texture coords
+ // SL-13084 EEP added support for custom cloud textures -- flip them horizontally to match the preview of Clouds > Cloud Scroll
+ vary_texcoord0 = vec2( -texcoord0.x, texcoord0.y ); // See: LLSettingsVOSky::applySpecial
+
+ vary_texcoord0.xy -= 0.5;
+ vary_texcoord0.xy /= cloud_scale;
+ vary_texcoord0.xy += 0.5;
+
+ vary_texcoord1 = vary_texcoord0;
+ vary_texcoord1.x += lightnorm.x * 0.0125;
+ vary_texcoord1.y += lightnorm.z * 0.0125;
+
+ vary_texcoord2 = vary_texcoord0 * 16.;
+ vary_texcoord3 = vary_texcoord1 * 16.;
// Get relative position
vec3 P = position.xyz - camPosLocal.xyz + vec3(0,50,0);
@@ -175,19 +194,6 @@ void main()
vary_CloudDensity = 2. * (cloud_shadow - 0.25);
- // Texture coords
- vary_texcoord0 = texcoord0;
- vary_texcoord0.xy -= 0.5;
- vary_texcoord0.xy /= cloud_scale;
- vary_texcoord0.xy += 0.5;
-
- vary_texcoord1 = vary_texcoord0;
- vary_texcoord1.x += lightnorm.x * 0.0125;
- vary_texcoord1.y += lightnorm.z * 0.0125;
-
- vary_texcoord2 = vary_texcoord0 * 16.;
- vary_texcoord3 = vary_texcoord1 * 16.;
-
// Combine these to minimize register use
vary_CloudColorAmbient += oHazeColorBelowCloud;
diff --git a/indra/newview/llsettingsvo.cpp b/indra/newview/llsettingsvo.cpp
index c72a0706cd..5a4427a7b7 100644
--- a/indra/newview/llsettingsvo.cpp
+++ b/indra/newview/llsettingsvo.cpp
@@ -678,8 +678,17 @@ void LLSettingsVOSky::applySpecial(void *ptarget, bool force)
{
shader->uniform4fv(LLViewerShaderMgr::LIGHTNORM, 1, light_direction.mV);
+ // Legacy? SETTING_CLOUD_SCROLL_RATE("cloud_scroll_rate")
LLVector4 vect_c_p_d1(mSettings[SETTING_CLOUD_POS_DENSITY1]);
- vect_c_p_d1 += LLVector4(LLEnvironment::instance().getCloudScrollDelta());
+ LLVector4 cloud_scroll( LLEnvironment::instance().getCloudScrollDelta() );
+
+ // SL-13084 EEP added support for custom cloud textures -- flip them horizontally to match the preview of Clouds > Cloud Scroll
+ // Keep in Sync!
+ // * indra\newview\llsettingsvo.cpp
+ // * indra\newview\app_settings\shaders\class2\windlight\cloudsV.glsl
+ // * indra\newview\app_settings\shaders\class1\deferred\cloudsV.glsl
+ cloud_scroll[0] = -cloud_scroll[0];
+ vect_c_p_d1 += cloud_scroll;
shader->uniform4fv(LLShaderMgr::CLOUD_POS_DENSITY1, 1, vect_c_p_d1.mV);
LLSettingsSky::ptr_t psky = LLEnvironment::instance().getCurrentSky();