summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorGraham Linden <graham@lindenlab.com>2018-08-22 23:02:16 +0100
committerGraham Linden <graham@lindenlab.com>2018-08-22 23:02:16 +0100
commitf45edabe478eb2e5ed899377f541875cbd566977 (patch)
tree35312453eaeb9f327388464e4741c392408f07ef /indra
parent3b9e6636e5e0ab9d29d4fa97a7babe024de0af82 (diff)
MAINT-9026 hook up sun/moon scale to settingsvo and render code
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llsettingsvo.cpp3
-rw-r--r--indra/newview/llsky.cpp16
-rw-r--r--indra/newview/llsky.h3
-rw-r--r--indra/newview/llvosky.cpp20
-rw-r--r--indra/newview/llvosky.h8
5 files changed, 44 insertions, 6 deletions
diff --git a/indra/newview/llsettingsvo.cpp b/indra/newview/llsettingsvo.cpp
index c56b5df74d..3638cd0b44 100644
--- a/indra/newview/llsettingsvo.cpp
+++ b/indra/newview/llsettingsvo.cpp
@@ -579,6 +579,9 @@ void LLSettingsVOSky::updateSettings()
gSky.setMoonTextures(getMoonTextureId(), getNextMoonTextureId());
gSky.setCloudNoiseTextures(getCloudNoiseTextureId(), getNextCloudNoiseTextureId());
gSky.setBloomTextures(getBloomTextureId(), getNextBloomTextureId());
+
+ gSky.setSunScale(getSunScale());
+ gSky.setMoonScale(getMoonScale());
}
void LLSettingsVOSky::applySpecial(void *ptarget)
diff --git a/indra/newview/llsky.cpp b/indra/newview/llsky.cpp
index 9c7fc225a0..0740878901 100644
--- a/indra/newview/llsky.cpp
+++ b/indra/newview/llsky.cpp
@@ -129,6 +129,22 @@ void LLSky::resetVertexBuffers()
}
}
+void LLSky::setSunScale(F32 sun_scale)
+{
+ if(mVOSkyp.notNull())
+ {
+ mVOSkyp->setSunScale(sun_scale);
+ }
+}
+
+void LLSky::setMoonScale(F32 moon_scale)
+{
+ if(mVOSkyp.notNull())
+ {
+ mVOSkyp->setMoonScale(moon_scale);
+ }
+}
+
void LLSky::setSunTextures(const LLUUID& sun_texture, const LLUUID& sun_texture_next)
{
if(mVOSkyp.notNull()) {
diff --git a/indra/newview/llsky.h b/indra/newview/llsky.h
index d2067a58bb..e3cc567888 100644
--- a/indra/newview/llsky.h
+++ b/indra/newview/llsky.h
@@ -61,6 +61,9 @@ public:
void setCloudNoiseTextures(const LLUUID& cloud_noise_texture, const LLUUID& cloud_noise_texture_next);
void setBloomTextures(const LLUUID& bloom_texture, const LLUUID& bloom_texture_next);
+ void setSunScale(F32 sun_scale);
+ void setMoonScale(F32 moon_scale);
+
LLColor4 getSkyFogColor() const;
void setCloudDensityAtAgent(F32 cloud_density);
diff --git a/indra/newview/llvosky.cpp b/indra/newview/llvosky.cpp
index 64be033fdc..81632796e4 100644
--- a/indra/newview/llvosky.cpp
+++ b/indra/newview/llvosky.cpp
@@ -775,6 +775,16 @@ LLDrawable *LLVOSky::createDrawable(LLPipeline *pipeline)
return mDrawable;
}
+void LLVOSky::setSunScale(F32 sun_scale)
+{
+ mSunScale = sun_scale;
+}
+
+void LLVOSky::setMoonScale(F32 moon_scale)
+{
+ mMoonScale = moon_scale;
+}
+
void LLVOSky::setSunTextures(const LLUUID& sun_texture, const LLUUID& sun_texture_next)
{
// We test the UUIDs here because we explicitly do not want the default image returned by getFetchedTexture in that case...
@@ -955,8 +965,8 @@ BOOL LLVOSky::updateGeometry(LLDrawable *drawable)
right.normalize();
up.normalize();
- bool draw_sun = updateHeavenlyBodyGeometry(drawable, FACE_SUN, mSun, up, right);
- bool draw_moon = updateHeavenlyBodyGeometry(drawable, FACE_MOON, mMoon, up, right);
+ bool draw_sun = updateHeavenlyBodyGeometry(drawable, mSunScale, FACE_SUN, mSun, up, right);
+ bool draw_moon = updateHeavenlyBodyGeometry(drawable, mMoonScale, FACE_MOON, mMoon, up, right);
draw_sun &= LLEnvironment::getInstance()->getIsSunUp();
draw_moon &= LLEnvironment::getInstance()->getIsMoonUp();
@@ -987,7 +997,7 @@ BOOL LLVOSky::updateGeometry(LLDrawable *drawable)
return TRUE;
}
-bool LLVOSky::updateHeavenlyBodyGeometry(LLDrawable *drawable, const S32 f, LLHeavenBody& hb, const LLVector3 &up, const LLVector3 &right)
+bool LLVOSky::updateHeavenlyBodyGeometry(LLDrawable *drawable, F32 scale, const S32 f, LLHeavenBody& hb, const LLVector3 &up, const LLVector3 &right)
{
mHeavenlyBodyUpdated = TRUE ;
@@ -1010,8 +1020,8 @@ bool LLVOSky::updateHeavenlyBodyGeometry(LLDrawable *drawable, const S32 f, LLHe
F32 horiz_enlargement = 1 + enlargm_factor * 0.3f;
F32 vert_enlargement = 1 + enlargm_factor * 0.2f;
- const LLVector3 scaled_right = horiz_enlargement * HEAVENLY_BODY_DIST * HEAVENLY_BODY_FACTOR * hb.getDiskRadius() * hb_right;
- const LLVector3 scaled_up = vert_enlargement * HEAVENLY_BODY_DIST * HEAVENLY_BODY_FACTOR * hb.getDiskRadius() * hb_up;
+ const LLVector3 scaled_right = horiz_enlargement * scale * HEAVENLY_BODY_DIST * HEAVENLY_BODY_FACTOR * hb.getDiskRadius() * hb_right;
+ const LLVector3 scaled_up = vert_enlargement * scale * HEAVENLY_BODY_DIST * HEAVENLY_BODY_FACTOR * hb.getDiskRadius() * hb_up;
LLVector3 v_clipped[4];
diff --git a/indra/newview/llvosky.h b/indra/newview/llvosky.h
index d8039b7f80..4943c48f7c 100644
--- a/indra/newview/llvosky.h
+++ b/indra/newview/llvosky.h
@@ -236,7 +236,7 @@ public:
void setSunDirectionCFR(const LLVector3 &sun_direction);
void setMoonDirectionCFR(const LLVector3 &moon_direction);
- bool updateHeavenlyBodyGeometry(LLDrawable *drawable, const S32 side, LLHeavenBody& hb, const LLVector3 &up, const LLVector3 &right);
+ bool updateHeavenlyBodyGeometry(LLDrawable *drawable, F32 scale, const S32 side, LLHeavenBody& hb, const LLVector3 &up, const LLVector3 &right);
void updateReflectionGeometry(LLDrawable *drawable, F32 H, const LLHeavenBody& HB);
F32 getWorldScale() const { return mWorldScale; }
@@ -278,6 +278,9 @@ public:
void setCloudNoiseTextures(const LLUUID& cloud_noise_texture, const LLUUID& cloud_noise_texture_next);
void setBloomTextures(const LLUUID& bloom_texture, const LLUUID& bloom_texture_next);
+ void setSunScale(F32 sun_scale);
+ void setMoonScale(F32 sun_scale);
+
void forceSkyUpdate(void) { mForceUpdate = TRUE; }
public:
@@ -297,6 +300,9 @@ protected:
LLPointer<LLViewerFetchedTexture> mCloudNoiseTexturep[2];
LLPointer<LLViewerFetchedTexture> mBloomTexturep[2];
+ F32 mSunScale = 1.0f;
+ F32 mMoonScale = 1.0f;
+
static S32 sResolution;
static S32 sTileResX;
static S32 sTileResY;