Fix env panel forward action.
Make env panel update environment when jumping frame to frame. Add separate funcs for sun/moon vectors in various coord systems. Make haze glow only pay attention to sun (i.e. fix sun glow when moon is near horizon in daytime).master
parent
327ded5129
commit
67ab0084f8
|
|
@ -206,7 +206,9 @@ LLSD LLSettingsBase::interpolateSDMap(const LLSD &settings, const LLSD &other, F
|
|||
|
||||
if (slerps.find(key_name) != slerps.end())
|
||||
{
|
||||
LLQuaternion q = slerp(mix, LLQuaternion(value), LLQuaternion(other_value));
|
||||
LLQuaternion a(value);
|
||||
LLQuaternion b(other_value);
|
||||
LLQuaternion q = slerp(mix, a, b);
|
||||
newvalue = q.getValue();
|
||||
}
|
||||
else
|
||||
|
|
|
|||
|
|
@ -386,6 +386,9 @@ void LLSettingsSky::blend(const LLSettingsBase::ptr_t &end, F64 blendf)
|
|||
LLSD blenddata = interpolateSDMap(mSettings, other->mSettings, blendf);
|
||||
|
||||
replaceSettings(blenddata);
|
||||
mPositionsDirty = true;
|
||||
mLightingDirty = true;
|
||||
|
||||
setBlendFactor(blendf);
|
||||
mNextSunTextureId = other->getSunTextureId();
|
||||
mNextMoonTextureId = other->getMoonTextureId();
|
||||
|
|
@ -771,11 +774,14 @@ LLSD LLSettingsSky::translateLegacySettings(const LLSD& legacy)
|
|||
|
||||
void LLSettingsSky::updateSettings()
|
||||
{
|
||||
mPositionsDirty = isDirty();
|
||||
mLightingDirty = isDirty();
|
||||
|
||||
// base class clears dirty flag so as to not trigger recursive update
|
||||
LLSettingsBase::updateSettings();
|
||||
|
||||
// NOTE: these functions are designed to do nothing unless a dirty bit has been set
|
||||
// so if you add new settings that are referenced by these update functions,
|
||||
// you'll need to insure that your setter updates the dirty bits as well
|
||||
calculateHeavenlyBodyPositions();
|
||||
calculateLightSettings();
|
||||
}
|
||||
|
||||
bool LLSettingsSky::getIsSunUp() const
|
||||
|
|
@ -792,10 +798,11 @@ bool LLSettingsSky::getIsMoonUp() const
|
|||
|
||||
void LLSettingsSky::calculateHeavenlyBodyPositions() const
|
||||
{
|
||||
/* can't do this as it gets defeated during animation of env panel settings
|
||||
if (!mPositionsDirty)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}*/
|
||||
|
||||
mPositionsDirty = false;
|
||||
|
||||
|
|
@ -811,7 +818,7 @@ void LLSettingsSky::calculateHeavenlyBodyPositions() const
|
|||
|
||||
LLVector3 LLSettingsSky::getLightDirection() const
|
||||
{
|
||||
calculateHeavenlyBodyPositions();
|
||||
update();
|
||||
|
||||
// is the normal from the sun or the moon
|
||||
if (getIsSunUp())
|
||||
|
|
@ -955,60 +962,61 @@ LLColor3 LLSettingsSky::gammaCorrect(const LLColor3& in) const
|
|||
|
||||
LLVector3 LLSettingsSky::getSunDirection() const
|
||||
{
|
||||
calculateHeavenlyBodyPositions();
|
||||
update();
|
||||
return mSunDirection;
|
||||
}
|
||||
|
||||
LLVector3 LLSettingsSky::getMoonDirection() const
|
||||
{
|
||||
calculateHeavenlyBodyPositions();
|
||||
update();
|
||||
return mMoonDirection;
|
||||
}
|
||||
|
||||
LLColor4U LLSettingsSky::getFadeColor() const
|
||||
{
|
||||
calculateLightSettings();
|
||||
update();
|
||||
return mFadeColor;
|
||||
}
|
||||
|
||||
LLColor4 LLSettingsSky::getMoonAmbient() const
|
||||
{
|
||||
calculateLightSettings();
|
||||
update();
|
||||
return mMoonAmbient;
|
||||
}
|
||||
|
||||
LLColor3 LLSettingsSky::getMoonDiffuse() const
|
||||
{
|
||||
calculateLightSettings();
|
||||
update();
|
||||
return mMoonDiffuse;
|
||||
}
|
||||
|
||||
LLColor4 LLSettingsSky::getSunAmbient() const
|
||||
{
|
||||
calculateLightSettings();
|
||||
update();
|
||||
return mSunAmbient;
|
||||
}
|
||||
|
||||
LLColor3 LLSettingsSky::getSunDiffuse() const
|
||||
{
|
||||
calculateLightSettings();
|
||||
update();
|
||||
return mSunDiffuse;
|
||||
}
|
||||
|
||||
LLColor4 LLSettingsSky::getTotalAmbient() const
|
||||
{
|
||||
calculateLightSettings();
|
||||
update();
|
||||
return mTotalAmbient;
|
||||
}
|
||||
|
||||
void LLSettingsSky::calculateLightSettings() const
|
||||
{
|
||||
/* can't do this as it gets defeated during animation of env panel settings
|
||||
if (!mLightingDirty)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
calculateHeavenlyBodyPositions();
|
||||
calculateHeavenlyBodyPositions();*/
|
||||
|
||||
mLightingDirty = false;
|
||||
|
||||
|
|
@ -1068,3 +1076,266 @@ LLUUID LLSettingsSky::GetDefaultCloudNoiseTextureId()
|
|||
{
|
||||
return DEFAULT_CLOUD_ID;
|
||||
}
|
||||
|
||||
F32 LLSettingsSky::getPlanetRadius() const
|
||||
{
|
||||
return mSettings[SETTING_PLANET_RADIUS].asReal();
|
||||
}
|
||||
|
||||
F32 LLSettingsSky::getSkyBottomRadius() const
|
||||
{
|
||||
return mSettings[SETTING_SKY_BOTTOM_RADIUS].asReal();
|
||||
}
|
||||
|
||||
F32 LLSettingsSky::getSkyTopRadius() const
|
||||
{
|
||||
return mSettings[SETTING_SKY_TOP_RADIUS].asReal();
|
||||
}
|
||||
|
||||
F32 LLSettingsSky::getSunArcRadians() const
|
||||
{
|
||||
return mSettings[SETTING_SUN_ARC_RADIANS].asReal();
|
||||
}
|
||||
|
||||
F32 LLSettingsSky::getMieAnisotropy() const
|
||||
{
|
||||
return mSettings[SETTING_MIE_ANISOTROPY_FACTOR].asReal();
|
||||
}
|
||||
|
||||
LLSD LLSettingsSky::getRayleighConfigs() const
|
||||
{
|
||||
return mSettings[SETTING_RAYLEIGH_CONFIG];
|
||||
}
|
||||
|
||||
LLSD LLSettingsSky::getMieConfigs() const
|
||||
{
|
||||
return mSettings[SETTING_MIE_CONFIG];
|
||||
}
|
||||
|
||||
LLSD LLSettingsSky::getAbsorptionConfigs() const
|
||||
{
|
||||
return mSettings[SETTING_ABSORPTION_CONFIG];
|
||||
}
|
||||
|
||||
LLUUID LLSettingsSky::getBloomTextureId() const
|
||||
{
|
||||
return mSettings[SETTING_BLOOM_TEXTUREID].asUUID();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------
|
||||
LLColor3 LLSettingsSky::getAmbientColor() const
|
||||
{
|
||||
return LLColor3(mSettings[SETTING_AMBIENT]);
|
||||
}
|
||||
|
||||
void LLSettingsSky::setAmbientColor(const LLColor3 &val)
|
||||
{
|
||||
setValue(SETTING_AMBIENT, val);
|
||||
mLightingDirty = true;
|
||||
}
|
||||
|
||||
LLColor3 LLSettingsSky::getCloudColor() const
|
||||
{
|
||||
return LLColor3(mSettings[SETTING_CLOUD_COLOR]);
|
||||
}
|
||||
|
||||
void LLSettingsSky::setCloudColor(const LLColor3 &val)
|
||||
{
|
||||
setValue(SETTING_CLOUD_COLOR, val);
|
||||
}
|
||||
|
||||
LLUUID LLSettingsSky::getCloudNoiseTextureId() const
|
||||
{
|
||||
return mSettings[SETTING_CLOUD_TEXTUREID].asUUID();
|
||||
}
|
||||
|
||||
void LLSettingsSky::setCloudNoiseTextureId(const LLUUID &id)
|
||||
{
|
||||
setValue(SETTING_CLOUD_TEXTUREID, id);
|
||||
}
|
||||
|
||||
LLColor3 LLSettingsSky::getCloudPosDensity1() const
|
||||
{
|
||||
return LLColor3(mSettings[SETTING_CLOUD_POS_DENSITY1]);
|
||||
}
|
||||
|
||||
void LLSettingsSky::setCloudPosDensity1(const LLColor3 &val)
|
||||
{
|
||||
setValue(SETTING_CLOUD_POS_DENSITY1, val);
|
||||
}
|
||||
|
||||
LLColor3 LLSettingsSky::getCloudPosDensity2() const
|
||||
{
|
||||
return LLColor3(mSettings[SETTING_CLOUD_POS_DENSITY2]);
|
||||
}
|
||||
|
||||
void LLSettingsSky::setCloudPosDensity2(const LLColor3 &val)
|
||||
{
|
||||
setValue(SETTING_CLOUD_POS_DENSITY2, val);
|
||||
}
|
||||
|
||||
F32 LLSettingsSky::getCloudScale() const
|
||||
{
|
||||
return mSettings[SETTING_CLOUD_SCALE].asReal();
|
||||
}
|
||||
|
||||
void LLSettingsSky::setCloudScale(F32 val)
|
||||
{
|
||||
setValue(SETTING_CLOUD_SCALE, val);
|
||||
}
|
||||
|
||||
LLVector2 LLSettingsSky::getCloudScrollRate() const
|
||||
{
|
||||
return LLVector2(mSettings[SETTING_CLOUD_SCROLL_RATE]);
|
||||
}
|
||||
|
||||
void LLSettingsSky::setCloudScrollRate(const LLVector2 &val)
|
||||
{
|
||||
setValue(SETTING_CLOUD_SCROLL_RATE, val);
|
||||
}
|
||||
|
||||
void LLSettingsSky::setCloudScrollRateX(F32 val)
|
||||
{
|
||||
mSettings[SETTING_CLOUD_SCROLL_RATE][0] = val;
|
||||
setDirtyFlag(true);
|
||||
}
|
||||
|
||||
void LLSettingsSky::setCloudScrollRateY(F32 val)
|
||||
{
|
||||
mSettings[SETTING_CLOUD_SCROLL_RATE][1] = val;
|
||||
setDirtyFlag(true);
|
||||
}
|
||||
|
||||
F32 LLSettingsSky::getCloudShadow() const
|
||||
{
|
||||
return mSettings[SETTING_CLOUD_SHADOW].asReal();
|
||||
}
|
||||
|
||||
void LLSettingsSky::setCloudShadow(F32 val)
|
||||
{
|
||||
setValue(SETTING_CLOUD_SHADOW, val);
|
||||
mLightingDirty = true;
|
||||
}
|
||||
|
||||
F32 LLSettingsSky::getDomeOffset() const
|
||||
{
|
||||
//return mSettings[SETTING_DOME_OFFSET].asReal();
|
||||
return DOME_OFFSET;
|
||||
}
|
||||
|
||||
F32 LLSettingsSky::getDomeRadius() const
|
||||
{
|
||||
//return mSettings[SETTING_DOME_RADIUS].asReal();
|
||||
return DOME_RADIUS;
|
||||
}
|
||||
|
||||
F32 LLSettingsSky::getGamma() const
|
||||
{
|
||||
return mSettings[SETTING_GAMMA].asReal();
|
||||
}
|
||||
|
||||
void LLSettingsSky::setGamma(F32 val)
|
||||
{
|
||||
mSettings[SETTING_GAMMA] = LLSD::Real(val);
|
||||
setDirtyFlag(true);
|
||||
mLightingDirty = true;
|
||||
}
|
||||
|
||||
LLColor3 LLSettingsSky::getGlow() const
|
||||
{
|
||||
return LLColor3(mSettings[SETTING_GLOW]);
|
||||
}
|
||||
|
||||
void LLSettingsSky::setGlow(const LLColor3 &val)
|
||||
{
|
||||
setValue(SETTING_GLOW, val);
|
||||
mLightingDirty = true;
|
||||
}
|
||||
|
||||
F32 LLSettingsSky::getMaxY() const
|
||||
{
|
||||
return mSettings[SETTING_MAX_Y].asReal();
|
||||
}
|
||||
|
||||
void LLSettingsSky::setMaxY(F32 val)
|
||||
{
|
||||
setValue(SETTING_MAX_Y, val);
|
||||
}
|
||||
|
||||
LLQuaternion LLSettingsSky::getMoonRotation() const
|
||||
{
|
||||
return LLQuaternion(mSettings[SETTING_MOON_ROTATION]);
|
||||
}
|
||||
|
||||
void LLSettingsSky::setMoonRotation(const LLQuaternion &val)
|
||||
{
|
||||
setValue(SETTING_MOON_ROTATION, val);
|
||||
mPositionsDirty = true;
|
||||
}
|
||||
|
||||
LLUUID LLSettingsSky::getMoonTextureId() const
|
||||
{
|
||||
return mSettings[SETTING_MOON_TEXTUREID].asUUID();
|
||||
}
|
||||
|
||||
void LLSettingsSky::setMoonTextureId(LLUUID id)
|
||||
{
|
||||
setValue(SETTING_MOON_TEXTUREID, id);
|
||||
}
|
||||
|
||||
F32 LLSettingsSky::getStarBrightness() const
|
||||
{
|
||||
return mSettings[SETTING_STAR_BRIGHTNESS].asReal();
|
||||
}
|
||||
|
||||
void LLSettingsSky::setStarBrightness(F32 val)
|
||||
{
|
||||
setValue(SETTING_STAR_BRIGHTNESS, val);
|
||||
}
|
||||
|
||||
LLColor3 LLSettingsSky::getSunlightColor() const
|
||||
{
|
||||
return LLColor3(mSettings[SETTING_SUNLIGHT_COLOR]);
|
||||
}
|
||||
|
||||
void LLSettingsSky::setSunlightColor(const LLColor3 &val)
|
||||
{
|
||||
setValue(SETTING_SUNLIGHT_COLOR, val);
|
||||
mLightingDirty = true;
|
||||
}
|
||||
|
||||
LLQuaternion LLSettingsSky::getSunRotation() const
|
||||
{
|
||||
return LLQuaternion(mSettings[SETTING_SUN_ROTATION]);
|
||||
}
|
||||
|
||||
void LLSettingsSky::setSunRotation(const LLQuaternion &val)
|
||||
{
|
||||
setValue(SETTING_SUN_ROTATION, val);
|
||||
mPositionsDirty = true;
|
||||
}
|
||||
|
||||
LLUUID LLSettingsSky::getSunTextureId() const
|
||||
{
|
||||
return mSettings[SETTING_SUN_TEXTUREID].asUUID();
|
||||
}
|
||||
|
||||
void LLSettingsSky::setSunTextureId(LLUUID id)
|
||||
{
|
||||
setValue(SETTING_SUN_TEXTUREID, id);
|
||||
}
|
||||
|
||||
LLUUID LLSettingsSky::getNextSunTextureId() const
|
||||
{
|
||||
return mNextSunTextureId;
|
||||
}
|
||||
|
||||
LLUUID LLSettingsSky::getNextMoonTextureId() const
|
||||
{
|
||||
return mNextMoonTextureId;
|
||||
}
|
||||
|
||||
LLUUID LLSettingsSky::getNextCloudNoiseTextureId() const
|
||||
{
|
||||
return mNextCloudTextureId;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -105,267 +105,85 @@ public:
|
|||
|
||||
static LLSD defaults();
|
||||
|
||||
F32 getPlanetRadius() const
|
||||
{
|
||||
return mSettings[SETTING_PLANET_RADIUS].asReal();
|
||||
}
|
||||
F32 getPlanetRadius() const;
|
||||
F32 getSkyBottomRadius() const;
|
||||
F32 getSkyTopRadius() const;
|
||||
F32 getSunArcRadians() const;
|
||||
F32 getMieAnisotropy() const;
|
||||
LLSD getRayleighConfigs() const;
|
||||
LLSD getMieConfigs() const;
|
||||
|
||||
F32 getSkyBottomRadius() const
|
||||
{
|
||||
return mSettings[SETTING_SKY_BOTTOM_RADIUS].asReal();
|
||||
}
|
||||
|
||||
F32 getSkyTopRadius() const
|
||||
{
|
||||
return mSettings[SETTING_SKY_TOP_RADIUS].asReal();
|
||||
}
|
||||
|
||||
F32 getSunArcRadians() const
|
||||
{
|
||||
return mSettings[SETTING_SUN_ARC_RADIANS].asReal();
|
||||
}
|
||||
|
||||
F32 getMieAnisotropy() const
|
||||
{
|
||||
return mSettings[SETTING_MIE_ANISOTROPY_FACTOR].asReal();
|
||||
}
|
||||
|
||||
LLSD getRayleighConfigs() const
|
||||
{
|
||||
return mSettings[SETTING_RAYLEIGH_CONFIG];
|
||||
}
|
||||
|
||||
LLSD getMieConfigs() const
|
||||
{
|
||||
return mSettings[SETTING_MIE_CONFIG];
|
||||
}
|
||||
|
||||
LLSD getAbsorptionConfigs() const
|
||||
{
|
||||
return mSettings[SETTING_ABSORPTION_CONFIG];
|
||||
}
|
||||
|
||||
LLUUID getBloomTextureId() const
|
||||
{
|
||||
return mSettings[SETTING_BLOOM_TEXTUREID].asUUID();
|
||||
}
|
||||
LLSD getAbsorptionConfigs() const;
|
||||
LLUUID getBloomTextureId() const;
|
||||
|
||||
//---------------------------------------------------------------------
|
||||
LLColor3 getAmbientColor() const
|
||||
{
|
||||
return LLColor3(mSettings[SETTING_AMBIENT]);
|
||||
}
|
||||
LLColor3 getAmbientColor() const;
|
||||
void setAmbientColor(const LLColor3 &val);
|
||||
|
||||
void setAmbientColor(const LLColor3 &val)
|
||||
{
|
||||
setValue(SETTING_AMBIENT, val);
|
||||
}
|
||||
LLColor3 getCloudColor() const;
|
||||
void setCloudColor(const LLColor3 &val);
|
||||
|
||||
LLColor3 getCloudColor() const
|
||||
{
|
||||
return LLColor3(mSettings[SETTING_CLOUD_COLOR]);
|
||||
}
|
||||
LLUUID getCloudNoiseTextureId() const;
|
||||
void setCloudNoiseTextureId(const LLUUID &id);
|
||||
|
||||
void setCloudColor(const LLColor3 &val)
|
||||
{
|
||||
setValue(SETTING_CLOUD_COLOR, val);
|
||||
}
|
||||
LLColor3 getCloudPosDensity1() const;
|
||||
void setCloudPosDensity1(const LLColor3 &val);
|
||||
|
||||
LLUUID getCloudNoiseTextureId() const
|
||||
{
|
||||
return mSettings[SETTING_CLOUD_TEXTUREID].asUUID();
|
||||
}
|
||||
LLColor3 getCloudPosDensity2() const;
|
||||
void setCloudPosDensity2(const LLColor3 &val);
|
||||
|
||||
void setCloudNoiseTextureId(const LLUUID &id)
|
||||
{
|
||||
setValue(SETTING_CLOUD_TEXTUREID, id);
|
||||
}
|
||||
F32 getCloudScale() const;
|
||||
void setCloudScale(F32 val);
|
||||
|
||||
LLColor3 getCloudPosDensity1() const
|
||||
{
|
||||
return LLColor3(mSettings[SETTING_CLOUD_POS_DENSITY1]);
|
||||
}
|
||||
LLVector2 getCloudScrollRate() const;
|
||||
void setCloudScrollRate(const LLVector2 &val);
|
||||
|
||||
void setCloudPosDensity1(const LLColor3 &val)
|
||||
{
|
||||
setValue(SETTING_CLOUD_POS_DENSITY1, val);
|
||||
}
|
||||
|
||||
LLColor3 getCloudPosDensity2() const
|
||||
{
|
||||
return LLColor3(mSettings[SETTING_CLOUD_POS_DENSITY2]);
|
||||
}
|
||||
|
||||
void setCloudPosDensity2(const LLColor3 &val)
|
||||
{
|
||||
setValue(SETTING_CLOUD_POS_DENSITY2, val);
|
||||
}
|
||||
|
||||
F32 getCloudScale() const
|
||||
{
|
||||
return mSettings[SETTING_CLOUD_SCALE].asReal();
|
||||
}
|
||||
|
||||
void setCloudScale(F32 val)
|
||||
{
|
||||
setValue(SETTING_CLOUD_SCALE, val);
|
||||
}
|
||||
|
||||
LLVector2 getCloudScrollRate() const
|
||||
{
|
||||
return LLVector2(mSettings[SETTING_CLOUD_SCROLL_RATE]);
|
||||
}
|
||||
|
||||
void setCloudScrollRate(const LLVector2 &val)
|
||||
{
|
||||
setValue(SETTING_CLOUD_SCROLL_RATE, val);
|
||||
}
|
||||
|
||||
void setCloudScrollRateX(F32 val)
|
||||
{
|
||||
mSettings[SETTING_CLOUD_SCROLL_RATE][0] = val;
|
||||
setDirtyFlag(true);
|
||||
}
|
||||
|
||||
void setCloudScrollRateY(F32 val)
|
||||
{
|
||||
mSettings[SETTING_CLOUD_SCROLL_RATE][1] = val;
|
||||
setDirtyFlag(true);
|
||||
}
|
||||
|
||||
F32 getCloudShadow() const
|
||||
{
|
||||
return mSettings[SETTING_CLOUD_SHADOW].asReal();
|
||||
}
|
||||
|
||||
void setCloudShadow(F32 val)
|
||||
{
|
||||
setValue(SETTING_CLOUD_SHADOW, val);
|
||||
}
|
||||
void setCloudScrollRateX(F32 val);
|
||||
void setCloudScrollRateY(F32 val);
|
||||
|
||||
F32 getCloudShadow() const;
|
||||
void setCloudShadow(F32 val);
|
||||
|
||||
F32 getDomeOffset() const
|
||||
{
|
||||
return DOME_OFFSET;
|
||||
//return mSettings[SETTING_DOME_OFFSET].asReal();
|
||||
}
|
||||
F32 getDomeOffset() const;
|
||||
F32 getDomeRadius() const;
|
||||
|
||||
F32 getDomeRadius() const
|
||||
{
|
||||
return DOME_RADIUS;
|
||||
//return mSettings[SETTING_DOME_RADIUS].asReal();
|
||||
}
|
||||
F32 getGamma() const;
|
||||
|
||||
F32 getGamma() const
|
||||
{
|
||||
return mSettings[SETTING_GAMMA].asReal();
|
||||
}
|
||||
void setGamma(F32 val);
|
||||
|
||||
void setGamma(F32 val)
|
||||
{
|
||||
mSettings[SETTING_GAMMA] = LLSD::Real(val);
|
||||
setDirtyFlag(true);
|
||||
}
|
||||
LLColor3 getGlow() const;
|
||||
void setGlow(const LLColor3 &val);
|
||||
|
||||
LLColor3 getGlow() const
|
||||
{
|
||||
return LLColor3(mSettings[SETTING_GLOW]);
|
||||
}
|
||||
F32 getMaxY() const;
|
||||
|
||||
void setGlow(const LLColor3 &val)
|
||||
{
|
||||
setValue(SETTING_GLOW, val);
|
||||
}
|
||||
void setMaxY(F32 val);
|
||||
|
||||
F32 getMaxY() const
|
||||
{
|
||||
return mSettings[SETTING_MAX_Y].asReal();
|
||||
}
|
||||
LLQuaternion getMoonRotation() const;
|
||||
void setMoonRotation(const LLQuaternion &val);
|
||||
|
||||
void setMaxY(F32 val)
|
||||
{
|
||||
setValue(SETTING_MAX_Y, val);
|
||||
}
|
||||
LLUUID getMoonTextureId() const;
|
||||
void setMoonTextureId(LLUUID id);
|
||||
|
||||
LLQuaternion getMoonRotation() const
|
||||
{
|
||||
return LLQuaternion(mSettings[SETTING_MOON_ROTATION]);
|
||||
}
|
||||
F32 getStarBrightness() const;
|
||||
void setStarBrightness(F32 val);
|
||||
|
||||
void setMoonRotation(const LLQuaternion &val)
|
||||
{
|
||||
setValue(SETTING_MOON_ROTATION, val);
|
||||
}
|
||||
LLColor3 getSunlightColor() const;
|
||||
void setSunlightColor(const LLColor3 &val);
|
||||
|
||||
LLUUID getMoonTextureId() const
|
||||
{
|
||||
return mSettings[SETTING_MOON_TEXTUREID].asUUID();
|
||||
}
|
||||
LLQuaternion getSunRotation() const;
|
||||
void setSunRotation(const LLQuaternion &val) ;
|
||||
|
||||
void setMoonTextureId(LLUUID id)
|
||||
{
|
||||
setValue(SETTING_MOON_TEXTUREID, id);
|
||||
}
|
||||
|
||||
F32 getStarBrightness() const
|
||||
{
|
||||
return mSettings[SETTING_STAR_BRIGHTNESS].asReal();
|
||||
}
|
||||
|
||||
void setStarBrightness(F32 val)
|
||||
{
|
||||
setValue(SETTING_STAR_BRIGHTNESS, val);
|
||||
}
|
||||
|
||||
LLColor3 getSunlightColor() const
|
||||
{
|
||||
return LLColor3(mSettings[SETTING_SUNLIGHT_COLOR]);
|
||||
}
|
||||
|
||||
void setSunlightColor(const LLColor3 &val)
|
||||
{
|
||||
setValue(SETTING_SUNLIGHT_COLOR, val);
|
||||
}
|
||||
|
||||
LLQuaternion getSunRotation() const
|
||||
{
|
||||
return LLQuaternion(mSettings[SETTING_SUN_ROTATION]);
|
||||
}
|
||||
|
||||
void setSunRotation(const LLQuaternion &val)
|
||||
{
|
||||
setValue(SETTING_SUN_ROTATION, val);
|
||||
}
|
||||
|
||||
LLUUID getSunTextureId() const
|
||||
{
|
||||
return mSettings[SETTING_SUN_TEXTUREID].asUUID();
|
||||
}
|
||||
|
||||
void setSunTextureId(LLUUID id)
|
||||
{
|
||||
setValue(SETTING_SUN_TEXTUREID, id);
|
||||
}
|
||||
LLUUID getSunTextureId() const;
|
||||
void setSunTextureId(LLUUID id);
|
||||
|
||||
//=====================================================================
|
||||
// transient properties used in animations.
|
||||
LLUUID getNextSunTextureId() const
|
||||
{
|
||||
return mNextSunTextureId;
|
||||
}
|
||||
|
||||
LLUUID getNextMoonTextureId() const
|
||||
{
|
||||
return mNextMoonTextureId;
|
||||
}
|
||||
|
||||
LLUUID getNextCloudNoiseTextureId() const
|
||||
{
|
||||
return mNextCloudTextureId;
|
||||
}
|
||||
LLUUID getNextSunTextureId() const;
|
||||
LLUUID getNextMoonTextureId() const;
|
||||
LLUUID getNextCloudNoiseTextureId() const;
|
||||
|
||||
//=====================================================================
|
||||
virtual void loadTextures() { };
|
||||
virtual void loadTextures() { };
|
||||
|
||||
//=====================================================================
|
||||
virtual validation_list_t getValidationList() const SETTINGS_OVERRIDE;
|
||||
|
|
@ -380,7 +198,6 @@ public:
|
|||
LLColor3 getLightTransmittance() const;
|
||||
LLColor3 gammaCorrect(const LLColor3& in) const;
|
||||
|
||||
|
||||
LLColor3 getBlueDensity() const;
|
||||
LLColor3 getBlueHorizon() const;
|
||||
F32 getHazeDensity() const;
|
||||
|
|
|
|||
|
|
@ -1212,6 +1212,7 @@ void LLShaderMgr::initAttribsAndUniforms()
|
|||
mReservedUniforms.push_back("spot_shadow_bias");
|
||||
mReservedUniforms.push_back("spot_shadow_offset");
|
||||
mReservedUniforms.push_back("sun_dir");
|
||||
mReservedUniforms.push_back("moon_dir");
|
||||
mReservedUniforms.push_back("shadow_res");
|
||||
mReservedUniforms.push_back("proj_shadow_res");
|
||||
mReservedUniforms.push_back("depth_cutoff");
|
||||
|
|
|
|||
|
|
@ -134,6 +134,7 @@ public:
|
|||
DEFERRED_SPOT_SHADOW_BIAS,
|
||||
DEFERRED_SPOT_SHADOW_OFFSET,
|
||||
DEFERRED_SUN_DIR,
|
||||
DEFERRED_MOON_DIR,
|
||||
DEFERRED_SHADOW_RES,
|
||||
DEFERRED_PROJ_SHADOW_RES,
|
||||
DEFERRED_DEPTH_CUTOFF,
|
||||
|
|
|
|||
|
|
@ -43,6 +43,7 @@ uniform mat3 env_mat;
|
|||
uniform mat3 ssao_effect_mat;
|
||||
|
||||
uniform vec3 sun_dir;
|
||||
uniform vec3 moon_dir;
|
||||
|
||||
#if HAS_SHADOW
|
||||
uniform sampler2DShadow shadowMap0;
|
||||
|
|
@ -287,7 +288,10 @@ void main()
|
|||
vec2 abnormal = encode_normal(norm.xyz);
|
||||
norm.xyz = decode_normal(abnormal.xy);
|
||||
|
||||
float da = dot(norm.xyz, sun_dir.xyz);
|
||||
float da_sun = dot(norm.xyz, sun_dir.xyz);
|
||||
float da_moon = dot(norm.xyz, moon_dir.xyz);
|
||||
|
||||
float da = max(da_sun, da_moon);
|
||||
|
||||
float final_da = da;
|
||||
final_da = min(final_da, shadow);
|
||||
|
|
|
|||
|
|
@ -98,6 +98,7 @@ uniform mat3 env_mat;
|
|||
uniform mat3 ssao_effect_mat;
|
||||
|
||||
uniform vec3 sun_dir;
|
||||
uniform vec3 moon_dir;
|
||||
VARYING vec2 vary_fragcoord;
|
||||
|
||||
VARYING vec3 vary_position;
|
||||
|
|
@ -388,7 +389,9 @@ void main()
|
|||
|
||||
vec3 refnormpersp = normalize(reflect(pos.xyz, norm.xyz));
|
||||
|
||||
float da =dot(norm.xyz, sun_dir.xyz);
|
||||
float da_sun =dot(norm.xyz, sun_dir.xyz);
|
||||
float da_moon =dot(norm.xyz, moon_dir.xyz);
|
||||
float da = max(da_sun, da_moon);
|
||||
|
||||
float final_da = da;
|
||||
final_da = min(final_da, shadow);
|
||||
|
|
@ -418,7 +421,10 @@ void main()
|
|||
// the old infinite-sky shiny reflection
|
||||
//
|
||||
|
||||
float sa = dot(refnormpersp, sun_dir.xyz);
|
||||
float sa_sun = dot(refnormpersp, sun_dir.xyz);
|
||||
float sa_moon = dot(refnormpersp, moon_dir.xyz);
|
||||
float sa = max(sa_sun, sa_moon);
|
||||
|
||||
vec3 dumbshiny = sunlit*shadow*(texture2D(lightFunc, vec2(sa, spec.a)).r);
|
||||
|
||||
// add the two types of shiny together
|
||||
|
|
|
|||
|
|
@ -56,6 +56,7 @@ uniform mat3 env_mat;
|
|||
uniform mat3 ssao_effect_mat;
|
||||
|
||||
uniform vec3 sun_dir;
|
||||
uniform vec3 moon_dir;
|
||||
VARYING vec2 vary_fragcoord;
|
||||
|
||||
uniform mat4 inv_proj;
|
||||
|
|
@ -106,7 +107,9 @@ void main()
|
|||
float envIntensity = norm.z;
|
||||
norm.xyz = decode_normal(norm.xy); // unpack norm
|
||||
|
||||
float da = dot(norm.xyz, sun_dir.xyz);
|
||||
float da_sun = dot(norm.xyz, sun_dir.xyz);
|
||||
float da_moon = dot(norm.xyz, moon_dir.xyz);
|
||||
float da = max(da_sun, da_moon);
|
||||
|
||||
float final_da = max(0.0,da);
|
||||
final_da = min(final_da, 1.0f);
|
||||
|
|
@ -148,7 +151,10 @@ void main()
|
|||
// the old infinite-sky shiny reflection
|
||||
//
|
||||
|
||||
float sa = dot(refnormpersp, sun_dir.xyz);
|
||||
float sa_sun = dot(refnormpersp, sun_dir.xyz);
|
||||
float sa_moon = dot(refnormpersp, moon_dir.xyz);
|
||||
float sa = max(sa_sun, sa_moon);
|
||||
|
||||
vec3 dumbshiny = sunlit*(texture2D(lightFunc, vec2(sa, spec.a)).r);
|
||||
|
||||
// add the two types of shiny together
|
||||
|
|
|
|||
|
|
@ -25,7 +25,6 @@
|
|||
|
||||
|
||||
|
||||
uniform vec4 lightnorm;
|
||||
uniform vec4 waterPlane;
|
||||
uniform vec4 waterFogColor;
|
||||
uniform float waterFogDensity;
|
||||
|
|
|
|||
|
|
@ -49,7 +49,6 @@ uniform vec4 morphFactor;
|
|||
uniform vec3 camPosLocal;
|
||||
//uniform vec4 camPosWorld;
|
||||
uniform vec4 gamma;
|
||||
uniform vec4 lightnorm;
|
||||
uniform vec4 sunlight_color;
|
||||
uniform vec4 ambient;
|
||||
uniform vec4 blue_horizon;
|
||||
|
|
@ -68,6 +67,7 @@ uniform vec4 shadow_clip;
|
|||
uniform mat3 ssao_effect_mat;
|
||||
|
||||
uniform vec3 sun_dir;
|
||||
uniform vec3 moon_dir;
|
||||
VARYING vec2 vary_fragcoord;
|
||||
|
||||
uniform mat4 inv_proj;
|
||||
|
|
@ -117,7 +117,9 @@ void main()
|
|||
float envIntensity = norm.z;
|
||||
norm.xyz = decode_normal(norm.xy); // unpack norm
|
||||
|
||||
float da = max(dot(norm.xyz, sun_dir.xyz), 0.0);
|
||||
float da_sun = max(dot(norm.xyz, sun_dir.xyz), 0.0);
|
||||
float da_moon = max(dot(norm.xyz, moon_dir.xyz), 0.0);
|
||||
float da = max(da_sun, da_moon);
|
||||
|
||||
float light_gamma = 1.0/1.3;
|
||||
da = pow(da, light_gamma);
|
||||
|
|
@ -168,7 +170,9 @@ void main()
|
|||
// the old infinite-sky shiny reflection
|
||||
//
|
||||
|
||||
float sa = dot(refnormpersp, sun_dir.xyz);
|
||||
float sa_sun = dot(refnormpersp, sun_dir.xyz);
|
||||
float sa_moon = dot(refnormpersp, moon_dir.xyz);
|
||||
float sa = max(sa_sun, sa_moon);
|
||||
vec3 dumbshiny = sunlit*scol_ambocc.r*(texture2D(lightFunc, vec2(sa, spec.a)).r);
|
||||
|
||||
// add the two types of shiny together
|
||||
|
|
|
|||
|
|
@ -59,6 +59,7 @@ uniform mat4 inv_proj;
|
|||
uniform vec2 screen_res;
|
||||
uniform vec2 proj_shadow_res;
|
||||
uniform vec3 sun_dir;
|
||||
uniform vec3 moon_dir;
|
||||
|
||||
uniform vec2 shadow_res;
|
||||
uniform float shadow_bias;
|
||||
|
|
@ -139,10 +140,14 @@ void main()
|
|||
}*/
|
||||
|
||||
float shadow = 0.0;
|
||||
float dp_directional_light = max(0.0, dot(norm, sun_dir.xyz));
|
||||
float da_sun = dot(norm, sun_dir.xyz);
|
||||
float da_moon = dot(norm, moon_dir.xyz);
|
||||
float da = max(da_sun, da_moon);
|
||||
|
||||
float dp_directional_light = max(0.0, da);
|
||||
|
||||
vec3 shadow_pos = pos.xyz;
|
||||
vec3 offset = sun_dir.xyz * (1.0-dp_directional_light);
|
||||
vec3 offset = ((da_sun > da_moon) ? sun_dir.xyz : moon_dir.xyz) * (1.0-dp_directional_light);
|
||||
|
||||
vec4 spos = vec4(shadow_pos+offset*shadow_offset, 1.0);
|
||||
|
||||
|
|
|
|||
|
|
@ -59,6 +59,7 @@ uniform mat4 inv_proj;
|
|||
uniform vec2 screen_res;
|
||||
uniform vec2 proj_shadow_res;
|
||||
uniform vec3 sun_dir;
|
||||
uniform vec3 moon_dir;
|
||||
|
||||
uniform vec2 shadow_res;
|
||||
|
||||
|
|
@ -200,10 +201,13 @@ void main()
|
|||
}*/
|
||||
|
||||
float shadow = 0.0;
|
||||
float dp_directional_light = max(0.0, dot(norm, sun_dir.xyz));
|
||||
float da_sun = dot(norm, sun_dir.xyz);
|
||||
float da_moon = dot(norm, moon_dir.xyz);
|
||||
float da = max(da_sun, da_moon);
|
||||
float dp_directional_light = max(0.0, da);
|
||||
|
||||
vec3 shadow_pos = pos.xyz;
|
||||
vec3 offset = sun_dir.xyz * (1.0-dp_directional_light);
|
||||
vec3 offset = ((da_sun > da_moon) ? sun_dir.xyz : moon_dir.xyz) * (1.0-dp_directional_light);
|
||||
|
||||
vec4 spos = vec4(shadow_pos+offset*shadow_offset, 1.0);
|
||||
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@ in vec3 view_dir;
|
|||
|
||||
uniform vec3 cameraPosLocal;
|
||||
uniform vec3 sun_dir;
|
||||
uniform vec3 moon_dir;
|
||||
uniform float sun_size;
|
||||
|
||||
uniform sampler2D transmittance_texture;
|
||||
|
|
@ -42,9 +43,9 @@ uniform sampler3D single_mie_scattering_texture;
|
|||
uniform sampler2D irradiance_texture;
|
||||
|
||||
vec3 GetSolarLuminance();
|
||||
vec3 GetSkyLuminance(vec3 camPos, vec3 view_dir, float shadow_length, vec3 sun_dir, out vec3 transmittance);
|
||||
vec3 GetSkyLuminanceToPoint(vec3 camPos, vec3 pos, float shadow_length, vec3 sun_dir, out vec3 transmittance);
|
||||
vec3 GetSunAndSkyIlluminance(vec3 pos, vec3 norm, vec3 sun_dir, out vec3 sky_irradiance);
|
||||
vec3 GetSkyLuminance(vec3 camPos, vec3 view_dir, float shadow_length, vec3 dir, out vec3 transmittance);
|
||||
vec3 GetSkyLuminanceToPoint(vec3 camPos, vec3 pos, float shadow_length, vec3 dir, out vec3 transmittance);
|
||||
vec3 GetSunAndSkyIlluminance(vec3 pos, vec3 norm, vec3 dir, out vec3 sky_irradiance);
|
||||
|
||||
void main()
|
||||
{
|
||||
|
|
@ -55,8 +56,9 @@ void main()
|
|||
vec3 camPos = cameraPosLocal + vec3(0, 0, 6360.0f);
|
||||
vec3 transmittance;
|
||||
vec3 sky_illum;
|
||||
vec3 radiance = GetSkyLuminance(camPos, view_direction, 0.0f, sun_direction, transmittance);
|
||||
vec3 radiance2 = GetSunAndSkyIlluminance(camPos, view_direction, sun_direction, sky_illum);
|
||||
|
||||
vec3 radiance_sun = GetSkyLuminance(camPos, view_direction, 0.0f, sun_direction, transmittance);
|
||||
vec3 radiance2_sun = GetSunAndSkyIlluminance(camPos, view_direction, sun_direction, sky_illum);
|
||||
|
||||
radiance *= transmittance;
|
||||
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@ in vec3 view_dir;
|
|||
|
||||
uniform vec3 cameraPosLocal;
|
||||
uniform vec3 sun_dir;
|
||||
uniform vec3 moon_dir;
|
||||
uniform float sun_size;
|
||||
|
||||
uniform sampler2D transmittance_texture;
|
||||
|
|
|
|||
|
|
@ -151,11 +151,13 @@ void LLDrawPoolWLSky::renderSkyHazeDeferred(const LLVector3& camPosLocal, F32 ca
|
|||
sky_shader->bindTexture(LLShaderMgr::ILLUMINANCE_TEX, gAtmosphere->getIlluminance());
|
||||
|
||||
LLSettingsSky::ptr_t psky = LLEnvironment::instance().getCurrentSky();
|
||||
LLVector4 light_dir = LLEnvironment::instance().getClampedLightNorm();
|
||||
LLVector4 sun_dir = LLEnvironment::instance().getClampedSunNorm();
|
||||
LLVector4 moon_dir = LLEnvironment::instance().getClampedMoonNorm();
|
||||
|
||||
F32 sunSize = (float)cosf(psky->getSunArcRadians());
|
||||
sky_shader->uniform1f(LLShaderMgr::SUN_SIZE, sunSize);
|
||||
sky_shader->uniform3fv(LLShaderMgr::DEFERRED_SUN_DIR, 1, light_dir.mV);
|
||||
sky_shader->uniform3fv(LLShaderMgr::DEFERRED_SUN_DIR, 1, sun_dir.mV);
|
||||
sky_shader->uniform3fv(LLShaderMgr::DEFERRED_MOON_DIR, 1, moon_dir.mV);
|
||||
|
||||
// clouds are rendered along with sky in adv atmo
|
||||
if (gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_CLOUDS) && gSky.mVOSkyp->getCloudNoiseTex())
|
||||
|
|
|
|||
|
|
@ -700,16 +700,6 @@ void LLEnvironment::updateEnvironment(LLSettingsBase::Seconds transition, bool f
|
|||
}
|
||||
}
|
||||
|
||||
LLVector3 LLEnvironment::getLightDirection() const
|
||||
{
|
||||
LLSettingsSky::ptr_t psky = mCurrentEnvironment->getSky();
|
||||
if (!psky)
|
||||
{
|
||||
return LLVector3(0, 0, 1);
|
||||
}
|
||||
return psky->getLightDirection();
|
||||
}
|
||||
|
||||
LLVector4 LLEnvironment::toCFR(const LLVector3 vec) const
|
||||
{
|
||||
LLVector4 vec_cfr(vec.mV[1], vec.mV[0], vec.mV[2], 0.0f);
|
||||
|
|
@ -722,6 +712,36 @@ LLVector4 LLEnvironment::toLightNorm(const LLVector3 vec) const
|
|||
return vec_ogl;
|
||||
}
|
||||
|
||||
LLVector3 LLEnvironment::getLightDirection() const
|
||||
{
|
||||
LLSettingsSky::ptr_t psky = mCurrentEnvironment->getSky();
|
||||
if (!psky)
|
||||
{
|
||||
return LLVector3(0, 0, 1);
|
||||
}
|
||||
return psky->getLightDirection();
|
||||
}
|
||||
|
||||
LLVector3 LLEnvironment::getSunDirection() const
|
||||
{
|
||||
LLSettingsSky::ptr_t psky = mCurrentEnvironment->getSky();
|
||||
if (!psky)
|
||||
{
|
||||
return LLVector3(0, 0, 1);
|
||||
}
|
||||
return psky->getSunDirection();
|
||||
}
|
||||
|
||||
LLVector3 LLEnvironment::getMoonDirection() const
|
||||
{
|
||||
LLSettingsSky::ptr_t psky = mCurrentEnvironment->getSky();
|
||||
if (!psky)
|
||||
{
|
||||
return LLVector3(0, 0, -1);
|
||||
}
|
||||
return psky->getMoonDirection();
|
||||
}
|
||||
|
||||
LLVector4 LLEnvironment::getLightDirectionCFR() const
|
||||
{
|
||||
LLVector3 light_direction = getLightDirection();
|
||||
|
|
@ -729,6 +749,20 @@ LLVector4 LLEnvironment::getLightDirectionCFR() const
|
|||
return light_direction_cfr;
|
||||
}
|
||||
|
||||
LLVector4 LLEnvironment::getSunDirectionCFR() const
|
||||
{
|
||||
LLVector3 light_direction = getSunDirection();
|
||||
LLVector4 light_direction_cfr = toCFR(light_direction);
|
||||
return light_direction_cfr;
|
||||
}
|
||||
|
||||
LLVector4 LLEnvironment::getMoonDirectionCFR() const
|
||||
{
|
||||
LLVector3 light_direction = getMoonDirection();
|
||||
LLVector4 light_direction_cfr = toCFR(light_direction);
|
||||
return light_direction_cfr;
|
||||
}
|
||||
|
||||
LLVector4 LLEnvironment::getClampedLightNorm() const
|
||||
{
|
||||
LLVector3 light_direction = getLightDirection();
|
||||
|
|
@ -739,6 +773,26 @@ LLVector4 LLEnvironment::getClampedLightNorm() const
|
|||
return toLightNorm(light_direction);
|
||||
}
|
||||
|
||||
LLVector4 LLEnvironment::getClampedSunNorm() const
|
||||
{
|
||||
LLVector3 light_direction = getSunDirection();
|
||||
if (light_direction.mV[2] < -0.1f)
|
||||
{
|
||||
light_direction.mV[2] = -0.1f;
|
||||
}
|
||||
return toLightNorm(light_direction);
|
||||
}
|
||||
|
||||
LLVector4 LLEnvironment::getClampedMoonNorm() const
|
||||
{
|
||||
LLVector3 light_direction = getMoonDirection();
|
||||
if (light_direction.mV[2] < -0.1f)
|
||||
{
|
||||
light_direction.mV[2] = -0.1f;
|
||||
}
|
||||
return toLightNorm(light_direction);
|
||||
}
|
||||
|
||||
LLVector4 LLEnvironment::getRotatedLightNorm() const
|
||||
{
|
||||
LLVector3 light_direction = getLightDirection();
|
||||
|
|
|
|||
|
|
@ -193,14 +193,20 @@ public:
|
|||
|
||||
// Returns either sun or moon direction (depending on which is up and stronger)
|
||||
// Light direction in +x right, +z up, +y at internal coord sys
|
||||
LLVector3 getLightDirection() const;
|
||||
LLVector3 getLightDirection() const; // returns sun or moon depending on which is up
|
||||
LLVector3 getSunDirection() const;
|
||||
LLVector3 getMoonDirection() const;
|
||||
|
||||
// Returns light direction converted to CFR coord system
|
||||
LLVector4 getLightDirectionCFR() const;
|
||||
LLVector4 getLightDirectionCFR() const; // returns sun or moon depending on which is up
|
||||
LLVector4 getSunDirectionCFR() const;
|
||||
LLVector4 getMoonDirectionCFR() const;
|
||||
|
||||
// Returns light direction converted to OGL coord system
|
||||
// and clamped above -0.1f in Y to avoid render artifacts in sky shaders
|
||||
LLVector4 getClampedLightNorm() const;
|
||||
LLVector4 getClampedLightNorm() const; // returns sun or moon depending on which is up
|
||||
LLVector4 getClampedSunNorm() const;
|
||||
LLVector4 getClampedMoonNorm() const;
|
||||
|
||||
// Returns light direction converted to OGL coord system
|
||||
// and rotated by last cam yaw needed by water rendering shaders
|
||||
|
|
|
|||
|
|
@ -410,7 +410,9 @@ void LLFloaterEditExtDayCycle::onTrackSelectionCallback(const LLSD& user_data)
|
|||
void LLFloaterEditExtDayCycle::onPlayActionCallback(const LLSD& user_data)
|
||||
{
|
||||
std::string action = user_data.asString();
|
||||
|
||||
F32 frame = mTimeSlider->getCurSliderValue();
|
||||
|
||||
if (action == ACTION_PLAY)
|
||||
{
|
||||
startPlay();
|
||||
|
|
@ -424,13 +426,13 @@ void LLFloaterEditExtDayCycle::onPlayActionCallback(const LLSD& user_data)
|
|||
F32 new_frame = 0;
|
||||
if (action == ACTION_FORWARD)
|
||||
{
|
||||
new_frame = mEditDay->getUpperBoundFrame(mCurrentTrack, frame);
|
||||
new_frame = mEditDay->getUpperBoundFrame(mCurrentTrack, frame + (mTimeSlider->getIncrement() / 2));
|
||||
}
|
||||
else if (action == ACTION_BACK)
|
||||
{
|
||||
new_frame = mEditDay->getLowerBoundFrame(mCurrentTrack, frame - (mTimeSlider->getIncrement() / 2));
|
||||
}
|
||||
selectFrame(new_frame);
|
||||
selectFrame(new_frame, 0.0f);
|
||||
stopPlay();
|
||||
}
|
||||
}
|
||||
|
|
@ -538,12 +540,12 @@ void LLFloaterEditExtDayCycle::onFrameSliderMouseUp(S32 x, S32 y, MASK mask)
|
|||
|
||||
LL_WARNS("LAPRAS") << " UP: X=" << x << " Y=" << y << " MASK=" << mask << " Position=" << sliderpos << LL_ENDL;
|
||||
mTimeSlider->setCurSliderValue(sliderpos);
|
||||
selectFrame(sliderpos);
|
||||
selectFrame(sliderpos, FRAME_SLOP_FACTOR);
|
||||
}
|
||||
|
||||
void LLFloaterEditExtDayCycle::onTimeSliderMoved()
|
||||
{
|
||||
selectFrame(mTimeSlider->getCurSliderValue());
|
||||
selectFrame(mTimeSlider->getCurSliderValue(), FRAME_SLOP_FACTOR);
|
||||
}
|
||||
|
||||
void LLFloaterEditExtDayCycle::selectTrack(U32 track_index, bool force )
|
||||
|
|
@ -566,16 +568,16 @@ void LLFloaterEditExtDayCycle::selectTrack(U32 track_index, bool force )
|
|||
updateSlider();
|
||||
}
|
||||
|
||||
void LLFloaterEditExtDayCycle::selectFrame(F32 frame)
|
||||
void LLFloaterEditExtDayCycle::selectFrame(F32 frame, F32 slop_factor)
|
||||
{
|
||||
mFramesSlider->resetCurSlider();
|
||||
|
||||
|
||||
keymap_t::iterator iter = mSliderKeyMap.begin();
|
||||
keymap_t::iterator end_iter = mSliderKeyMap.end();
|
||||
while (iter != end_iter)
|
||||
{
|
||||
if (fabs(iter->second.mFrame - frame) <= FRAME_SLOP_FACTOR)
|
||||
F32 keyframe = iter->second.mFrame;
|
||||
if (fabs(keyframe - frame) <= slop_factor)
|
||||
{
|
||||
mFramesSlider->setCurSlider(iter->first);
|
||||
frame = iter->second.mFrame;
|
||||
|
|
@ -587,6 +589,7 @@ void LLFloaterEditExtDayCycle::selectFrame(F32 frame)
|
|||
mTimeSlider->setCurSliderValue(frame);
|
||||
// block or update tabs according to new selection
|
||||
updateTabs();
|
||||
LLEnvironment::instance().updateEnvironment();
|
||||
}
|
||||
|
||||
void LLFloaterEditExtDayCycle::clearTabs()
|
||||
|
|
@ -685,11 +688,16 @@ void LLFloaterEditExtDayCycle::setSkyTabsEnabled(BOOL enable)
|
|||
|
||||
void LLFloaterEditExtDayCycle::updateButtons()
|
||||
{
|
||||
LLSettingsBase::Seconds frame(mTimeSlider->getCurSliderValue());
|
||||
LLSettingsBase::ptr_t settings = mEditDay->getSettingsAtKeyframe(frame, mCurrentTrack);
|
||||
bool can_add = static_cast<bool>(settings);
|
||||
mAddFrameButton->setEnabled(can_add);
|
||||
mDeleteFrameButton->setEnabled(!can_add);
|
||||
// This logic appears to work in reverse, the add frame button
|
||||
// is only enabled when you're on an existing frame and disabled
|
||||
// in all the interim positions where you'd want to add a frame...
|
||||
//LLSettingsBase::Seconds frame(mTimeSlider->getCurSliderValue());
|
||||
//LLSettingsBase::ptr_t settings = mEditDay->getSettingsAtKeyframe(frame, mCurrentTrack);
|
||||
//bool can_add = static_cast<bool>(settings);
|
||||
//mAddFrameButton->setEnabled(can_add);
|
||||
//mDeleteFrameButton->setEnabled(!can_add);
|
||||
mAddFrameButton->setEnabled(true);
|
||||
mDeleteFrameButton->setEnabled(true);
|
||||
}
|
||||
|
||||
void LLFloaterEditExtDayCycle::updateSlider()
|
||||
|
|
@ -717,7 +725,7 @@ void LLFloaterEditExtDayCycle::updateSlider()
|
|||
mLastFrameSlider.clear();
|
||||
}
|
||||
|
||||
selectFrame(frame_position);
|
||||
selectFrame(frame_position, FRAME_SLOP_FACTOR);
|
||||
}
|
||||
|
||||
void LLFloaterEditExtDayCycle::updateTimeAndLabel()
|
||||
|
|
@ -1101,7 +1109,7 @@ void LLFloaterEditExtDayCycle::stopPlay()
|
|||
gIdleCallbacks.deleteFunction(onIdlePlay, this);
|
||||
mPlayTimer.stop();
|
||||
F32 frame = mTimeSlider->getCurSliderValue();
|
||||
selectFrame(frame);
|
||||
selectFrame(frame, FRAME_SLOP_FACTOR);
|
||||
|
||||
getChild<LLView>("play_layout", true)->setVisible(TRUE);
|
||||
getChild<LLView>("pause_layout", true)->setVisible(FALSE);
|
||||
|
|
|
|||
|
|
@ -79,6 +79,8 @@ public:
|
|||
|
||||
private:
|
||||
|
||||
F32 getCurrentFrame() const;
|
||||
|
||||
// flyout response/click
|
||||
void onButtonApply(LLUICtrl *ctrl, const LLSD &data);
|
||||
void onBtnCancel();
|
||||
|
|
@ -98,7 +100,7 @@ private:
|
|||
void onFrameSliderMouseUp(S32 x, S32 y, MASK mask);
|
||||
|
||||
void selectTrack(U32 track_index, bool force = false);
|
||||
void selectFrame(F32 frame);
|
||||
void selectFrame(F32 frame, F32 slop_factor);
|
||||
void clearTabs();
|
||||
void updateTabs();
|
||||
void updateWaterTabs(const LLSettingsWaterPtr_t &p_water);
|
||||
|
|
|
|||
|
|
@ -267,7 +267,7 @@ void LLAtmospherics::calcSkyColorWLVert(LLVector3 & Pn, AtmosphericsVars& vars)
|
|||
F32 density_multiplier = psky->getDensityMultiplier();
|
||||
|
||||
F32 max_y = psky->getMaxY();
|
||||
LLVector3 lightnorm = LLVector3(LLEnvironment::instance().getClampedLightNorm());
|
||||
LLVector3 sun_norm = LLVector3(LLEnvironment::instance().getClampedSunNorm());
|
||||
|
||||
// project the direction ray onto the sky dome.
|
||||
F32 phi = acos(Pn[1]);
|
||||
|
|
@ -316,7 +316,7 @@ void LLAtmospherics::calcSkyColorWLVert(LLVector3 & Pn, AtmosphericsVars& vars)
|
|||
LLColor3 haze_weight = componentDiv(smear(haze_density), temp1);
|
||||
|
||||
// Compute sunlight from P & lightnorm (for long rays like sky)
|
||||
temp2.mV[1] = llmax(F_APPROXIMATELY_ZERO, llmax(0.f, Pn[1]) * 1.0f + lightnorm[1] );
|
||||
temp2.mV[1] = llmax(F_APPROXIMATELY_ZERO, llmax(0.f, Pn[1]) * 1.0f + sun_norm[1] );
|
||||
|
||||
temp2.mV[1] = 1.f / temp2.mV[1];
|
||||
componentMultBy(sunlight, componentExp((light_atten * -1.f) * temp2.mV[1]));
|
||||
|
|
@ -329,7 +329,7 @@ void LLAtmospherics::calcSkyColorWLVert(LLVector3 & Pn, AtmosphericsVars& vars)
|
|||
|
||||
|
||||
// Compute haze glow
|
||||
temp2.mV[0] = Pn * lightnorm;
|
||||
temp2.mV[0] = Pn * sun_norm;
|
||||
|
||||
temp2.mV[0] = 1.f - temp2.mV[0];
|
||||
// temp2.x is 0 at the sun and increases away from sun
|
||||
|
|
@ -360,7 +360,7 @@ void LLAtmospherics::calcSkyColorWLVert(LLVector3 & Pn, AtmosphericsVars& vars)
|
|||
componentMultBy(vars.hazeColor, LLColor3::white - temp1);
|
||||
|
||||
sunlight = psky->getSunlightColor();
|
||||
temp2.mV[1] = llmax(0.f, lightnorm[1] * 2.f);
|
||||
temp2.mV[1] = llmax(0.f, sun_norm[1] * 2.f);
|
||||
temp2.mV[1] = 1.f / temp2.mV[1];
|
||||
componentMultBy(sunlight, componentExp((light_atten * -1.f) * temp2.mV[1]));
|
||||
|
||||
|
|
|
|||
|
|
@ -374,19 +374,23 @@ void LLPanelSettingsSkySunMoonTab::onStarBrightnessChanged()
|
|||
void LLPanelSettingsSkySunMoonTab::onSunRotationChanged()
|
||||
{
|
||||
mSkySettings->setSunRotation(getChild<LLJoystickQuaternion>(FIELD_SKY_SUN_ROTATION)->getRotation());
|
||||
mSkySettings->update();
|
||||
}
|
||||
|
||||
void LLPanelSettingsSkySunMoonTab::onSunImageChanged()
|
||||
{
|
||||
mSkySettings->setSunTextureId(getChild<LLTextureCtrl>(FIELD_SKY_SUN_IMAGE)->getValue().asUUID());
|
||||
mSkySettings->update();
|
||||
}
|
||||
|
||||
void LLPanelSettingsSkySunMoonTab::onMoonRotationChanged()
|
||||
{
|
||||
mSkySettings->setMoonRotation(getChild<LLJoystickQuaternion>(FIELD_SKY_MOON_ROTATION)->getRotation());
|
||||
mSkySettings->update();
|
||||
}
|
||||
|
||||
void LLPanelSettingsSkySunMoonTab::onMoonImageChanged()
|
||||
{
|
||||
mSkySettings->setMoonTextureId(getChild<LLTextureCtrl>(FIELD_SKY_MOON_IMAGE)->getValue().asUUID());
|
||||
mSkySettings->update();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -529,7 +529,7 @@ void LLSettingsVOSky::applySpecial(void *ptarget)
|
|||
{
|
||||
LLGLSLShader *shader = (LLGLSLShader *)ptarget;
|
||||
|
||||
LLVector4 light_direction = LLEnvironment::instance().getClampedLightNorm();
|
||||
LLVector4 light_direction = LLEnvironment::instance().getClampedSunNorm();
|
||||
|
||||
if (shader->mShaderGroup == LLGLSLShader::SG_DEFAULT)
|
||||
{
|
||||
|
|
@ -538,7 +538,6 @@ void LLSettingsVOSky::applySpecial(void *ptarget)
|
|||
}
|
||||
else if (shader->mShaderGroup == LLGLSLShader::SG_SKY)
|
||||
{
|
||||
LLVector4 light_direction = LLEnvironment::instance().getClampedLightNorm();
|
||||
shader->uniform4fv(LLViewerShaderMgr::LIGHTNORM, 1, light_direction.mV);
|
||||
|
||||
LLVector4 vect_c_p_d1(mSettings[SETTING_CLOUD_POS_DENSITY1]);
|
||||
|
|
|
|||
|
|
@ -6258,8 +6258,11 @@ void LLPipeline::setupHWLights(LLDrawPool* pool)
|
|||
|
||||
// Light 0 = Sun or Moon (All objects)
|
||||
{
|
||||
LLVector4 light_dir = environment.getLightDirectionCFR();
|
||||
mSunDir.setVec(light_dir);
|
||||
LLVector4 sun_dir = environment.getSunDirectionCFR();
|
||||
LLVector4 moon_dir = environment.getMoonDirectionCFR();
|
||||
|
||||
mSunDir.setVec(sun_dir);
|
||||
mMoonDir.setVec(moon_dir);
|
||||
|
||||
if (environment.getIsSunUp())
|
||||
{
|
||||
|
|
@ -6282,7 +6285,14 @@ void LLPipeline::setupHWLights(LLDrawPool* pool)
|
|||
mHWLightColors[0] = light_diffuse;
|
||||
|
||||
LLLightState* light = gGL.getLight(0);
|
||||
light->setPosition(mSunDir);
|
||||
if (environment.getIsSunUp())
|
||||
{
|
||||
light->setPosition(mSunDir);
|
||||
}
|
||||
else
|
||||
{
|
||||
light->setPosition(mMoonDir);
|
||||
}
|
||||
light->setDiffuse(light_diffuse);
|
||||
light->setAmbient(LLColor4::black);
|
||||
light->setSpecular(LLColor4::black);
|
||||
|
|
@ -8377,6 +8387,7 @@ void LLPipeline::bindDeferredShader(LLGLSLShader& shader, U32 light_index, U32 n
|
|||
shader.uniform1f(LLShaderMgr::DEFERRED_SPOT_SHADOW_BIAS, RenderSpotShadowBias);
|
||||
|
||||
shader.uniform3fv(LLShaderMgr::DEFERRED_SUN_DIR, 1, mTransformedSunDir.mV);
|
||||
shader.uniform3fv(LLShaderMgr::DEFERRED_MOON_DIR, 1, mTransformedMoonDir.mV);
|
||||
shader.uniform2f(LLShaderMgr::DEFERRED_SHADOW_RES, mShadow[0].getWidth(), mShadow[0].getHeight());
|
||||
shader.uniform2f(LLShaderMgr::DEFERRED_PROJ_SHADOW_RES, mShadow[4].getWidth(), mShadow[4].getHeight());
|
||||
shader.uniform1f(LLShaderMgr::DEFERRED_DEPTH_CUTOFF, RenderEdgeDepthCutoff);
|
||||
|
|
@ -8465,10 +8476,13 @@ void LLPipeline::renderDeferredLighting()
|
|||
vert[2].set(3,1,0);
|
||||
|
||||
{
|
||||
setupHWLights(NULL); //to set mSunDir;
|
||||
setupHWLights(NULL); //to set mSun/MoonDir;
|
||||
glh::vec4f tc(mSunDir.mV);
|
||||
mat.mult_matrix_vec(tc);
|
||||
mTransformedSunDir.set(tc.v);
|
||||
|
||||
glh::vec4f tc_moon(mMoonDir.mV);
|
||||
mTransformedMoonDir.set(tc_moon.v);
|
||||
}
|
||||
|
||||
gGL.pushMatrix();
|
||||
|
|
@ -9078,10 +9092,13 @@ void LLPipeline::renderDeferredLightingToRT(LLRenderTarget* target)
|
|||
vert[2].set(3,1,0);
|
||||
|
||||
{
|
||||
setupHWLights(NULL); //to set mSunDir;
|
||||
setupHWLights(NULL); //to set mSun/MoonDir;
|
||||
glh::vec4f tc(mSunDir.mV);
|
||||
mat.mult_matrix_vec(tc);
|
||||
mTransformedSunDir.set(tc.v);
|
||||
|
||||
glh::vec4f tc_moon(mMoonDir.mV);
|
||||
mTransformedMoonDir.set(tc_moon.v);
|
||||
}
|
||||
|
||||
gGL.pushMatrix();
|
||||
|
|
|
|||
|
|
@ -657,7 +657,10 @@ public:
|
|||
|
||||
LLColor4 mSunDiffuse;
|
||||
LLVector4 mSunDir;
|
||||
LLVector4 mMoonDir;
|
||||
|
||||
LLVector4 mTransformedSunDir;
|
||||
LLVector4 mTransformedMoonDir;
|
||||
|
||||
bool mInitialized;
|
||||
bool mVertexShadersEnabled;
|
||||
|
|
|
|||
Loading…
Reference in New Issue