Merge viewer-eep
commit
82c68aca0d
|
|
@ -487,12 +487,16 @@ Geenz Spad
|
|||
STORM-1900
|
||||
STORM-1905
|
||||
NORSPEC-229
|
||||
BUG-226611
|
||||
BUG-226617
|
||||
BUG-226618
|
||||
BUG-226646
|
||||
BUG-226647
|
||||
BUG-226648
|
||||
BUG-226611
|
||||
BUG-226617
|
||||
BUG-226618
|
||||
BUG-226646
|
||||
BUG-226647
|
||||
BUG-226648
|
||||
OPEN-339
|
||||
BUG-226620
|
||||
OPEN-340
|
||||
OPEN-343
|
||||
Gene Frostbite
|
||||
GeneJ Composer
|
||||
Geneko Nemeth
|
||||
|
|
@ -1328,6 +1332,7 @@ Sovereign Engineer
|
|||
STORM-2143
|
||||
STORM-2148
|
||||
MAINT-7343
|
||||
OPEN-343
|
||||
SpacedOut Frye
|
||||
VWR-34
|
||||
VWR-45
|
||||
|
|
|
|||
|
|
@ -737,7 +737,7 @@ LLSD LLSettingsSky::defaults(const LLSettingsBase::TrackPosition& position)
|
|||
dfltsetting[SETTING_MOON_ROTATION] = moonquat.getValue();
|
||||
dfltsetting[SETTING_MOON_BRIGHTNESS] = LLSD::Real(0.5f);
|
||||
|
||||
dfltsetting[SETTING_STAR_BRIGHTNESS] = LLSD::Real(256.0000);
|
||||
dfltsetting[SETTING_STAR_BRIGHTNESS] = LLSD::Real(250.0000);
|
||||
dfltsetting[SETTING_SUNLIGHT_COLOR] = LLColor4(0.7342f, 0.7815f, 0.8999f, 0.0f).getValue();
|
||||
dfltsetting[SETTING_SUN_ROTATION] = sunquat.getValue();
|
||||
|
||||
|
|
@ -1037,72 +1037,65 @@ LLColor3 LLSettingsSky::getLightDiffuse() const
|
|||
return LLColor3::white;
|
||||
}
|
||||
|
||||
LLColor3 LLSettingsSky::getColor(const std::string& key, const LLColor3& default_value) const
|
||||
{
|
||||
if (mSettings.has(SETTING_LEGACY_HAZE) && mSettings[SETTING_LEGACY_HAZE].has(key))
|
||||
{
|
||||
return LLColor3(mSettings[SETTING_LEGACY_HAZE][key]);
|
||||
}
|
||||
if (mSettings.has(key))
|
||||
{
|
||||
return LLColor3(mSettings[key]);
|
||||
}
|
||||
return default_value;
|
||||
}
|
||||
|
||||
F32 LLSettingsSky::getFloat(const std::string& key, F32 default_value) const
|
||||
{
|
||||
if (mSettings.has(SETTING_LEGACY_HAZE) && mSettings[SETTING_LEGACY_HAZE].has(key))
|
||||
{
|
||||
return mSettings[SETTING_LEGACY_HAZE][key].asReal();
|
||||
}
|
||||
if (mSettings.has(key))
|
||||
{
|
||||
return mSettings[key].asReal();
|
||||
}
|
||||
return default_value;
|
||||
}
|
||||
|
||||
LLColor3 LLSettingsSky::getAmbientColor() const
|
||||
{
|
||||
if (mSettings.has(SETTING_LEGACY_HAZE) && mSettings[SETTING_LEGACY_HAZE].has(SETTING_AMBIENT))
|
||||
{
|
||||
return LLColor3(mSettings[SETTING_LEGACY_HAZE][SETTING_AMBIENT]);
|
||||
}
|
||||
if (mSettings.has(SETTING_AMBIENT))
|
||||
{
|
||||
return LLColor3(mSettings[SETTING_AMBIENT]);
|
||||
}
|
||||
return LLColor3(0.25f, 0.25f, 0.25f);
|
||||
return getColor(SETTING_AMBIENT, LLColor3(0.25f, 0.25f, 0.25f));
|
||||
}
|
||||
|
||||
LLColor3 LLSettingsSky::getBlueDensity() const
|
||||
{
|
||||
if (mSettings.has(SETTING_LEGACY_HAZE) && mSettings[SETTING_LEGACY_HAZE].has(SETTING_BLUE_DENSITY))
|
||||
{
|
||||
return LLColor3(mSettings[SETTING_LEGACY_HAZE][SETTING_BLUE_DENSITY]);
|
||||
}
|
||||
return LLColor3(0.2447f, 0.4487f, 0.7599f);
|
||||
return getColor(SETTING_BLUE_DENSITY, LLColor3(0.2447f, 0.4487f, 0.7599f));
|
||||
}
|
||||
|
||||
LLColor3 LLSettingsSky::getBlueHorizon() const
|
||||
{
|
||||
if (mSettings.has(SETTING_LEGACY_HAZE) && mSettings[SETTING_LEGACY_HAZE].has(SETTING_BLUE_HORIZON))
|
||||
{
|
||||
return LLColor3(mSettings[SETTING_LEGACY_HAZE][SETTING_BLUE_HORIZON]);
|
||||
}
|
||||
return LLColor3(0.4954f, 0.4954f, 0.6399f);
|
||||
return getColor(SETTING_BLUE_HORIZON, LLColor3(0.4954f, 0.4954f, 0.6399f));
|
||||
}
|
||||
|
||||
F32 LLSettingsSky::getHazeDensity() const
|
||||
{
|
||||
if (mSettings.has(SETTING_LEGACY_HAZE) && mSettings[SETTING_LEGACY_HAZE].has(SETTING_HAZE_DENSITY))
|
||||
{
|
||||
return mSettings[SETTING_LEGACY_HAZE][SETTING_HAZE_DENSITY].asReal();
|
||||
}
|
||||
return 0.7f;
|
||||
return getFloat(SETTING_HAZE_DENSITY, 0.7f);
|
||||
}
|
||||
|
||||
F32 LLSettingsSky::getHazeHorizon() const
|
||||
{
|
||||
if (mSettings.has(SETTING_LEGACY_HAZE) && mSettings[SETTING_LEGACY_HAZE].has(SETTING_HAZE_HORIZON))
|
||||
{
|
||||
return mSettings[SETTING_LEGACY_HAZE][SETTING_HAZE_HORIZON].asReal();
|
||||
}
|
||||
return 0.19f;
|
||||
return getFloat(SETTING_HAZE_HORIZON, 0.19f);
|
||||
}
|
||||
|
||||
F32 LLSettingsSky::getDensityMultiplier() const
|
||||
{
|
||||
F32 density_multiplier = 0.0001f;
|
||||
if (mSettings.has(SETTING_LEGACY_HAZE) && mSettings[SETTING_LEGACY_HAZE].has(SETTING_DENSITY_MULTIPLIER))
|
||||
{
|
||||
density_multiplier = mSettings[SETTING_LEGACY_HAZE][SETTING_DENSITY_MULTIPLIER].asReal();
|
||||
}
|
||||
return density_multiplier;
|
||||
return getFloat(SETTING_DENSITY_MULTIPLIER, 0.0001f);
|
||||
}
|
||||
|
||||
F32 LLSettingsSky::getDistanceMultiplier() const
|
||||
{
|
||||
if (mSettings.has(SETTING_LEGACY_HAZE) && mSettings[SETTING_LEGACY_HAZE].has(SETTING_DISTANCE_MULTIPLIER))
|
||||
{
|
||||
return mSettings[SETTING_LEGACY_HAZE][SETTING_DISTANCE_MULTIPLIER].asReal();
|
||||
}
|
||||
return 0.8f;
|
||||
return getFloat(SETTING_DISTANCE_MULTIPLIER, 0.8f);
|
||||
}
|
||||
|
||||
void LLSettingsSky::setPlanetRadius(F32 radius)
|
||||
|
|
|
|||
|
|
@ -337,6 +337,9 @@ private:
|
|||
static LLSD absorptionConfigDefault();
|
||||
static LLSD mieConfigDefault();
|
||||
|
||||
LLColor3 getColor(const std::string& key, const LLColor3& default_value) const;
|
||||
F32 getFloat(const std::string& key, F32 default_value) const;
|
||||
|
||||
void calculateHeavenlyBodyPositions() const;
|
||||
void calculateLightSettings() const;
|
||||
|
||||
|
|
|
|||
|
|
@ -493,12 +493,27 @@ BOOL LLGLSLShader::createShader(std::vector<LLStaticHashedString> * attributes,
|
|||
return success;
|
||||
}
|
||||
|
||||
BOOL LLGLSLShader::attachObject(std::string object_path)
|
||||
{
|
||||
if (LLShaderMgr::instance()->mShaderObjects.count(object_path) > 0)
|
||||
BOOL LLGLSLShader::attachVertexObject(std::string object_path) {
|
||||
if (LLShaderMgr::instance()->mVertexShaderObjects.count(object_path) > 0)
|
||||
{
|
||||
stop_glerror();
|
||||
glAttachObjectARB(mProgramObject, LLShaderMgr::instance()->mShaderObjects[object_path]);
|
||||
glAttachObjectARB(mProgramObject, LLShaderMgr::instance()->mVertexShaderObjects[object_path]);
|
||||
stop_glerror();
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
LL_SHADER_LOADING_WARNS() << "Attempting to attach shader object: '" << object_path << "' that hasn't been compiled." << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
BOOL LLGLSLShader::attachFragmentObject(std::string object_path)
|
||||
{
|
||||
if (LLShaderMgr::instance()->mFragmentShaderObjects.count(object_path) > 0)
|
||||
{
|
||||
stop_glerror();
|
||||
glAttachObjectARB(mProgramObject, LLShaderMgr::instance()->mFragmentShaderObjects[object_path]);
|
||||
stop_glerror();
|
||||
return TRUE;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -102,7 +102,8 @@ public:
|
|||
std::vector<LLStaticHashedString> * uniforms,
|
||||
U32 varying_count = 0,
|
||||
const char** varyings = NULL);
|
||||
BOOL attachObject(std::string object);
|
||||
BOOL attachFragmentObject(std::string object);
|
||||
BOOL attachVertexObject(std::string object);
|
||||
void attachObject(GLhandleARB object);
|
||||
void attachObjects(GLhandleARB* objects = NULL, S32 count = 0);
|
||||
BOOL mapAttributes(const std::vector<LLStaticHashedString> * attributes);
|
||||
|
|
|
|||
|
|
@ -79,12 +79,12 @@ BOOL LLShaderMgr::attachShaderFeatures(LLGLSLShader * shader)
|
|||
{
|
||||
if (features->hasWaterFog)
|
||||
{
|
||||
if (!shader->attachObject("windlight/atmosphericsVarsWaterV.glsl"))
|
||||
if (!shader->attachVertexObject("windlight/atmosphericsVarsWaterV.glsl"))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
else if (!shader->attachObject("windlight/atmosphericsVarsV.glsl"))
|
||||
else if (!shader->attachVertexObject("windlight/atmosphericsVarsV.glsl"))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
|
@ -92,7 +92,7 @@ BOOL LLShaderMgr::attachShaderFeatures(LLGLSLShader * shader)
|
|||
|
||||
if (features->calculatesLighting || features->calculatesAtmospherics)
|
||||
{
|
||||
if (!shader->attachObject("windlight/atmosphericsHelpersV.glsl"))
|
||||
if (!shader->attachVertexObject("windlight/atmosphericsHelpersV.glsl"))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
|
@ -102,40 +102,40 @@ BOOL LLShaderMgr::attachShaderFeatures(LLGLSLShader * shader)
|
|||
{
|
||||
if (features->isSpecular)
|
||||
{
|
||||
if (!shader->attachObject("lighting/lightFuncSpecularV.glsl"))
|
||||
if (!shader->attachVertexObject("lighting/lightFuncSpecularV.glsl"))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (!features->isAlphaLighting)
|
||||
{
|
||||
if (!shader->attachObject("lighting/sumLightsSpecularV.glsl"))
|
||||
if (!shader->attachVertexObject("lighting/sumLightsSpecularV.glsl"))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
if (!shader->attachObject("lighting/lightSpecularV.glsl"))
|
||||
if (!shader->attachVertexObject("lighting/lightSpecularV.glsl"))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!shader->attachObject("lighting/lightFuncV.glsl"))
|
||||
if (!shader->attachVertexObject("lighting/lightFuncV.glsl"))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (!features->isAlphaLighting)
|
||||
{
|
||||
if (!shader->attachObject("lighting/sumLightsV.glsl"))
|
||||
if (!shader->attachVertexObject("lighting/sumLightsV.glsl"))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
if (!shader->attachObject("lighting/lightV.glsl"))
|
||||
if (!shader->attachVertexObject("lighting/lightV.glsl"))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
|
@ -144,8 +144,12 @@ BOOL LLShaderMgr::attachShaderFeatures(LLGLSLShader * shader)
|
|||
|
||||
// NOTE order of shader object attaching is VERY IMPORTANT!!!
|
||||
if (features->calculatesAtmospherics)
|
||||
{
|
||||
if (!shader->attachObject("windlight/atmosphericsV.glsl"))
|
||||
{
|
||||
if (!shader->attachVertexObject("windlight/atmosphericsFuncs.glsl")) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (!shader->attachVertexObject("windlight/atmosphericsV.glsl"))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
|
@ -153,7 +157,7 @@ BOOL LLShaderMgr::attachShaderFeatures(LLGLSLShader * shader)
|
|||
|
||||
if (features->hasSkinning)
|
||||
{
|
||||
if (!shader->attachObject("avatar/avatarSkinV.glsl"))
|
||||
if (!shader->attachVertexObject("avatar/avatarSkinV.glsl"))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
|
@ -161,7 +165,7 @@ BOOL LLShaderMgr::attachShaderFeatures(LLGLSLShader * shader)
|
|||
|
||||
if (features->hasObjectSkinning)
|
||||
{
|
||||
if (!shader->attachObject("avatar/objectSkinV.glsl"))
|
||||
if (!shader->attachVertexObject("avatar/objectSkinV.glsl"))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
|
@ -177,12 +181,12 @@ BOOL LLShaderMgr::attachShaderFeatures(LLGLSLShader * shader)
|
|||
{
|
||||
if (features->hasWaterFog)
|
||||
{
|
||||
if (!shader->attachObject("windlight/atmosphericsVarsWaterF.glsl"))
|
||||
if (!shader->attachFragmentObject("windlight/atmosphericsVarsWaterF.glsl"))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
else if (!shader->attachObject("windlight/atmosphericsVarsF.glsl"))
|
||||
else if (!shader->attachFragmentObject("windlight/atmosphericsVarsF.glsl"))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
|
@ -190,7 +194,7 @@ BOOL LLShaderMgr::attachShaderFeatures(LLGLSLShader * shader)
|
|||
|
||||
if (features->calculatesLighting || features->calculatesAtmospherics)
|
||||
{
|
||||
if (!shader->attachObject("windlight/atmosphericsHelpersF.glsl"))
|
||||
if (!shader->attachFragmentObject("windlight/atmosphericsHelpersF.glsl"))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
|
@ -199,7 +203,7 @@ BOOL LLShaderMgr::attachShaderFeatures(LLGLSLShader * shader)
|
|||
// we want this BEFORE shadows and AO because those facilities use pos/norm access
|
||||
if (features->isDeferred)
|
||||
{
|
||||
if (!shader->attachObject("deferred/deferredUtil.glsl"))
|
||||
if (!shader->attachFragmentObject("deferred/deferredUtil.glsl"))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
|
@ -207,7 +211,7 @@ BOOL LLShaderMgr::attachShaderFeatures(LLGLSLShader * shader)
|
|||
|
||||
if (features->hasShadows)
|
||||
{
|
||||
if (!shader->attachObject("deferred/shadowUtil.glsl"))
|
||||
if (!shader->attachFragmentObject("deferred/shadowUtil.glsl"))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
|
@ -215,7 +219,7 @@ BOOL LLShaderMgr::attachShaderFeatures(LLGLSLShader * shader)
|
|||
|
||||
if (features->hasAmbientOcclusion)
|
||||
{
|
||||
if (!shader->attachObject("deferred/aoUtil.glsl"))
|
||||
if (!shader->attachFragmentObject("deferred/aoUtil.glsl"))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
|
@ -223,7 +227,7 @@ BOOL LLShaderMgr::attachShaderFeatures(LLGLSLShader * shader)
|
|||
|
||||
if (features->hasIndirect)
|
||||
{
|
||||
if (!shader->attachObject("deferred/indirect.glsl"))
|
||||
if (!shader->attachFragmentObject("deferred/indirect.glsl"))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
|
@ -231,7 +235,7 @@ BOOL LLShaderMgr::attachShaderFeatures(LLGLSLShader * shader)
|
|||
|
||||
if (features->hasGamma)
|
||||
{
|
||||
if (!shader->attachObject("windlight/gammaF.glsl"))
|
||||
if (!shader->attachFragmentObject("windlight/gammaF.glsl"))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
|
@ -239,7 +243,7 @@ BOOL LLShaderMgr::attachShaderFeatures(LLGLSLShader * shader)
|
|||
|
||||
if (features->hasSrgb)
|
||||
{
|
||||
if (!shader->attachObject("environment/srgbF.glsl"))
|
||||
if (!shader->attachFragmentObject("environment/srgbF.glsl"))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
|
@ -247,15 +251,19 @@ BOOL LLShaderMgr::attachShaderFeatures(LLGLSLShader * shader)
|
|||
|
||||
if (features->encodesNormal)
|
||||
{
|
||||
if (!shader->attachObject("environment/encodeNormF.glsl"))
|
||||
if (!shader->attachFragmentObject("environment/encodeNormF.glsl"))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
if (features->hasAtmospherics)
|
||||
{
|
||||
if (!shader->attachObject("windlight/atmosphericsF.glsl"))
|
||||
{
|
||||
if (!shader->attachFragmentObject("windlight/atmosphericsFuncs.glsl")) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (!shader->attachFragmentObject("windlight/atmosphericsF.glsl"))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
|
@ -263,7 +271,7 @@ BOOL LLShaderMgr::attachShaderFeatures(LLGLSLShader * shader)
|
|||
|
||||
if (features->hasTransport)
|
||||
{
|
||||
if (!shader->attachObject("windlight/transportF.glsl"))
|
||||
if (!shader->attachFragmentObject("windlight/transportF.glsl"))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
|
@ -275,7 +283,7 @@ BOOL LLShaderMgr::attachShaderFeatures(LLGLSLShader * shader)
|
|||
// NOTE order of shader object attaching is VERY IMPORTANT!!!
|
||||
if (features->hasWaterFog)
|
||||
{
|
||||
if (!shader->attachObject("environment/waterFogF.glsl"))
|
||||
if (!shader->attachFragmentObject("environment/waterFogF.glsl"))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
|
@ -289,14 +297,14 @@ BOOL LLShaderMgr::attachShaderFeatures(LLGLSLShader * shader)
|
|||
{
|
||||
if (features->hasAlphaMask)
|
||||
{
|
||||
if (!shader->attachObject("lighting/lightWaterAlphaMaskNonIndexedF.glsl"))
|
||||
if (!shader->attachFragmentObject("lighting/lightWaterAlphaMaskNonIndexedF.glsl"))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!shader->attachObject("lighting/lightWaterNonIndexedF.glsl"))
|
||||
if (!shader->attachFragmentObject("lighting/lightWaterNonIndexedF.glsl"))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
|
@ -306,14 +314,14 @@ BOOL LLShaderMgr::attachShaderFeatures(LLGLSLShader * shader)
|
|||
{
|
||||
if (features->hasAlphaMask)
|
||||
{
|
||||
if (!shader->attachObject("lighting/lightWaterAlphaMaskF.glsl"))
|
||||
if (!shader->attachFragmentObject("lighting/lightWaterAlphaMaskF.glsl"))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!shader->attachObject("lighting/lightWaterF.glsl"))
|
||||
if (!shader->attachFragmentObject("lighting/lightWaterF.glsl"))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
|
@ -328,14 +336,14 @@ BOOL LLShaderMgr::attachShaderFeatures(LLGLSLShader * shader)
|
|||
{
|
||||
if (features->hasAlphaMask)
|
||||
{
|
||||
if (!shader->attachObject("lighting/lightAlphaMaskNonIndexedF.glsl"))
|
||||
if (!shader->attachFragmentObject("lighting/lightAlphaMaskNonIndexedF.glsl"))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!shader->attachObject("lighting/lightNonIndexedF.glsl"))
|
||||
if (!shader->attachFragmentObject("lighting/lightNonIndexedF.glsl"))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
|
@ -345,14 +353,14 @@ BOOL LLShaderMgr::attachShaderFeatures(LLGLSLShader * shader)
|
|||
{
|
||||
if (features->hasAlphaMask)
|
||||
{
|
||||
if (!shader->attachObject("lighting/lightAlphaMaskF.glsl"))
|
||||
if (!shader->attachFragmentObject("lighting/lightAlphaMaskF.glsl"))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!shader->attachObject("lighting/lightF.glsl"))
|
||||
if (!shader->attachFragmentObject("lighting/lightF.glsl"))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
|
@ -370,14 +378,14 @@ BOOL LLShaderMgr::attachShaderFeatures(LLGLSLShader * shader)
|
|||
{
|
||||
if (features->disableTextureIndex)
|
||||
{
|
||||
if (!shader->attachObject("lighting/lightFullbrightShinyWaterNonIndexedF.glsl"))
|
||||
if (!shader->attachFragmentObject("lighting/lightFullbrightShinyWaterNonIndexedF.glsl"))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!shader->attachObject("lighting/lightFullbrightShinyWaterF.glsl"))
|
||||
if (!shader->attachFragmentObject("lighting/lightFullbrightShinyWaterF.glsl"))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
|
@ -390,12 +398,12 @@ BOOL LLShaderMgr::attachShaderFeatures(LLGLSLShader * shader)
|
|||
{
|
||||
if (features->hasAlphaMask)
|
||||
{
|
||||
if (!shader->attachObject("lighting/lightFullbrightWaterNonIndexedAlphaMaskF.glsl"))
|
||||
if (!shader->attachFragmentObject("lighting/lightFullbrightWaterNonIndexedAlphaMaskF.glsl"))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
else if (!shader->attachObject("lighting/lightFullbrightWaterNonIndexedF.glsl"))
|
||||
else if (!shader->attachFragmentObject("lighting/lightFullbrightWaterNonIndexedF.glsl"))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
|
@ -404,12 +412,12 @@ BOOL LLShaderMgr::attachShaderFeatures(LLGLSLShader * shader)
|
|||
{
|
||||
if (features->hasAlphaMask)
|
||||
{
|
||||
if (!shader->attachObject("lighting/lightFullbrightWaterAlphaMaskF.glsl"))
|
||||
if (!shader->attachFragmentObject("lighting/lightFullbrightWaterAlphaMaskF.glsl"))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
else if (!shader->attachObject("lighting/lightFullbrightWaterF.glsl"))
|
||||
else if (!shader->attachFragmentObject("lighting/lightFullbrightWaterF.glsl"))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
|
@ -421,14 +429,14 @@ BOOL LLShaderMgr::attachShaderFeatures(LLGLSLShader * shader)
|
|||
{
|
||||
if (features->disableTextureIndex)
|
||||
{
|
||||
if (!shader->attachObject("lighting/lightFullbrightShinyNonIndexedF.glsl"))
|
||||
if (!shader->attachFragmentObject("lighting/lightFullbrightShinyNonIndexedF.glsl"))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!shader->attachObject("lighting/lightFullbrightShinyF.glsl"))
|
||||
if (!shader->attachFragmentObject("lighting/lightFullbrightShinyF.glsl"))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
|
@ -443,14 +451,14 @@ BOOL LLShaderMgr::attachShaderFeatures(LLGLSLShader * shader)
|
|||
|
||||
if (features->hasAlphaMask)
|
||||
{
|
||||
if (!shader->attachObject("lighting/lightFullbrightNonIndexedAlphaMaskF.glsl"))
|
||||
if (!shader->attachFragmentObject("lighting/lightFullbrightNonIndexedAlphaMaskF.glsl"))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!shader->attachObject("lighting/lightFullbrightNonIndexedF.glsl"))
|
||||
if (!shader->attachFragmentObject("lighting/lightFullbrightNonIndexedF.glsl"))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
|
@ -460,14 +468,14 @@ BOOL LLShaderMgr::attachShaderFeatures(LLGLSLShader * shader)
|
|||
{
|
||||
if (features->hasAlphaMask)
|
||||
{
|
||||
if (!shader->attachObject("lighting/lightFullbrightAlphaMaskF.glsl"))
|
||||
if (!shader->attachFragmentObject("lighting/lightFullbrightAlphaMaskF.glsl"))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!shader->attachObject("lighting/lightFullbrightF.glsl"))
|
||||
if (!shader->attachFragmentObject("lighting/lightFullbrightF.glsl"))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
|
@ -485,14 +493,14 @@ BOOL LLShaderMgr::attachShaderFeatures(LLGLSLShader * shader)
|
|||
{
|
||||
if (features->disableTextureIndex)
|
||||
{
|
||||
if (!shader->attachObject("lighting/lightShinyWaterNonIndexedF.glsl"))
|
||||
if (!shader->attachFragmentObject("lighting/lightShinyWaterNonIndexedF.glsl"))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!shader->attachObject("lighting/lightShinyWaterF.glsl"))
|
||||
if (!shader->attachFragmentObject("lighting/lightShinyWaterF.glsl"))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
|
@ -504,14 +512,14 @@ BOOL LLShaderMgr::attachShaderFeatures(LLGLSLShader * shader)
|
|||
{
|
||||
if (features->disableTextureIndex)
|
||||
{
|
||||
if (!shader->attachObject("lighting/lightShinyNonIndexedF.glsl"))
|
||||
if (!shader->attachFragmentObject("lighting/lightShinyNonIndexedF.glsl"))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!shader->attachObject("lighting/lightShinyF.glsl"))
|
||||
if (!shader->attachFragmentObject("lighting/lightShinyF.glsl"))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
|
@ -522,14 +530,14 @@ BOOL LLShaderMgr::attachShaderFeatures(LLGLSLShader * shader)
|
|||
|
||||
if (features->mIndexedTextureChannels <= 1)
|
||||
{
|
||||
if (!shader->attachObject("objects/nonindexedTextureV.glsl"))
|
||||
if (!shader->attachVertexObject("objects/nonindexedTextureV.glsl"))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!shader->attachObject("objects/indexedTextureV.glsl"))
|
||||
if (!shader->attachVertexObject("objects/indexedTextureV.glsl"))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
|
@ -1005,7 +1013,12 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade
|
|||
if (ret)
|
||||
{
|
||||
// Add shader file to map
|
||||
mShaderObjects[filename] = ret;
|
||||
if (type == GL_VERTEX_SHADER_ARB) {
|
||||
mVertexShaderObjects[filename] = ret;
|
||||
}
|
||||
else if (type == GL_FRAGMENT_SHADER_ARB) {
|
||||
mFragmentShaderObjects[filename] = ret;
|
||||
}
|
||||
shader_level = try_gpu_class;
|
||||
}
|
||||
else
|
||||
|
|
|
|||
|
|
@ -280,7 +280,8 @@ public:
|
|||
|
||||
public:
|
||||
// Map of shader names to compiled
|
||||
std::map<std::string, GLhandleARB> mShaderObjects;
|
||||
std::map<std::string, GLhandleARB> mVertexShaderObjects;
|
||||
std::map<std::string, GLhandleARB> mFragmentShaderObjects;
|
||||
|
||||
//global (reserved slot) shader parameters
|
||||
std::vector<std::string> mReservedAttribs;
|
||||
|
|
|
|||
|
|
@ -348,6 +348,7 @@ set(viewer_SOURCE_FILES
|
|||
llfloaterdeleteprefpreset.cpp
|
||||
llfloaterdestinations.cpp
|
||||
llfloatereditextdaycycle.cpp
|
||||
llfloaterenvironmentadjust.cpp
|
||||
llfloaterevent.cpp
|
||||
llfloaterexperiencepicker.cpp
|
||||
llfloaterexperienceprofile.cpp
|
||||
|
|
@ -1104,6 +1105,7 @@ set(viewer_HEADER_FILES
|
|||
llfloaterdeleteprefpreset.h
|
||||
llfloaterdestinations.h
|
||||
llfloatereditextdaycycle.h
|
||||
llfloaterenvironmentadjust.h
|
||||
llfloaterevent.h
|
||||
llfloaterexperiencepicker.h
|
||||
llfloaterexperienceprofile.h
|
||||
|
|
|
|||
|
|
@ -77,13 +77,13 @@ vec2 encode_normal (vec3 n);
|
|||
vec3 scaleSoftClipFrag(vec3 l);
|
||||
vec3 atmosFragLighting(vec3 light, vec3 additive, vec3 atten);
|
||||
|
||||
void calcFragAtmospherics(vec3 inPositionEye, float ambFactor, out vec3 sunlit, out vec3 amblit, out vec3 atten, out vec3 additive);
|
||||
void calcAtmosphericVars(vec3 inPositionEye, float ambFactor, out vec3 sunlit, out vec3 amblit, out vec3 atten, out vec3 additive);
|
||||
|
||||
#ifdef HAS_SHADOW
|
||||
float sampleDirectionalShadow(vec3 pos, vec3 norm, vec2 pos_screen);
|
||||
#endif
|
||||
|
||||
vec3 calcPointLightOrSpotLight(vec3 light_col, vec3 diffuse, vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float fa, float is_pointlight, float ambiance ,float shadow)
|
||||
vec3 calcPointLightOrSpotLight(vec3 light_col, vec3 diffuse, vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float fa, float is_pointlight, float ambiance)
|
||||
{
|
||||
//get light vector
|
||||
vec3 lv = lp.xyz-v;
|
||||
|
|
@ -92,20 +92,19 @@ vec3 calcPointLightOrSpotLight(vec3 light_col, vec3 diffuse, vec3 v, vec3 n, vec
|
|||
float d = length(lv);
|
||||
float da = 1.0;
|
||||
vec3 col = vec3(0);
|
||||
|
||||
if (d > 0.0 && fa > 0.0)
|
||||
if (d > 0.0)
|
||||
{
|
||||
//normalize light vector
|
||||
lv = normalize(lv);
|
||||
vec3 norm = normalize(n);
|
||||
|
||||
da = max(0.0, dot(norm, lv));
|
||||
//da = min(da, shadow);
|
||||
da = dot(norm, lv);
|
||||
da = clamp(da, 0.0, 1.0);
|
||||
|
||||
//distance attenuation
|
||||
float dist = d/la;
|
||||
float dist_atten = clamp(1.0-(dist-1.0*(1.0-fa))/fa, 0.0, 1.0);
|
||||
float dist = (la > 0) ? d/la : 1.0f;
|
||||
fa += 1.0f;
|
||||
float dist_atten = (fa > 0) ? clamp(1.0-(dist-1.0*(1.0-fa))/fa, 0.0, 1.0) : 1.0f;
|
||||
dist_atten *= dist_atten;
|
||||
dist_atten *= 2.0f;
|
||||
|
||||
|
|
@ -116,18 +115,19 @@ vec3 calcPointLightOrSpotLight(vec3 light_col, vec3 diffuse, vec3 v, vec3 n, vec
|
|||
// to match spotLight (but not multiSpotLight) *sigh*
|
||||
float lit = max(da * dist_atten,0.0);
|
||||
|
||||
// the shadowmap is wrong for alpha objects
|
||||
// since we only have 2 maps but N spots
|
||||
//col = lit * light_col * diffuse * shadow;
|
||||
col = lit * light_col * diffuse;
|
||||
|
||||
float amb_da = ambiance;
|
||||
amb_da += (da*0.5) * (1.0 - shadow) * ambiance;
|
||||
amb_da += (da*da*0.5 + 0.5) * (1.0 - shadow) * ambiance;
|
||||
if (da > 0)
|
||||
{
|
||||
amb_da += (da*0.5+0.5) * ambiance;
|
||||
}
|
||||
amb_da += (da*da*0.5 + 0.5) * ambiance;
|
||||
amb_da *= dist_atten;
|
||||
amb_da = min(amb_da, 1.0f - lit);
|
||||
|
||||
col.rgb += amb_da * light_col * diffuse;
|
||||
col.rgb += amb_da * 0.5 * light_col * diffuse;
|
||||
|
||||
// no spec for alpha shader...
|
||||
}
|
||||
col = max(col, vec3(0));
|
||||
|
|
@ -188,31 +188,44 @@ void main()
|
|||
vec3 additive;
|
||||
vec3 atten;
|
||||
|
||||
calcFragAtmospherics(pos.xyz, 1.0, sunlit, amblit, additive, atten);
|
||||
calcAtmosphericVars(pos.xyz, 1.0, sunlit, amblit, additive, atten);
|
||||
sunlit *= 0.5;
|
||||
|
||||
vec2 abnormal = encode_normal(norm.xyz);
|
||||
vec2 abnormal = encode_normal(norm.xyz);
|
||||
|
||||
vec3 light_dir = (sun_up_factor == 1) ? sun_dir: moon_dir;
|
||||
float da = dot(norm.xyz, light_dir.xyz);
|
||||
da = clamp(da, 0.0, 1.0);
|
||||
da = pow(da, 1.0 / 1.3);
|
||||
da = clamp(da, -1.0, 1.0);
|
||||
|
||||
float final_da = da;
|
||||
final_da = clamp(final_da, 0.0f, 1.0f);
|
||||
final_da = pow(final_da, 1.0/1.3);
|
||||
|
||||
vec4 color = vec4(0,0,0,0);
|
||||
|
||||
color.rgb = amblit;
|
||||
color.a = final_alpha;
|
||||
|
||||
float ambient = abs(da);
|
||||
float ambient = da;
|
||||
ambient *= 0.5;
|
||||
ambient *= ambient;
|
||||
ambient = max(0.66, ambient); // keeps shadows dark
|
||||
ambient = 1.0 - ambient;
|
||||
|
||||
vec3 sun_contrib = min(da, shadow) * sunlit;
|
||||
vec3 sun_contrib = min(final_da, shadow) * sunlit;
|
||||
|
||||
color.rgb *= ambient;
|
||||
|
||||
vec3 post_ambient = color.rgb;
|
||||
|
||||
color.rgb += sun_contrib;
|
||||
|
||||
vec3 post_sunlight = color.rgb;
|
||||
|
||||
color.rgb *= diff.rgb;
|
||||
|
||||
vec3 post_diffuse = color.rgb;
|
||||
|
||||
//color.rgb = mix(diff.rgb, color.rgb, final_alpha);
|
||||
|
||||
color.rgb = atmosFragLighting(color.rgb, additive, atten);
|
||||
|
|
@ -220,7 +233,9 @@ void main()
|
|||
|
||||
vec4 light = vec4(0,0,0,0);
|
||||
|
||||
#define LIGHT_LOOP(i) light.rgb += calcPointLightOrSpotLight(light_diffuse[i].rgb, diff.rgb, pos.xyz, norm, light_position[i], light_direction[i].xyz, light_attenuation[i].x, light_attenuation[i].y, light_attenuation[i].z, light_attenuation[i].w, shadow);
|
||||
vec3 prelight_linearish_maybe = srgb_to_linear(color.rgb);
|
||||
|
||||
#define LIGHT_LOOP(i) light.rgb += calcPointLightOrSpotLight(light_diffuse[i].rgb, diff.rgb, pos.xyz, norm, light_position[i], light_direction[i].xyz, light_attenuation[i].x, light_attenuation[i].y, light_attenuation[i].z, light_attenuation[i].w * 0.5);
|
||||
|
||||
LIGHT_LOOP(1)
|
||||
LIGHT_LOOP(2)
|
||||
|
|
@ -230,10 +245,16 @@ void main()
|
|||
LIGHT_LOOP(6)
|
||||
LIGHT_LOOP(7)
|
||||
|
||||
vec3 light_linear = light.rgb;
|
||||
|
||||
// keep it linear
|
||||
//
|
||||
color.rgb += light.rgb;
|
||||
|
||||
vec3 postlight_linear = color.rgb;
|
||||
|
||||
//color.rgb = light_linear;
|
||||
|
||||
color.rgb = linear_to_srgb(color.rgb);
|
||||
#endif
|
||||
|
||||
|
|
@ -241,6 +262,7 @@ void main()
|
|||
color = applyWaterFogView(pos.xyz, color);
|
||||
#endif
|
||||
|
||||
|
||||
frag_color = color;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -45,6 +45,9 @@ VARYING vec2 vary_texcoord0;
|
|||
vec4 applyWaterFogView(vec3 pos, vec4 color);
|
||||
#endif
|
||||
|
||||
vec3 fullbrightAtmosTransport(vec3 light);
|
||||
vec3 fullbrightScaleSoftClip(vec3 light);
|
||||
|
||||
#ifdef HAS_ALPHA_MASK
|
||||
uniform float minimum_alpha;
|
||||
#endif
|
||||
|
|
@ -74,6 +77,8 @@ void main()
|
|||
color.rgb = fogged.rgb;
|
||||
color.a = fogged.a;
|
||||
#else
|
||||
color.rgb = fullbrightAtmosTransport(color.rgb);
|
||||
color.rgb = fullbrightScaleSoftClip(color.rgb);
|
||||
color.a = final_alpha;
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ vec4 applyWaterFogView(vec3 pos, vec4 color);
|
|||
vec3 atmosFragLighting(vec3 l, vec3 additive, vec3 atten);
|
||||
vec3 scaleSoftClipFrag(vec3 l);
|
||||
|
||||
void calcFragAtmospherics(vec3 inPositionEye, float ambFactor, out vec3 sunlit, out vec3 amblit, out vec3 additive, out vec3 atten);
|
||||
void calcAtmosphericVars(vec3 inPositionEye, float ambFactor, out vec3 sunlit, out vec3 amblit, out vec3 additive, out vec3 atten);
|
||||
|
||||
vec3 srgb_to_linear(vec3 cs);
|
||||
vec3 linear_to_srgb(vec3 cs);
|
||||
|
|
@ -83,7 +83,7 @@ uniform vec3 light_direction[8];
|
|||
uniform vec4 light_attenuation[8];
|
||||
uniform vec3 light_diffuse[8];
|
||||
|
||||
vec3 calcPointLightOrSpotLight(vec3 light_col, vec3 npos, vec3 diffuse, vec4 spec, vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float fa, float is_pointlight, inout float glare, float ambiance, float shadow)
|
||||
vec3 calcPointLightOrSpotLight(vec3 light_col, vec3 npos, vec3 diffuse, vec4 spec, vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float fa, float is_pointlight, inout float glare, float ambiance)
|
||||
{
|
||||
//get light vector
|
||||
vec3 lv = lp.xyz-v;
|
||||
|
|
@ -95,40 +95,40 @@ vec3 calcPointLightOrSpotLight(vec3 light_col, vec3 npos, vec3 diffuse, vec4 spe
|
|||
|
||||
vec3 col = vec3(0,0,0);
|
||||
|
||||
if (d > 0.0 && la > 0.0 && fa > 0.0)
|
||||
if (d > 0.0)
|
||||
{
|
||||
//normalize light vector
|
||||
lv = normalize(lv);
|
||||
|
||||
//distance attenuation
|
||||
float dist = d/la;
|
||||
float dist_atten = clamp(1.0-(dist-1.0*(1.0-fa))/fa, 0.0, 1.0);
|
||||
float dist = (la > 0) ? d/la : 1.0f;
|
||||
fa += 1.0f;
|
||||
float dist_atten = ( fa > 0) ? clamp(1.0-(dist-1.0*(1.0-fa))/fa, 0.0, 1.0) : 1.0f;
|
||||
dist_atten *= dist_atten;
|
||||
dist_atten *= 2.0f;
|
||||
|
||||
// spotlight coefficient.
|
||||
float spot = max(dot(-ln, lv), is_pointlight);
|
||||
da *= spot*spot; // GL_SPOT_EXPONENT=2
|
||||
|
||||
//angular attenuation
|
||||
da = dot(n, lv);
|
||||
//da = min(da, shadow);
|
||||
da *= clamp(da, 0.0, 1.0);
|
||||
da = clamp(da, 0.0, 1.0);
|
||||
|
||||
da *= spot*spot; // GL_SPOT_EXPONENT=2
|
||||
|
||||
float lit = max(da * dist_atten, 0.0);
|
||||
|
||||
// shadowmap is wrong for alpha-blended objs
|
||||
// since we created shadowmaps for 2 but render N
|
||||
//col = light_col*lit*diffuse*shadow;
|
||||
col = light_col*lit*diffuse;
|
||||
|
||||
float amb_da = ambiance;
|
||||
amb_da += (da*0.5) * (1.0 - shadow) * ambiance;
|
||||
amb_da += (da*da*0.5 + 0.5) * (1.0 - shadow) * ambiance;
|
||||
amb_da *= dist_atten;
|
||||
if (da > 0)
|
||||
{
|
||||
amb_da += (da*0.5 + 0.5) * ambiance;
|
||||
}
|
||||
amb_da += (da*da*0.5+0.5) * ambiance;
|
||||
amb_da = min(amb_da, 1.0f - lit);
|
||||
|
||||
col.rgb += amb_da * light_col * diffuse;
|
||||
col.rgb += amb_da * 0.5 * light_col * diffuse;
|
||||
|
||||
if (spec.a > 0.0)
|
||||
{
|
||||
|
|
@ -147,7 +147,7 @@ vec3 calcPointLightOrSpotLight(vec3 light_col, vec3 npos, vec3 diffuse, vec4 spe
|
|||
{
|
||||
float scol = fres*texture2D(lightFunc, vec2(nh, spec.a)).r*gt/(nh*da);
|
||||
vec3 speccol = lit*scol*light_col.rgb*spec.rgb;
|
||||
speccol = max(speccol, vec3(0));
|
||||
speccol = clamp(speccol, vec3(0), vec3(1));
|
||||
col += speccol;
|
||||
|
||||
float cur_glare = max(speccol.r, speccol.g);
|
||||
|
|
@ -289,29 +289,40 @@ void main()
|
|||
vec3 additive;
|
||||
vec3 atten;
|
||||
|
||||
calcFragAtmospherics(pos.xyz, 1.0, sunlit, amblit, additive, atten);
|
||||
calcAtmosphericVars(pos.xyz, 1.0, sunlit, amblit, additive, atten);
|
||||
|
||||
vec3 refnormpersp = normalize(reflect(pos.xyz, norm.xyz));
|
||||
|
||||
vec3 light_dir = (sun_up_factor == 1) ? sun_dir : moon_dir;
|
||||
|
||||
float da = dot(norm.xyz, light_dir.xyz);
|
||||
da = clamp(da, 0.0, 1.0);
|
||||
da = pow(da, 1.0 / 1.3);
|
||||
da = clamp(da, -1.0, 1.0);
|
||||
|
||||
float ambient = abs(da);
|
||||
float final_da = da;
|
||||
final_da = clamp(final_da, 0.0, 1.0);
|
||||
final_da = pow(final_da, 1.0 / 1.3);
|
||||
|
||||
float ambient = da;
|
||||
ambient *= 0.5;
|
||||
ambient *= ambient;
|
||||
ambient = max(0.66, ambient);
|
||||
ambient = 1.0 - ambient;
|
||||
|
||||
float final_da = min(da, shadow);
|
||||
vec3 sun_contrib = final_da * sunlit;
|
||||
vec3 sun_contrib = min(final_da, shadow) * sunlit;
|
||||
|
||||
col.rgb = amblit;
|
||||
col.rgb *= ambient;
|
||||
|
||||
vec3 post_ambient = col.rgb;
|
||||
|
||||
col.rgb += sun_contrib;
|
||||
|
||||
vec3 post_sunlight = col.rgb;
|
||||
|
||||
col.rgb *= diffuse.rgb;
|
||||
|
||||
vec3 post_diffuse = col.rgb;
|
||||
|
||||
float glare = 0.0;
|
||||
|
||||
if (spec.a > 0.0) // specular reflection
|
||||
|
|
@ -360,7 +371,9 @@ vec3 post_spec = col.rgb;
|
|||
|
||||
vec3 light = vec3(0,0,0);
|
||||
|
||||
#define LIGHT_LOOP(i) light.rgb += calcPointLightOrSpotLight(light_diffuse[i].rgb, npos, diffuse.rgb, final_specular, pos.xyz, norm.xyz, light_position[i], light_direction[i].xyz, light_attenuation[i].x, light_attenuation[i].y, light_attenuation[i].z, glare, light_attenuation[i].w, shadow);
|
||||
vec3 prelight_linearish_maybe = srgb_to_linear(col.rgb);
|
||||
|
||||
#define LIGHT_LOOP(i) light.rgb += calcPointLightOrSpotLight(light_diffuse[i].rgb, npos, diffuse.rgb, final_specular, pos.xyz, norm.xyz, light_position[i], light_direction[i].xyz, light_attenuation[i].x, light_attenuation[i].y, light_attenuation[i].z, glare, light_attenuation[i].w * 0.5);
|
||||
|
||||
LIGHT_LOOP(1)
|
||||
LIGHT_LOOP(2)
|
||||
|
|
@ -370,8 +383,12 @@ vec3 post_spec = col.rgb;
|
|||
LIGHT_LOOP(6)
|
||||
LIGHT_LOOP(7)
|
||||
|
||||
vec3 light_linear = light.rgb;
|
||||
|
||||
col.rgb += light.rgb;
|
||||
|
||||
vec3 postlight_linear = col.rgb;
|
||||
|
||||
glare = min(glare, 1.0);
|
||||
float al = max(diffcol.a,glare)*vertex_color.a;
|
||||
|
||||
|
|
@ -381,6 +398,8 @@ vec3 post_spec = col.rgb;
|
|||
al = temp.a;
|
||||
#endif
|
||||
|
||||
//col.rgb = light_linear;
|
||||
|
||||
col.rgb = linear_to_srgb(col.rgb);
|
||||
|
||||
frag_color.rgb = col.rgb;
|
||||
|
|
|
|||
|
|
@ -44,6 +44,8 @@ uniform sampler2D altDiffuseMap;
|
|||
uniform float blend_factor; // interp factor between moon A/B
|
||||
VARYING vec2 vary_texcoord0;
|
||||
|
||||
vec3 srgb_to_linear(vec3 c);
|
||||
|
||||
void main()
|
||||
{
|
||||
vec4 moonA = texture2D(diffuseMap, vary_texcoord0.xy);
|
||||
|
|
@ -58,12 +60,14 @@ void main()
|
|||
|
||||
vec3 exp = vec3(1.0 - mix * moon_brightness) * 2.0 - 1.0;
|
||||
c.rgb = pow(c.rgb, exp);
|
||||
c.rgb = srgb_to_linear(c.rgb);
|
||||
|
||||
//c.rgb *= moonlight_color.rgb;
|
||||
|
||||
frag_data[0] = vec4(c.rgb, c.a);
|
||||
frag_data[1] = vec4(0.0);
|
||||
frag_data[2] = vec4(0.0f);
|
||||
|
||||
gl_FragDepth = 0.99985f;
|
||||
gl_FragDepth = 0.999985f;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -49,18 +49,15 @@ uniform int sun_up_factor;
|
|||
float pcfShadow(sampler2DShadow shadowMap, vec3 norm, vec4 stc, float bias_mul, vec2 pos_screen, vec3 light_dir)
|
||||
{
|
||||
stc.xyz /= stc.w;
|
||||
stc.z += shadow_bias * bias_mul * 2.0;
|
||||
stc.z += shadow_bias * bias_mul * 16.0;
|
||||
stc.x = floor(stc.x*shadow_res.x + fract(stc.y*shadow_res.y))/shadow_res.x; // add some chaotic jitter to X sample pos according to Y to disguise the snapping going on here
|
||||
|
||||
float cs = shadow2D(shadowMap, stc.xyz).x;
|
||||
float shadow = cs * 4.0;
|
||||
|
||||
shadow += shadow2D(shadowMap, stc.xyz+vec3(2.0/shadow_res.x, 1.5/shadow_res.y, 0.0)).x;
|
||||
shadow += shadow2D(shadowMap, stc.xyz+vec3(1.0/shadow_res.x, -1.5/shadow_res.y, 0.0)).x;
|
||||
shadow += shadow2D(shadowMap, stc.xyz+vec3(-1.0/shadow_res.x, 1.5/shadow_res.y, 0.0)).x;
|
||||
shadow += shadow2D(shadowMap, stc.xyz+vec3(-2.0/shadow_res.x, -1.5/shadow_res.y, 0.0)).x;
|
||||
|
||||
return shadow * 0.125;
|
||||
return clamp(shadow * 0.125, 0.0, 1.0);
|
||||
}
|
||||
|
||||
float pcfSpotShadow(sampler2DShadow shadowMap, vec4 stc, float bias_scale, vec2 pos_screen)
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ vec3 getNorm(vec2 pos_screen);
|
|||
vec3 atmosFragLighting(vec3 l, vec3 additive, vec3 atten);
|
||||
vec3 fullbrightAtmosTransportFrag(vec3 l, vec3 additive, vec3 atten);
|
||||
|
||||
void calcFragAtmospherics(vec3 inPositionEye, float ambFactor, out vec3 sunlit, out vec3 amblit, out vec3 additive, out vec3 atten);
|
||||
void calcAtmosphericVars(vec3 inPositionEye, float ambFactor, out vec3 sunlit, out vec3 amblit, out vec3 additive, out vec3 atten);
|
||||
|
||||
vec3 scaleSoftClipFrag(vec3 l);
|
||||
|
||||
|
|
@ -86,13 +86,15 @@ void main()
|
|||
float envIntensity = norm.z;
|
||||
norm.xyz = getNorm(tc);
|
||||
|
||||
float light_gamma = 1.0/1.3;
|
||||
vec3 light_dir = (sun_up_factor == 1) ? sun_dir : moon_dir;
|
||||
|
||||
float da = dot(normalize(norm.xyz), light_dir.xyz);
|
||||
da = clamp(da, 0.0, 1.0);
|
||||
da = clamp(da, -1.0, 1.0);
|
||||
|
||||
float light_gamma = 1.0/1.3;
|
||||
da = pow(da, light_gamma);
|
||||
float final_da = da;
|
||||
final_da = clamp(final_da, 0.0, 1.0);
|
||||
final_da = pow(final_da, light_gamma);
|
||||
|
||||
vec4 diffuse = texture2DRect(diffuseRect, tc);
|
||||
|
||||
|
|
@ -105,32 +107,54 @@ void main()
|
|||
vec3 additive;
|
||||
vec3 atten;
|
||||
|
||||
calcFragAtmospherics(pos.xyz, 1.0, sunlit, amblit, additive, atten);
|
||||
|
||||
float ambient = min(abs(da), 1.0);
|
||||
calcAtmosphericVars(pos.xyz, 1.0, sunlit, amblit, additive, atten);
|
||||
sunlit *= 0.5;
|
||||
float ambient = da;
|
||||
ambient *= 0.5;
|
||||
ambient *= ambient;
|
||||
ambient = max(0.66, ambient);
|
||||
ambient = 1.0 - ambient;
|
||||
|
||||
vec3 sun_contrib = da * sunlit;
|
||||
vec3 sun_contrib = final_da * sunlit;
|
||||
|
||||
col.rgb = amblit;
|
||||
col.rgb *= ambient;
|
||||
|
||||
vec3 post_ambient = col.rgb;
|
||||
|
||||
col.rgb += sun_contrib;
|
||||
|
||||
vec3 post_sunlight = col.rgb;
|
||||
|
||||
col.rgb *= diffuse.rgb;
|
||||
|
||||
vec3 post_diffuse = col.rgb;
|
||||
|
||||
vec3 refnormpersp = normalize(reflect(pos.xyz, norm.xyz));
|
||||
|
||||
if (spec.a > 0.0) // specular reflection
|
||||
{
|
||||
// the old infinite-sky shiny reflection
|
||||
float sa = dot(refnormpersp, light_dir.xyz);
|
||||
vec3 dumbshiny = sunlit*(texture2D(lightFunc, vec2(sa, spec.a)).r);
|
||||
|
||||
// add the two types of shiny together
|
||||
vec3 spec_contrib = dumbshiny * spec.rgb;
|
||||
bloom = dot(spec_contrib, spec_contrib) / 6;
|
||||
col += spec_contrib;
|
||||
vec3 npos = -normalize(pos.xyz);
|
||||
|
||||
//vec3 ref = dot(pos+lv, norm);
|
||||
vec3 h = normalize(light_dir.xyz+npos);
|
||||
float nh = dot(norm.xyz, h);
|
||||
float nv = dot(norm.xyz, npos);
|
||||
float vh = dot(npos, h);
|
||||
float sa = nh;
|
||||
float fres = pow(1 - dot(h, npos), 5)*0.4+0.5;
|
||||
|
||||
float gtdenom = 2 * nh;
|
||||
float gt = max(0, min(gtdenom * nv / vh, gtdenom * da / vh));
|
||||
|
||||
if (nh > 0.0)
|
||||
{
|
||||
float scol = fres*texture2D(lightFunc, vec2(nh, spec.a)).r*gt/(nh*da);
|
||||
vec3 speccol = sun_contrib*scol*spec.rgb;
|
||||
speccol = clamp(speccol, vec3(0), vec3(1));
|
||||
bloom = dot(speccol, speccol) / 6;
|
||||
col += speccol;
|
||||
}
|
||||
}
|
||||
|
||||
col.rgb += diffuse.a * diffuse.rgb;
|
||||
|
|
@ -142,7 +166,7 @@ void main()
|
|||
col = mix(col.rgb, refcol, envIntensity);
|
||||
}
|
||||
|
||||
if (norm.w < 0.5)
|
||||
if (norm.w < 1)
|
||||
{
|
||||
col = atmosFragLighting(col, additive, atten);
|
||||
col = scaleSoftClipFrag(col);
|
||||
|
|
@ -153,6 +177,8 @@ void main()
|
|||
col = fogged.rgb;
|
||||
bloom = fogged.a;
|
||||
#endif
|
||||
|
||||
//col.rgb = post_diffuse;
|
||||
}
|
||||
|
||||
frag_color.rgb = col.rgb;
|
||||
|
|
|
|||
|
|
@ -59,6 +59,6 @@ void main()
|
|||
frag_data[1] = vec4(0.0f);
|
||||
frag_data[2] = vec4(0.0, 1.0, 0.0, 1.0);
|
||||
|
||||
gl_FragDepth = 0.99988f;
|
||||
gl_FragDepth = 0.999988f;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -66,8 +66,8 @@ void main()
|
|||
outColor = applyWaterFogView(pos.xyz, outColor);
|
||||
#endif
|
||||
|
||||
frag_data[0] = vec4(outColor.rgb, 1.0);
|
||||
frag_data[1] = vec4(0.66,0.86,0.66,0.05f);
|
||||
frag_data[0] = vec4(outColor.rgb, 0.0);
|
||||
frag_data[1] = vec4(0.0,0.0,0.0,0.0);
|
||||
vec3 nvn = normalize(vary_normal);
|
||||
frag_data[2] = vec4(encode_normal(nvn.xyz), 0.0, 0.0);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -153,12 +153,9 @@ void main()
|
|||
|
||||
vec4 pos = vary_position;
|
||||
|
||||
//color.rgb = atmosTransport(color.rgb);
|
||||
//color.rgb = scaleSoftClipFrag(color.rgb) * 0;
|
||||
|
||||
vec3 screenspacewavef = normalize((norm_mat*vec4(wavef, 1.0)).xyz);
|
||||
|
||||
frag_data[0] = vec4(color.rgb, 1); // diffuse
|
||||
frag_data[1] = vec4(specular * 0.4, 0.75); // speccolor, spec
|
||||
frag_data[0] = vec4(color.rgb, 0.25); // diffuse
|
||||
frag_data[1] = vec4(specular * 0.15, 0.5); // speccolor, spec
|
||||
frag_data[2] = vec4(encode_normal(screenspacewavef.xyz), 0.05, 0);// normalxy, 0, 0
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ vec3 scaleDownLight(vec3 light);
|
|||
|
||||
vec4 sumLights(vec3 pos, vec3 norm, vec4 color, vec4 baseLight)
|
||||
{
|
||||
vec4 col;
|
||||
vec4 col = vec4(0);
|
||||
col.a = color.a;
|
||||
|
||||
col.rgb = light_diffuse[1].rgb * calcDirectionalLight(norm, light_position[1].xyz);
|
||||
|
|
|
|||
|
|
@ -0,0 +1,140 @@
|
|||
/**
|
||||
* @file class1\windlight\atmosphericsFuncs.glsl
|
||||
*
|
||||
* $LicenseInfo:firstyear=2005&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2019, Linden Research, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation;
|
||||
* version 2.1 of the License only.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
uniform vec4 gamma;
|
||||
uniform vec4 lightnorm;
|
||||
uniform vec4 sunlight_color;
|
||||
uniform vec4 moonlight_color;
|
||||
uniform int sun_up_factor;
|
||||
uniform vec4 ambient;
|
||||
uniform vec4 blue_horizon;
|
||||
uniform vec4 blue_density;
|
||||
uniform float haze_horizon;
|
||||
uniform float haze_density;
|
||||
uniform float cloud_shadow;
|
||||
uniform float density_multiplier;
|
||||
uniform float distance_multiplier;
|
||||
uniform float max_y;
|
||||
uniform vec4 glow;
|
||||
uniform float scene_light_strength;
|
||||
uniform mat3 ssao_effect_mat;
|
||||
uniform int no_atmo;
|
||||
uniform float sun_moon_glow_factor;
|
||||
|
||||
vec3 nothing() {
|
||||
return vec3(0, 0, 0);
|
||||
}
|
||||
|
||||
void calcAtmosphericVars(vec3 inPositionEye, float ambFactor, out vec3 sunlit, out vec3 amblit, out vec3 additive, out vec3 atten) {
|
||||
|
||||
vec3 P = inPositionEye;
|
||||
|
||||
//(TERRAIN) limit altitude
|
||||
if (P.y > max_y) P *= (max_y / P.y);
|
||||
if (P.y < -max_y) P *= (-max_y / P.y);
|
||||
|
||||
vec3 tmpLightnorm = lightnorm.xyz;
|
||||
|
||||
vec3 Pn = normalize(P);
|
||||
float Plen = length(P);
|
||||
|
||||
vec4 temp1 = vec4(0);
|
||||
vec3 temp2 = vec3(0);
|
||||
vec4 blue_weight;
|
||||
vec4 haze_weight;
|
||||
vec4 sunlight = (sun_up_factor == 1) ? sunlight_color : moonlight_color;
|
||||
vec4 light_atten;
|
||||
|
||||
//sunlight attenuation effect (hue and brightness) due to atmosphere
|
||||
//this is used later for sunlight modulation at various altitudes
|
||||
light_atten = (blue_density + vec4(haze_density * 0.25)) * (density_multiplier * max_y);
|
||||
//I had thought blue_density and haze_density should have equal weighting,
|
||||
//but attenuation due to haze_density tends to seem too strong
|
||||
|
||||
temp1 = blue_density + vec4(haze_density);
|
||||
blue_weight = blue_density / temp1;
|
||||
haze_weight = vec4(haze_density) / temp1;
|
||||
|
||||
//(TERRAIN) compute sunlight from lightnorm only (for short rays like terrain)
|
||||
temp2.y = max(0.0, tmpLightnorm.y);
|
||||
if (temp2.y > 0.001f)
|
||||
{
|
||||
temp2.y = 1. / temp2.y;
|
||||
}
|
||||
temp2.y = max(0.001f, temp2.y);
|
||||
sunlight *= exp(-light_atten * temp2.y);
|
||||
|
||||
// main atmospheric scattering line integral
|
||||
temp2.z = Plen * density_multiplier;
|
||||
|
||||
// Transparency (-> temp1)
|
||||
// ATI Bugfix -- can't store temp1*temp2.z*distance_multiplier in a variable because the ati
|
||||
// compiler gets confused.
|
||||
temp1 = exp(-temp1 * temp2.z * distance_multiplier);
|
||||
|
||||
//final atmosphere attenuation factor
|
||||
atten = temp1.rgb;
|
||||
|
||||
//compute haze glow
|
||||
//(can use temp2.x as temp because we haven't used it yet)
|
||||
temp2.x = dot(Pn, tmpLightnorm.xyz);
|
||||
temp2.x = 1. - temp2.x;
|
||||
//temp2.x is 0 at the sun and increases away from sun
|
||||
temp2.x = max(temp2.x, .001); //was glow.y
|
||||
//set a minimum "angle" (smaller glow.y allows tighter, brighter hotspot)
|
||||
temp2.x *= glow.x;
|
||||
//higher glow.x gives dimmer glow (because next step is 1 / "angle")
|
||||
temp2.x = pow(temp2.x, glow.z);
|
||||
//glow.z should be negative, so we're doing a sort of (1 / "angle") function
|
||||
|
||||
//add "minimum anti-solar illumination"
|
||||
temp2.x += .25;
|
||||
|
||||
temp2.x *= sun_moon_glow_factor;
|
||||
|
||||
//increase ambient when there are more clouds
|
||||
vec4 tmpAmbient = ambient + (vec4(1.) - ambient) * cloud_shadow * 0.5;
|
||||
|
||||
/* decrease value and saturation (that in HSV, not HSL) for occluded areas
|
||||
* // for HSV color/geometry used here, see http://gimp-savvy.com/BOOK/index.html?node52.html
|
||||
* // The following line of code performs the equivalent of:
|
||||
* float ambAlpha = tmpAmbient.a;
|
||||
* float ambValue = dot(vec3(tmpAmbient), vec3(0.577)); // projection onto <1/rt(3), 1/rt(3), 1/rt(3)>, the neutral white-black axis
|
||||
* vec3 ambHueSat = vec3(tmpAmbient) - vec3(ambValue);
|
||||
* tmpAmbient = vec4(RenderSSAOEffect.valueFactor * vec3(ambValue) + RenderSSAOEffect.saturationFactor *(1.0 - ambFactor) * ambHueSat, ambAlpha);
|
||||
*/
|
||||
tmpAmbient = vec4(mix(ssao_effect_mat * tmpAmbient.rgb, tmpAmbient.rgb, ambFactor), tmpAmbient.a);
|
||||
|
||||
//haze color
|
||||
additive =
|
||||
vec3(blue_horizon * blue_weight * (sunlight*(1.-cloud_shadow) + tmpAmbient)
|
||||
+ (haze_horizon * haze_weight) * (sunlight*(1.-cloud_shadow) * temp2.x
|
||||
+ tmpAmbient));
|
||||
|
||||
//brightness of surface both sunlight and ambient
|
||||
sunlit = sunlight.rgb;
|
||||
amblit = tmpAmbient.rgb * .25;
|
||||
additive = normalize(additive);
|
||||
additive *= vec3(1.0 - exp(-temp2.z * distance_multiplier)) * 0.5;
|
||||
}
|
||||
|
|
@ -218,15 +218,19 @@ void main()
|
|||
dlit = color.rgb * plcol.rgb * plcol.a;
|
||||
|
||||
col = dlit*lit*diff_tex*shadow;
|
||||
amb_da += (da*0.5)*(1.0-shadow)*proj_ambiance;
|
||||
|
||||
// unshadowed for consistency between forward and deferred?
|
||||
amb_da += (da*0.5+0.5)/* *(1.0-shadow) */ *proj_ambiance;
|
||||
}
|
||||
|
||||
//float diff = clamp((proj_range-proj_focus)/proj_range, 0.0, 1.0);
|
||||
vec4 amb_plcol = texture2DLodAmbient(projectionMap, proj_tc.xy, proj_lod);
|
||||
|
||||
amb_da += (da*da*0.5+0.5)*(1.0-shadow)*proj_ambiance;
|
||||
|
||||
// unshadowed for consistency between forward and deferred?
|
||||
amb_da += (da*da*0.5+0.5) /* *(1.0-shadow) */ * proj_ambiance;
|
||||
amb_da *= dist_atten * noise;
|
||||
amb_da = min(amb_da, 1.0-lit);
|
||||
|
||||
col += amb_da*color.rgb*diff_tex.rgb*amb_plcol.rgb*amb_plcol.a;
|
||||
}
|
||||
|
||||
|
|
@ -251,7 +255,7 @@ void main()
|
|||
{
|
||||
float scol = fres*texture2D(lightFunc, vec2(nh, spec.a)).r*gt/(nh*da);
|
||||
vec3 speccol = dlit*scol*spec.rgb*shadow;
|
||||
speccol = max(speccol, vec3(0));
|
||||
speccol = clamp(speccol, vec3(0), vec3(1));
|
||||
col += speccol;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -67,11 +67,11 @@ uniform vec2 screen_res;
|
|||
|
||||
vec3 getNorm(vec2 pos_screen);
|
||||
|
||||
void calcFragAtmospherics(vec3 inPositionEye, float ambFactor, out vec3 sunlit, out vec3 amblit, out vec3 additive, out vec3 atten);
|
||||
vec3 atmosFragLighting(vec3 l, vec3 additive, vec3 atten);
|
||||
vec3 fullbrightScaleSoftClipFrag(vec3 l, vec3 add, vec3 atten);
|
||||
vec3 scaleSoftClipFrag(vec3 l);
|
||||
|
||||
void calcAtmosphericVars(vec3 inPositionEye, float ambFactor, out vec3 sunlit, out vec3 amblit, out vec3 additive, out vec3 atten);
|
||||
|
||||
vec3 atmosTransportFrag(vec3 light, vec3 additive, vec3 atten);
|
||||
vec3 fullbrightAtmosTransportFrag(vec3 light, vec3 additive, vec3 atten);
|
||||
vec3 fullbrightShinyAtmosTransportFrag(vec3 light, vec3 additive, vec3 atten);
|
||||
|
|
@ -94,18 +94,21 @@ void main()
|
|||
|
||||
vec3 light_dir = (sun_up_factor == 1) ? sun_dir : moon_dir;
|
||||
|
||||
float light_gamma = 1.0/1.3;
|
||||
float scol = 1.0;
|
||||
vec2 scol_ambocc = texture2DRect(lightMap, vary_fragcoord.xy).rg;
|
||||
|
||||
float da = dot(normalize(norm.xyz), light_dir.xyz);
|
||||
da = clamp(da, 0.0, 1.0);
|
||||
|
||||
float light_gamma = 1.0/1.3;
|
||||
da = pow(da, light_gamma);
|
||||
da = clamp(da, -1.0, 1.0);
|
||||
|
||||
vec4 diffuse = texture2DRect(diffuseRect, tc);
|
||||
|
||||
scol = max(scol_ambocc.r, diffuse.a);
|
||||
//scol = pow(scol, light_gamma);
|
||||
|
||||
float final_da = da;
|
||||
final_da = clamp(final_da, 0.0, 1.0);
|
||||
final_da = pow(final_da, light_gamma);
|
||||
|
||||
vec4 spec = texture2DRect(specularRect, vary_fragcoord.xy);
|
||||
vec3 col;
|
||||
|
|
@ -118,32 +121,54 @@ void main()
|
|||
vec3 additive;
|
||||
vec3 atten;
|
||||
|
||||
calcFragAtmospherics(pos.xyz, ambocc, sunlit, amblit, additive, atten);
|
||||
|
||||
float ambient = abs(da);
|
||||
calcAtmosphericVars(pos.xyz, ambocc, sunlit, amblit, additive, atten);
|
||||
sunlit *= 0.5;
|
||||
float ambient = da;
|
||||
ambient *= 0.5;
|
||||
ambient *= ambient;
|
||||
ambient = max(0.66, ambient);
|
||||
ambient = 1.0 - ambient;
|
||||
|
||||
vec3 sun_contrib = min(da,scol) * sunlit;
|
||||
vec3 sun_contrib = scol * final_da * sunlit;
|
||||
|
||||
col.rgb = amblit;
|
||||
col.rgb *= ambient;
|
||||
|
||||
vec3 post_ambient = col.rgb;
|
||||
|
||||
col.rgb += sun_contrib;
|
||||
|
||||
vec3 post_sunlight = col.rgb;
|
||||
|
||||
col.rgb *= diffuse.rgb;
|
||||
|
||||
vec3 post_diffuse = col.rgb;
|
||||
|
||||
vec3 refnormpersp = normalize(reflect(pos.xyz, norm.xyz));
|
||||
|
||||
if (spec.a > 0.0) // specular reflection
|
||||
{
|
||||
// the old infinite-sky shiny reflection
|
||||
float sa = dot(refnormpersp, light_dir.xyz);
|
||||
vec3 dumbshiny = sunlit*scol*(texture2D(lightFunc, vec2(sa, spec.a)).r);
|
||||
|
||||
// add the two types of shiny together
|
||||
vec3 spec_contrib = dumbshiny * spec.rgb;
|
||||
bloom = dot(spec_contrib, spec_contrib) / 6;
|
||||
col += spec_contrib;
|
||||
vec3 npos = -normalize(pos.xyz);
|
||||
|
||||
//vec3 ref = dot(pos+lv, norm);
|
||||
vec3 h = normalize(light_dir.xyz+npos);
|
||||
float nh = dot(norm.xyz, h);
|
||||
float nv = dot(norm.xyz, npos);
|
||||
float vh = dot(npos, h);
|
||||
float sa = nh;
|
||||
float fres = pow(1 - dot(h, npos), 5)*0.4+0.5;
|
||||
|
||||
float gtdenom = 2 * nh;
|
||||
float gt = max(0, min(gtdenom * nv / vh, gtdenom * da / vh));
|
||||
|
||||
if (nh > 0.0)
|
||||
{
|
||||
float scontrib = fres*texture2D(lightFunc, vec2(nh, spec.a)).r*gt/(nh*da);
|
||||
vec3 speccol = sun_contrib*scontrib*spec.rgb;
|
||||
speccol = clamp(speccol, vec3(0), vec3(1));
|
||||
bloom += dot (speccol, speccol) / 6;
|
||||
col += speccol;
|
||||
}
|
||||
}
|
||||
|
||||
col.rgb += diffuse.a * diffuse.rgb;
|
||||
|
|
@ -155,10 +180,8 @@ void main()
|
|||
col = mix(col.rgb, refcol, envIntensity);
|
||||
}
|
||||
|
||||
if (norm.w < 0.5)
|
||||
if (norm.w < 1)
|
||||
{
|
||||
//col = mix(atmosFragLighting(col, additive, atten), fullbrightAtmosTransportFrag(col, additive, atten), diffuse.a);
|
||||
//col = mix(scaleSoftClipFrag(col), fullbrightScaleSoftClipFrag(col, additive, atten), diffuse.a);
|
||||
col = atmosFragLighting(col, additive, atten);
|
||||
col = scaleSoftClipFrag(col);
|
||||
}
|
||||
|
|
@ -168,8 +191,6 @@ void main()
|
|||
col = fogged.rgb;
|
||||
bloom = fogged.a;
|
||||
#endif
|
||||
|
||||
//col.rgb = a;
|
||||
}
|
||||
frag_color.rgb = col.rgb;
|
||||
frag_color.a = bloom;
|
||||
|
|
|
|||
|
|
@ -185,7 +185,8 @@ void main()
|
|||
lv = proj_origin-pos.xyz;
|
||||
lv = normalize(lv);
|
||||
float da = dot(norm, lv);
|
||||
|
||||
da = clamp(da, 0.0, 1.0);
|
||||
|
||||
vec3 col = vec3(0,0,0);
|
||||
|
||||
vec3 diff_tex = texture2DRect(diffuseRect, frag.xy).rgb;
|
||||
|
|
@ -214,9 +215,10 @@ void main()
|
|||
vec4 plcol = texture2DLodDiffuse(projectionMap, proj_tc.xy, lod);
|
||||
|
||||
dlit = color.rgb * plcol.rgb * plcol.a;
|
||||
|
||||
|
||||
col = dlit*lit*diff_tex*shadow;
|
||||
amb_da += (da*0.5)*(1.0-shadow)*proj_ambiance;
|
||||
|
||||
amb_da += (da*0.5+0.5) /* * (1.0-shadow) */ * proj_ambiance;
|
||||
}
|
||||
|
||||
//float diff = clamp((proj_range-proj_focus)/proj_range, 0.0, 1.0);
|
||||
|
|
@ -250,7 +252,7 @@ void main()
|
|||
{
|
||||
float scol = fres*texture2D(lightFunc, vec2(nh, spec.a)).r*gt/(nh*da);
|
||||
vec3 speccol = dlit*scol*spec.rgb*shadow;
|
||||
speccol = max(speccol, vec3(0));
|
||||
speccol = clamp(speccol, vec3(0), vec3(1));
|
||||
col += speccol;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -152,7 +152,7 @@ void calcFragAtmospherics(vec3 inPositionEye, float ambFactor, out vec3 sunlit,
|
|||
+ tmpAmbient));
|
||||
|
||||
//brightness of surface both sunlight and ambient
|
||||
sunlit = srgb_to_linear(sunlight.rgb);
|
||||
sunlit = vec3(sunlight.rgb);
|
||||
amblit = vec3(tmpAmbient * .25);
|
||||
additive = normalize(additive);
|
||||
additive *= vec3(1.0 - exp(-temp2.z * distance_multiplier)) * 0.5;
|
||||
|
|
|
|||
|
|
@ -34,128 +34,20 @@ void setPositionEye(vec3 v);
|
|||
|
||||
vec3 getAdditiveColor();
|
||||
|
||||
//VARYING vec4 vary_CloudUVs;
|
||||
//VARYING float vary_CloudDensity;
|
||||
|
||||
// Inputs
|
||||
uniform vec4 morphFactor;
|
||||
uniform vec3 camPosLocal;
|
||||
//uniform vec4 camPosWorld;
|
||||
|
||||
uniform vec4 lightnorm;
|
||||
uniform vec4 sunlight_color;
|
||||
uniform vec4 moonlight_color;
|
||||
uniform int sun_up_factor;
|
||||
uniform vec4 ambient;
|
||||
uniform vec4 blue_horizon;
|
||||
uniform vec4 blue_density;
|
||||
uniform float haze_horizon;
|
||||
uniform float haze_density;
|
||||
uniform float cloud_shadow;
|
||||
uniform float density_multiplier;
|
||||
uniform float distance_multiplier;
|
||||
uniform float max_y;
|
||||
uniform vec4 glow;
|
||||
uniform float sun_moon_glow_factor;
|
||||
void calcAtmosphericVars(vec3 inPositionEye, float ambFactor, out vec3 sunlit, out vec3 amblit, out vec3 additive, out vec3 atten);
|
||||
|
||||
void calcAtmospherics(vec3 inPositionEye) {
|
||||
|
||||
vec3 P = inPositionEye;
|
||||
setPositionEye(P);
|
||||
|
||||
//(TERRAIN) limit altitude
|
||||
if (P.y > max_y) P *= (max_y / P.y);
|
||||
if (P.y < -max_y) P *= (-max_y / P.y);
|
||||
|
||||
vec3 tmpLightnorm = lightnorm.xyz;
|
||||
|
||||
vec3 Pn = normalize(P);
|
||||
float Plen = length(P);
|
||||
|
||||
vec4 temp1 = vec4(0);
|
||||
vec3 temp2 = vec3(0);
|
||||
vec4 blue_weight;
|
||||
vec4 haze_weight;
|
||||
vec4 sunlight = (sun_up_factor == 1) ? sunlight_color : moonlight_color;
|
||||
vec4 light_atten;
|
||||
|
||||
//sunlight attenuation effect (hue and brightness) due to atmosphere
|
||||
//this is used later for sunlight modulation at various altitudes
|
||||
light_atten = (blue_density + vec4(haze_density * 0.25)) * (density_multiplier * max_y);
|
||||
//I had thought blue_density and haze_density should have equal weighting,
|
||||
//but attenuation due to haze_density tends to seem too strong
|
||||
|
||||
temp1 = blue_density + vec4(haze_density);
|
||||
blue_weight = blue_density / temp1;
|
||||
haze_weight = vec4(haze_density) / temp1;
|
||||
|
||||
//(TERRAIN) compute sunlight from lightnorm only (for short rays like terrain)
|
||||
temp2.y = max(0.0, tmpLightnorm.y);
|
||||
if (temp2.y > 0.001f)
|
||||
{
|
||||
temp2.y = 1. / temp2.y;
|
||||
}
|
||||
temp2.y = max(0.001f, temp2.y);
|
||||
sunlight *= exp( - light_atten * temp2.y);
|
||||
|
||||
// main atmospheric scattering line integral
|
||||
temp2.z = Plen * density_multiplier;
|
||||
|
||||
// Transparency (-> temp1)
|
||||
// ATI Bugfix -- can't store temp1*temp2.z*distance_multiplier in a variable because the ati
|
||||
// compiler gets confused.
|
||||
temp1 = exp(-temp1 * temp2.z * distance_multiplier);
|
||||
|
||||
//final atmosphere attenuation factor
|
||||
setAtmosAttenuation(temp1.rgb);
|
||||
//vary_AtmosAttenuation = distance_multiplier / 10000.;
|
||||
//vary_AtmosAttenuation = density_multiplier * 100.;
|
||||
//vary_AtmosAttenuation = vec4(Plen / 100000., 0., 0., 1.);
|
||||
|
||||
//compute haze glow
|
||||
//(can use temp2.x as temp because we haven't used it yet)
|
||||
temp2.x = dot(Pn, tmpLightnorm.xyz);
|
||||
temp2.x = 1. - temp2.x;
|
||||
//temp2.x is 0 at the sun and increases away from sun
|
||||
temp2.x = max(temp2.x, .03); //was glow.y
|
||||
//set a minimum "angle" (smaller glow.y allows tighter, brighter hotspot)
|
||||
temp2.x *= glow.x;
|
||||
//higher glow.x gives dimmer glow (because next step is 1 / "angle")
|
||||
temp2.x = pow(temp2.x, glow.z);
|
||||
//glow.z should be negative, so we're doing a sort of (1 / "angle") function
|
||||
|
||||
temp2.x *= sun_moon_glow_factor;
|
||||
|
||||
//add "minimum anti-solar illumination"
|
||||
temp2.x += .25;
|
||||
|
||||
//increase ambient when there are more clouds
|
||||
vec4 tmpAmbient = ambient + (vec4(1.) - ambient) * cloud_shadow * 0.5;
|
||||
|
||||
vec3 additive =
|
||||
vec3(blue_horizon * blue_weight * (sunlight*(1.-cloud_shadow) + tmpAmbient)
|
||||
+ (haze_horizon * haze_weight) * (sunlight*(1.-cloud_shadow) * temp2.x
|
||||
+ tmpAmbient));
|
||||
additive = normalize(additive);
|
||||
|
||||
//brightness of surface both sunlight and ambient
|
||||
setSunlitColor(vec3(sunlight * .5));
|
||||
setAmblitColor(vec3(tmpAmbient * .25));
|
||||
setAdditiveColor(additive * vec3(1.0 - exp(-temp2.z * distance_multiplier)) * 0.5);
|
||||
|
||||
/*
|
||||
const float cloudShadowScale = 100.;
|
||||
// Get cloud uvs for shadowing
|
||||
vec3 cloudPos = inPositionEye + camPosWorld - cloudShadowScale / 2.;
|
||||
vary_CloudUVs.xy = cloudPos.xz / cloudShadowScale;
|
||||
|
||||
// We can take uv1 and multiply it by (TerrainSpan / CloudSpan)
|
||||
// cloudUVs *= (((worldMaxZ - worldMinZ) * 20) /40000.);
|
||||
vary_CloudUVs *= (10000./40000.);
|
||||
|
||||
// Offset by sun vector * (CloudAltitude / CloudSpan)
|
||||
vary_CloudUVs.x += tmpLightnorm.x / tmpLightnorm.y * (3000./40000.);
|
||||
vary_CloudUVs.y += tmpLightnorm.z / tmpLightnorm.y * (3000./40000.);
|
||||
*/
|
||||
vec3 tmpsunlit = vec3(1);
|
||||
vec3 tmpamblit = vec3(1);
|
||||
vec3 tmpaddlit = vec3(1);
|
||||
vec3 tmpattenlit = vec3(1);
|
||||
calcAtmosphericVars(inPositionEye, 1, tmpsunlit, tmpamblit, tmpaddlit, tmpattenlit);
|
||||
setSunlitColor(tmpsunlit);
|
||||
setAmblitColor(tmpamblit);
|
||||
setAdditiveColor(tmpaddlit);
|
||||
setAtmosAttenuation(tmpattenlit);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -32,104 +32,20 @@ void setPositionEye(vec3 v);
|
|||
|
||||
vec3 getAdditiveColor();
|
||||
|
||||
// Inputs
|
||||
uniform vec4 morphFactor;
|
||||
uniform vec3 camPosLocal;
|
||||
|
||||
uniform vec4 lightnorm;
|
||||
uniform vec4 sunlight_color;
|
||||
uniform vec4 moonlight_color;
|
||||
uniform int sun_up_factor;
|
||||
uniform vec4 ambient;
|
||||
uniform vec4 blue_horizon;
|
||||
uniform vec4 blue_density;
|
||||
uniform float haze_horizon;
|
||||
uniform float haze_density;
|
||||
uniform float cloud_shadow;
|
||||
uniform float density_multiplier;
|
||||
uniform float distance_multiplier;
|
||||
uniform float max_y;
|
||||
uniform vec4 glow;
|
||||
void calcAtmosphericVars(vec3 inPositionEye, float ambFactor, out vec3 sunlit, out vec3 amblit, out vec3 additive, out vec3 atten);
|
||||
|
||||
void calcAtmospherics(vec3 inPositionEye) {
|
||||
|
||||
vec3 P = inPositionEye;
|
||||
setPositionEye(P);
|
||||
|
||||
vec3 tmpLightnorm = lightnorm.xyz;
|
||||
|
||||
vec3 Pn = normalize(P);
|
||||
float Plen = length(P);
|
||||
|
||||
vec4 temp1 = vec4(0);
|
||||
vec3 temp2 = vec3(0);
|
||||
vec4 blue_weight;
|
||||
vec4 haze_weight;
|
||||
vec4 sunlight = (sun_up_factor == 1) ? sunlight_color : moonlight_color;
|
||||
vec4 light_atten;
|
||||
|
||||
//sunlight attenuation effect (hue and brightness) due to atmosphere
|
||||
//this is used later for sunlight modulation at various altitudes
|
||||
light_atten = (blue_density + vec4(haze_density * 0.25)) * (density_multiplier * max_y);
|
||||
//I had thought blue_density and haze_density should have equal weighting,
|
||||
//but attenuation due to haze_density tends to seem too strong
|
||||
|
||||
temp1 = blue_density + vec4(haze_density);
|
||||
blue_weight = blue_density / temp1;
|
||||
haze_weight = vec4(haze_density) / temp1;
|
||||
|
||||
//(TERRAIN) compute sunlight from lightnorm only (for short rays like terrain)
|
||||
temp2.y = max(0.0, tmpLightnorm.y);
|
||||
temp2.y = 1. / temp2.y;
|
||||
sunlight *= exp( - light_atten * temp2.y);
|
||||
|
||||
// main atmospheric scattering line integral
|
||||
temp2.z = Plen * density_multiplier;
|
||||
|
||||
// Transparency (-> temp1)
|
||||
// ATI Bugfix -- can't store temp1*temp2.z*distance_multiplier in a variable because the ati
|
||||
// compiler gets confused.
|
||||
temp1 = exp(-temp1 * temp2.z * distance_multiplier);
|
||||
|
||||
//final atmosphere attenuation factor
|
||||
setAtmosAttenuation(temp1.rgb);
|
||||
|
||||
//compute haze glow
|
||||
//(can use temp2.x as temp because we haven't used it yet)
|
||||
temp2.x = dot(Pn, tmpLightnorm.xyz);
|
||||
temp2.x = 1. - temp2.x;
|
||||
//temp2.x is 0 at the sun and increases away from sun
|
||||
temp2.x = max(temp2.x, .03); //was glow.y
|
||||
//set a minimum "angle" (smaller glow.y allows tighter, brighter hotspot)
|
||||
temp2.x *= glow.x;
|
||||
//higher glow.x gives dimmer glow (because next step is 1 / "angle")
|
||||
temp2.x = pow(temp2.x, glow.z);
|
||||
//glow.z should be negative, so we're doing a sort of (1 / "angle") function
|
||||
|
||||
//add "minimum anti-solar illumination"
|
||||
temp2.x += .25;
|
||||
|
||||
//increase ambient when there are more clouds
|
||||
vec4 tmpAmbient = ambient + (vec4(1.) - ambient) * cloud_shadow * 0.5;
|
||||
|
||||
/* decrease value and saturation (that in HSV, not HSL) for occluded areas
|
||||
* // for HSV color/geometry used here, see http://gimp-savvy.com/BOOK/index.html?node52.html
|
||||
* // The following line of code performs the equivalent of:
|
||||
* float ambAlpha = tmpAmbient.a;
|
||||
* float ambValue = dot(vec3(tmpAmbient), vec3(0.577)); // projection onto <1/rt(3), 1/rt(3), 1/rt(3)>, the neutral white-black axis
|
||||
* vec3 ambHueSat = vec3(tmpAmbient) - vec3(ambValue);
|
||||
* tmpAmbient = vec4(RenderSSAOEffect.valueFactor * vec3(ambValue) + RenderSSAOEffect.saturationFactor *(1.0 - ambFactor) * ambHueSat, ambAlpha);
|
||||
*/
|
||||
//tmpAmbient = vec4(mix(ssao_effect_mat * tmpAmbient.rgb, tmpAmbient.rgb, ambFactor), tmpAmbient.a);
|
||||
|
||||
//haze color
|
||||
setAdditiveColor(
|
||||
vec3(blue_horizon * blue_weight * (sunlight*(1.-cloud_shadow) + tmpAmbient)
|
||||
+ (haze_horizon * haze_weight) * (sunlight*(1.-cloud_shadow) * temp2.x
|
||||
+ tmpAmbient)));
|
||||
|
||||
//brightness of surface both sunlight and ambient
|
||||
setSunlitColor(vec3(sunlight * .5));
|
||||
setAmblitColor(vec3(tmpAmbient * .25));
|
||||
setAdditiveColor(getAdditiveColor() * vec3(1.0 - temp1));
|
||||
vec3 P = inPositionEye;
|
||||
setPositionEye(P);
|
||||
vec3 tmpsunlit = vec3(1);
|
||||
vec3 tmpamblit = vec3(1);
|
||||
vec3 tmpaddlit = vec3(1);
|
||||
vec3 tmpattenlit = vec3(1);
|
||||
calcAtmosphericVars(inPositionEye, 1, tmpsunlit, tmpamblit, tmpaddlit, tmpattenlit);
|
||||
setSunlitColor(tmpsunlit);
|
||||
setAmblitColor(tmpamblit);
|
||||
setAdditiveColor(tmpaddlit);
|
||||
setAtmosAttenuation(tmpattenlit);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1969,7 +1969,6 @@ bool LLAppearanceMgr::getCanRemoveOutfit(const LLUUID& outfit_cat_id)
|
|||
LLFindNonRemovableObjects filter_non_removable;
|
||||
LLInventoryModel::cat_array_t cats;
|
||||
LLInventoryModel::item_array_t items;
|
||||
LLInventoryModel::item_array_t::const_iterator it;
|
||||
gInventory.collectDescendentsIf(outfit_cat_id, cats, items, false, filter_non_removable);
|
||||
if (!cats.empty() || !items.empty())
|
||||
{
|
||||
|
|
|
|||
|
|
@ -825,13 +825,10 @@ namespace action_give_inventory
|
|||
* Checks My Inventory visibility.
|
||||
*/
|
||||
|
||||
// static bool is_give_inventory_acceptable()
|
||||
// [SL:KB] - Patch: Inventory-ShareSelection | Checked: 2011-06-29 (Catznip-2.6.0e) | Added: Catznip-2.6.0e
|
||||
static bool is_give_inventory_acceptable(const uuid_set_t inventory_selected_uuids)
|
||||
// [/SL:KB]
|
||||
static bool is_give_inventory_acceptable(LLInventoryPanel* panel = NULL)
|
||||
{
|
||||
// // check selection in the panel
|
||||
// const std::set<LLUUID> inventory_selected_uuids = LLAvatarActions::getInventorySelectedUUIDs();
|
||||
// check selection in the panel
|
||||
const std::set<LLUUID> inventory_selected_uuids = LLAvatarActions::getInventorySelectedUUIDs(panel);
|
||||
if (inventory_selected_uuids.empty()) return false; // nothing selected
|
||||
|
||||
bool acceptable = false;
|
||||
|
|
@ -839,30 +836,29 @@ namespace action_give_inventory
|
|||
const std::set<LLUUID>::const_iterator it_end = inventory_selected_uuids.end();
|
||||
for (; it != it_end; ++it)
|
||||
{
|
||||
LLViewerInventoryCategory* inv_cat = gInventory.getCategory(*it);
|
||||
// any category can be offered.
|
||||
if (inv_cat)
|
||||
{
|
||||
acceptable = true;
|
||||
continue;
|
||||
}
|
||||
LLViewerInventoryCategory* inv_cat = gInventory.getCategory(*it);
|
||||
// any category can be offered.
|
||||
if (inv_cat)
|
||||
{
|
||||
acceptable = true;
|
||||
continue;
|
||||
}
|
||||
|
||||
LLViewerInventoryItem* inv_item = gInventory.getItem(*it);
|
||||
// check if inventory item can be given
|
||||
if (LLGiveInventory::isInventoryGiveAcceptable(inv_item))
|
||||
{
|
||||
acceptable = true;
|
||||
continue;
|
||||
}
|
||||
LLViewerInventoryItem* inv_item = gInventory.getItem(*it);
|
||||
// check if inventory item can be given
|
||||
if (LLGiveInventory::isInventoryGiveAcceptable(inv_item))
|
||||
{
|
||||
acceptable = true;
|
||||
continue;
|
||||
}
|
||||
|
||||
// there are neither item nor category in inventory
|
||||
acceptable = false;
|
||||
break;
|
||||
// there are neither item nor category in inventory
|
||||
acceptable = false;
|
||||
break;
|
||||
}
|
||||
return acceptable;
|
||||
}
|
||||
|
||||
|
||||
static void build_items_string(const std::set<LLUUID>& inventory_selected_uuids , std::string& items_string)
|
||||
{
|
||||
llassert(inventory_selected_uuids.size() > 0);
|
||||
|
|
@ -897,7 +893,7 @@ namespace action_give_inventory
|
|||
uuid_vec_t mAvatarUuids;
|
||||
};
|
||||
|
||||
static void give_inventory_cb(const LLSD& notification, const LLSD& response)
|
||||
static void give_inventory_cb(const LLSD& notification, const LLSD& response, std::set<LLUUID> inventory_selected_uuids)
|
||||
{
|
||||
S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
|
||||
// if Cancel pressed
|
||||
|
|
@ -906,18 +902,6 @@ namespace action_give_inventory
|
|||
return;
|
||||
}
|
||||
|
||||
// LLInventoryPanel* active_panel = get_active_inventory_panel();
|
||||
// if (!active_panel) return;
|
||||
|
||||
// const uuid_set_t inventory_selected_uuids = active_panel->getRootFolder()->getSelectionList();
|
||||
// [SL:KB] - Patch: Inventory-ShareSelection | Checked: 2011-06-29 (Catznip-2.6.0e) | Added: Catznip-2.6.0e
|
||||
uuid_set_t inventory_selected_uuids;
|
||||
const LLSD& sdPayload = notification["payload"];
|
||||
for (LLSD::array_const_iterator itItem = sdPayload.beginArray(); itItem != sdPayload.endArray(); ++itItem)
|
||||
inventory_selected_uuids.insert(itItem->asUUID());
|
||||
// [/SL:KB]
|
||||
//const std::set<LLUUID> inventory_selected_uuids = LLAvatarActions::getInventorySelectedUUIDs();
|
||||
|
||||
if (inventory_selected_uuids.empty())
|
||||
{
|
||||
return;
|
||||
|
|
@ -1000,19 +984,11 @@ namespace action_give_inventory
|
|||
* @param avatar_names - avatar names request to be sent.
|
||||
* @param avatar_uuids - avatar names request to be sent.
|
||||
*/
|
||||
// static void give_inventory(const uuid_vec_t& avatar_uuids, const std::vector<LLAvatarName> avatar_names)
|
||||
// [SL:KB] - Patch: Inventory-ShareSelection | Checked: 2011-06-29 (Catznip-2.6.0e) | Added: Catznip-2.6.0e
|
||||
static void give_inventory(const uuid_vec_t& avatar_uuids, const std::vector<LLAvatarName> avatar_names, const uuid_set_t inventory_selected_uuids)
|
||||
// [/SL:KB]
|
||||
static void give_inventory(const uuid_vec_t& avatar_uuids, const std::vector<LLAvatarName> avatar_names, LLInventoryPanel* panel = NULL)
|
||||
{
|
||||
llassert(avatar_names.size() == avatar_uuids.size());
|
||||
|
||||
// LLInventoryPanel* active_panel = get_active_inventory_panel();
|
||||
// if (!active_panel) return;
|
||||
|
||||
// const uuid_set_t inventory_selected_uuids = active_panel->getRootFolder()->getSelectionList();
|
||||
//const std::set<LLUUID> inventory_selected_uuids = LLAvatarActions::getInventorySelectedUUIDs();
|
||||
|
||||
const std::set<LLUUID> inventory_selected_uuids = LLAvatarActions::getInventorySelectedUUIDs(panel);
|
||||
if (inventory_selected_uuids.empty())
|
||||
{
|
||||
return;
|
||||
|
|
@ -1044,17 +1020,9 @@ namespace action_give_inventory
|
|||
LLSD substitutions;
|
||||
substitutions["RESIDENTS"] = residents;
|
||||
substitutions["ITEMS"] = items;
|
||||
// [SL:KB] - Patch: Inventory-ShareSelection | Checked: 2011-06-29 (Catznip-2.6.0e) | Added: Catznip-2.6.0e
|
||||
LLSD sdPayload;
|
||||
for (uuid_set_t::const_iterator itItem = inventory_selected_uuids.begin(); itItem != inventory_selected_uuids.end(); ++itItem)
|
||||
sdPayload.append(*itItem);
|
||||
// [/SL:KB]
|
||||
LLShareInfo::instance().mAvatarNames = avatar_names;
|
||||
LLShareInfo::instance().mAvatarUuids = avatar_uuids;
|
||||
// LLNotificationsUtil::add(notification, substitutions, LLSD(), &give_inventory_cb);
|
||||
// [SL:KB] - Patch: Inventory-ShareSelection | Checked: 2011-06-29 (Catznip-2.6.0e) | Added: Catznip-2.6.0e
|
||||
LLNotificationsUtil::add(notification, substitutions, sdPayload, &give_inventory_cb);
|
||||
// [/SL:KB]
|
||||
LLNotificationsUtil::add(notification, substitutions, LLSD(), boost::bind(&give_inventory_cb, _1, _2, inventory_selected_uuids));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1110,11 +1078,14 @@ void LLAvatarActions::buildResidentsString(const uuid_vec_t& avatar_uuids, std::
|
|||
}
|
||||
|
||||
//static
|
||||
std::set<LLUUID> LLAvatarActions::getInventorySelectedUUIDs()
|
||||
std::set<LLUUID> LLAvatarActions::getInventorySelectedUUIDs(LLInventoryPanel* active_panel)
|
||||
{
|
||||
std::set<LLFolderViewItem*> inventory_selected;
|
||||
|
||||
LLInventoryPanel* active_panel = action_give_inventory::get_active_inventory_panel();
|
||||
if (!active_panel)
|
||||
{
|
||||
active_panel = action_give_inventory::get_active_inventory_panel();
|
||||
}
|
||||
if (active_panel)
|
||||
{
|
||||
inventory_selected= active_panel->getRootFolder()->getSelectionList();
|
||||
|
|
@ -1144,20 +1115,16 @@ void LLAvatarActions::shareWithAvatars(LLView * panel)
|
|||
{
|
||||
using namespace action_give_inventory;
|
||||
|
||||
LLFloater* root_floater = gFloaterView->getParentFloater(panel);
|
||||
// LLFloaterAvatarPicker* picker =
|
||||
// LLFloaterAvatarPicker::show(boost::bind(give_inventory, _1, _2), TRUE, FALSE, FALSE, root_floater->getName());
|
||||
// if (!picker)
|
||||
// {
|
||||
// return;
|
||||
// }
|
||||
//
|
||||
// picker->setOkBtnEnableCb(boost::bind(is_give_inventory_acceptable));
|
||||
// [SL:KB] - Patch: Inventory-ShareSelection | Checked: 2011-06-29 (Catznip-2.6.0e) | Added: Catznip-2.6.0e
|
||||
const uuid_set_t idItems = getInventorySelectedUUIDs();
|
||||
LLFloaterAvatarPicker* picker = LLFloaterAvatarPicker::show(boost::bind(give_inventory, _1, _2, idItems), TRUE, FALSE);
|
||||
picker->setOkBtnEnableCb(boost::bind(is_give_inventory_acceptable, idItems));
|
||||
// [/SL:KB]
|
||||
LLFloater* root_floater = gFloaterView->getParentFloater(panel);
|
||||
LLInventoryPanel* inv_panel = dynamic_cast<LLInventoryPanel*>(panel);
|
||||
LLFloaterAvatarPicker* picker =
|
||||
LLFloaterAvatarPicker::show(boost::bind(give_inventory, _1, _2, inv_panel), TRUE, FALSE, FALSE, root_floater->getName());
|
||||
if (!picker)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
picker->setOkBtnEnableCb(boost::bind(is_give_inventory_acceptable, inv_panel));
|
||||
picker->openFriendsTab();
|
||||
|
||||
if (root_floater)
|
||||
|
|
|
|||
|
|
@ -318,7 +318,7 @@ public:
|
|||
static void onDerenderAvatarNameLookup(const LLUUID& agent_id, const LLAvatarName& av_name, bool permanent);
|
||||
// </FS:Ansariel> Derender
|
||||
|
||||
static std::set<LLUUID> getInventorySelectedUUIDs();
|
||||
static std::set<LLUUID> getInventorySelectedUUIDs(LLInventoryPanel* active_panel = NULL);
|
||||
|
||||
protected:
|
||||
static bool callbackEstateKick(const LLSD& notification, const LLSD& response);
|
||||
|
|
|
|||
|
|
@ -798,6 +798,11 @@ const S32 LLEnvironment::VERSION_CLEANUP(-4); // for cleanups
|
|||
|
||||
const F32 LLEnvironment::SUN_DELTA_YAW(F_PI); // 180deg
|
||||
|
||||
|
||||
const U32 LLEnvironment::DayInstance::NO_ANIMATE_SKY(0x01);
|
||||
const U32 LLEnvironment::DayInstance::NO_ANIMATE_WATER(0x02);
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
LLEnvironment::LLEnvironment():
|
||||
mCloudScrollDelta(),
|
||||
|
|
@ -1110,28 +1115,28 @@ void LLEnvironment::setEnvironment(LLEnvironment::EnvSelection_t env, LLEnvironm
|
|||
|
||||
DayInstance::ptr_t environment = getEnvironmentInstance(env, true);
|
||||
|
||||
// LLSettingsSky::ptr_t prev_sky = mEnvironments[ENV_DEFAULT]->getSky();
|
||||
// LLSettingsWater::ptr_t prev_water = mEnvironments[ENV_DEFAULT]->getWater();
|
||||
// if (mCurrentEnvironment && (ENV_EDIT == env))
|
||||
// {
|
||||
// prev_sky = mCurrentEnvironment->getSky() ? mCurrentEnvironment->getSky() : prev_sky;
|
||||
// prev_water = mCurrentEnvironment->getWater() ? mCurrentEnvironment->getWater() : prev_water;
|
||||
// }
|
||||
|
||||
// environment->clear();
|
||||
// environment->setSky((fixed.first) ? fixed.first : prev_sky);
|
||||
// environment->setWater((fixed.second) ? fixed.second : prev_water);
|
||||
if (fixed.first)
|
||||
{
|
||||
environment->setSky(fixed.first);
|
||||
environment->setFlags(DayInstance::NO_ANIMATE_SKY);
|
||||
}
|
||||
else if (!environment->getSky())
|
||||
{
|
||||
environment->setSky(mCurrentEnvironment->getSky());
|
||||
environment->setFlags(DayInstance::NO_ANIMATE_SKY);
|
||||
}
|
||||
|
||||
if (fixed.second)
|
||||
{
|
||||
environment->setWater(fixed.second);
|
||||
environment->setFlags(DayInstance::NO_ANIMATE_WATER);
|
||||
}
|
||||
else if (!environment->getWater())
|
||||
{
|
||||
environment->setWater(mCurrentEnvironment->getWater());
|
||||
|
||||
|
||||
environment->setFlags(DayInstance::NO_ANIMATE_WATER);
|
||||
}
|
||||
|
||||
if (!mSignalEnvChanged.empty())
|
||||
mSignalEnvChanged(env, env_version);
|
||||
|
|
@ -2448,7 +2453,8 @@ LLEnvironment::DayInstance::DayInstance(EnvSelection_t env) :
|
|||
mInitialized(false),
|
||||
mType(TYPE_INVALID),
|
||||
mSkyTrack(1),
|
||||
mEnv(env)
|
||||
mEnv(env),
|
||||
mAnimateFlags(0)
|
||||
{ }
|
||||
|
||||
|
||||
|
|
@ -2466,6 +2472,7 @@ LLEnvironment::DayInstance::ptr_t LLEnvironment::DayInstance::clone() const
|
|||
environment->mInitialized = mInitialized;
|
||||
environment->mType = mType;
|
||||
environment->mSkyTrack = mSkyTrack;
|
||||
environment->mAnimateFlags = mAnimateFlags;
|
||||
|
||||
return environment;
|
||||
}
|
||||
|
|
@ -2490,6 +2497,8 @@ void LLEnvironment::DayInstance::setDay(const LLSettingsDay::ptr_t &pday, LLSett
|
|||
mType = TYPE_CYCLED;
|
||||
mInitialized = false;
|
||||
|
||||
mAnimateFlags = 0;
|
||||
|
||||
mDayCycle = pday;
|
||||
mDayLength = daylength;
|
||||
mDayOffset = dayoffset;
|
||||
|
|
@ -2600,36 +2609,42 @@ void LLEnvironment::DayInstance::animate()
|
|||
if (!mDayCycle)
|
||||
return;
|
||||
|
||||
LLSettingsDay::CycleTrack_t &wtrack = mDayCycle->getCycleTrack(0);
|
||||
if (!(mAnimateFlags & NO_ANIMATE_WATER))
|
||||
{
|
||||
LLSettingsDay::CycleTrack_t &wtrack = mDayCycle->getCycleTrack(0);
|
||||
|
||||
if (wtrack.empty())
|
||||
{
|
||||
mWater.reset();
|
||||
mBlenderWater.reset();
|
||||
}
|
||||
else
|
||||
{
|
||||
mWater = LLSettingsVOWater::buildDefaultWater();
|
||||
mBlenderWater = std::make_shared<LLTrackBlenderLoopingTime>(mWater, mDayCycle, 0,
|
||||
// mDayLength, mDayOffset, DEFAULT_UPDATE_THRESHOLD);
|
||||
mDayLength, mDayOffset + mDayOffsetOverride, DEFAULT_UPDATE_THRESHOLD); // KC
|
||||
if (wtrack.empty())
|
||||
{
|
||||
mWater.reset();
|
||||
mBlenderWater.reset();
|
||||
}
|
||||
else
|
||||
{
|
||||
mWater = LLSettingsVOWater::buildDefaultWater();
|
||||
mBlenderWater = std::make_shared<LLTrackBlenderLoopingTime>(mWater, mDayCycle, 0,
|
||||
// mDayLength, mDayOffset, DEFAULT_UPDATE_THRESHOLD);
|
||||
mDayLength, mDayOffset + mDayOffsetOverride, DEFAULT_UPDATE_THRESHOLD); // KC
|
||||
}
|
||||
}
|
||||
|
||||
// sky, initialize to track 1
|
||||
LLSettingsDay::CycleTrack_t &track = mDayCycle->getCycleTrack(1);
|
||||
if (!(mAnimateFlags & NO_ANIMATE_SKY))
|
||||
{
|
||||
// sky, initialize to track 1
|
||||
LLSettingsDay::CycleTrack_t &track = mDayCycle->getCycleTrack(1);
|
||||
|
||||
if (track.empty())
|
||||
{
|
||||
mSky.reset();
|
||||
mBlenderSky.reset();
|
||||
}
|
||||
else
|
||||
{
|
||||
mSky = LLSettingsVOSky::buildDefaultSky();
|
||||
mBlenderSky = std::make_shared<LLTrackBlenderLoopingTime>(mSky, mDayCycle, 1,
|
||||
// mDayLength, mDayOffset, DEFAULT_UPDATE_THRESHOLD);
|
||||
mDayLength, mDayOffset + mDayOffsetOverride, DEFAULT_UPDATE_THRESHOLD); // KC
|
||||
mBlenderSky->switchTrack(mSkyTrack, 0.0);
|
||||
if (track.empty())
|
||||
{
|
||||
mSky.reset();
|
||||
mBlenderSky.reset();
|
||||
}
|
||||
else
|
||||
{
|
||||
mSky = LLSettingsVOSky::buildDefaultSky();
|
||||
mBlenderSky = std::make_shared<LLTrackBlenderLoopingTime>(mSky, mDayCycle, 1,
|
||||
// mDayLength, mDayOffset, DEFAULT_UPDATE_THRESHOLD);
|
||||
mDayLength, mDayOffset + mDayOffsetOverride, DEFAULT_UPDATE_THRESHOLD); // KC
|
||||
mBlenderSky->switchTrack(mSkyTrack, 0.0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -235,8 +235,12 @@ public:
|
|||
TYPE_FIXED,
|
||||
TYPE_CYCLED
|
||||
};
|
||||
|
||||
typedef std::shared_ptr<DayInstance> ptr_t;
|
||||
|
||||
static const U32 NO_ANIMATE_SKY;
|
||||
static const U32 NO_ANIMATE_WATER;
|
||||
|
||||
DayInstance(EnvSelection_t env);
|
||||
virtual ~DayInstance() { };
|
||||
|
||||
|
|
@ -275,7 +279,12 @@ public:
|
|||
|
||||
LLSettingsBase::TrackPosition getProgress() const;
|
||||
|
||||
void setFlags(U32 flag) { mAnimateFlags |= flag; }
|
||||
void clearFlags(U32 flag) { mAnimateFlags &= ~flag; }
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
LLSettingsDay::ptr_t mDayCycle;
|
||||
LLSettingsSky::ptr_t mSky;
|
||||
LLSettingsWater::ptr_t mWater;
|
||||
|
|
@ -294,6 +303,8 @@ public:
|
|||
|
||||
EnvSelection_t mEnv;
|
||||
|
||||
U32 mAnimateFlags;
|
||||
|
||||
LLSettingsBase::TrackPosition secondsToKeyframe(LLSettingsDay::Seconds seconds);
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -776,7 +776,7 @@ void LLFloaterEditExtDayCycle::onAddFrame()
|
|||
setting = sky;
|
||||
mEditDay->setSkyAtKeyframe(sky, frame, mCurrentTrack);
|
||||
}
|
||||
|
||||
setDirtyFlag();
|
||||
addSliderFrame(frame, setting);
|
||||
updateTabs();
|
||||
}
|
||||
|
|
@ -788,6 +788,7 @@ void LLFloaterEditExtDayCycle::onRemoveFrame()
|
|||
{
|
||||
return;
|
||||
}
|
||||
setDirtyFlag();
|
||||
removeCurrentSliderFrame();
|
||||
updateTabs();
|
||||
}
|
||||
|
|
@ -964,6 +965,7 @@ void LLFloaterEditExtDayCycle::onFrameSliderCallback(const LLSD &data)
|
|||
// reselect new frame
|
||||
mFramesSlider->setCurSlider(it->first);
|
||||
mShiftCopyEnabled = false;
|
||||
setDirtyFlag();
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
@ -971,6 +973,7 @@ void LLFloaterEditExtDayCycle::onFrameSliderCallback(const LLSD &data)
|
|||
if (mEditDay->moveTrackKeyframe(mCurrentTrack, (*it).second.mFrame, sliderpos) && mCanMod)
|
||||
{
|
||||
(*it).second.mFrame = sliderpos;
|
||||
setDirtyFlag();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -1151,8 +1154,19 @@ void LLFloaterEditExtDayCycle::selectFrame(F32 frame, F32 slop_factor)
|
|||
while (iter != end_iter)
|
||||
{
|
||||
F32 keyframe = iter->second.mFrame;
|
||||
if (fabs(keyframe - frame) <= slop_factor)
|
||||
F32 frame_dif = fabs(keyframe - frame);
|
||||
if (frame_dif <= slop_factor)
|
||||
{
|
||||
keymap_t::iterator next_iter = std::next(iter);
|
||||
if ((frame_dif != 0) && (next_iter != end_iter))
|
||||
{
|
||||
if (fabs(next_iter->second.mFrame - frame) < frame_dif)
|
||||
{
|
||||
mFramesSlider->setCurSlider(next_iter->first);
|
||||
frame = next_iter->second.mFrame;
|
||||
break;
|
||||
}
|
||||
}
|
||||
mFramesSlider->setCurSlider(iter->first);
|
||||
frame = iter->second.mFrame;
|
||||
break;
|
||||
|
|
@ -1301,7 +1315,6 @@ void LLFloaterEditExtDayCycle::updateSlider()
|
|||
{
|
||||
// update positions
|
||||
mLastFrameSlider = mFramesSlider->getCurSlider();
|
||||
updateTabs();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
|
|
@ -0,0 +1,329 @@
|
|||
/**
|
||||
* @file llfloaterfixedenvironment.cpp
|
||||
* @brief Floaters to create and edit fixed settings for sky and water.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2011&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2011, Linden Research, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation;
|
||||
* version 2.1 of the License only.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#include "llviewerprecompiledheaders.h"
|
||||
|
||||
#include "llfloaterenvironmentadjust.h"
|
||||
|
||||
#include "llslider.h"
|
||||
#include "llsliderctrl.h"
|
||||
#include "llcolorswatch.h"
|
||||
#include "llvirtualtrackball.h"
|
||||
#include "llenvironment.h"
|
||||
|
||||
//=========================================================================
|
||||
namespace
|
||||
{
|
||||
const std::string FIELD_SKY_AMBIENT_LIGHT("ambient_light");
|
||||
const std::string FIELD_SKY_BLUE_HORIZON("blue_horizon");
|
||||
const std::string FIELD_SKY_BLUE_DENSITY("blue_density");
|
||||
const std::string FIELD_SKY_SUN_COLOR("sun_color");
|
||||
const std::string FIELD_SKY_CLOUD_COLOR("cloud_color");
|
||||
const std::string FIELD_SKY_HAZE_HORIZON("haze_horizon");
|
||||
const std::string FIELD_SKY_HAZE_DENSITY("haze_density");
|
||||
const std::string FIELD_SKY_CLOUD_COVERAGE("cloud_coverage");
|
||||
const std::string FIELD_SKY_CLOUD_SCALE("cloud_scale");
|
||||
const std::string FIELD_SKY_SCENE_GAMMA("scene_gamma");
|
||||
const std::string FIELD_SKY_SUN_ROTATION("sun_rotation");
|
||||
const std::string FIELD_SKY_SUN_SCALE("sun_scale");
|
||||
const std::string FIELD_SKY_GLOW_FOCUS("glow_focus");
|
||||
const std::string FIELD_SKY_GLOW_SIZE("glow_size");
|
||||
const std::string FIELD_SKY_STAR_BRIGHTNESS("star_brightness");
|
||||
const std::string FIELD_SKY_MOON_ROTATION("moon_rotation");
|
||||
|
||||
const F32 SLIDER_SCALE_SUN_AMBIENT(3.0f);
|
||||
const F32 SLIDER_SCALE_BLUE_HORIZON_DENSITY(2.0f);
|
||||
const F32 SLIDER_SCALE_GLOW_R(20.0f);
|
||||
const F32 SLIDER_SCALE_GLOW_B(-5.0f);
|
||||
//const F32 SLIDER_SCALE_DENSITY_MULTIPLIER(0.001f);
|
||||
|
||||
const S32 FLOATER_ENVIRONMENT_UPDATE(-2);
|
||||
}
|
||||
|
||||
//=========================================================================
|
||||
LLFloaterEnvironmentAdjust::LLFloaterEnvironmentAdjust(const LLSD &key):
|
||||
LLFloater(key)
|
||||
{}
|
||||
|
||||
LLFloaterEnvironmentAdjust::~LLFloaterEnvironmentAdjust()
|
||||
{}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
BOOL LLFloaterEnvironmentAdjust::postBuild()
|
||||
{
|
||||
getChild<LLUICtrl>(FIELD_SKY_AMBIENT_LIGHT)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onAmbientLightChanged(); });
|
||||
getChild<LLUICtrl>(FIELD_SKY_BLUE_HORIZON)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onBlueHorizonChanged(); });
|
||||
getChild<LLUICtrl>(FIELD_SKY_BLUE_DENSITY)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onBlueDensityChanged(); });
|
||||
getChild<LLUICtrl>(FIELD_SKY_HAZE_HORIZON)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onHazeHorizonChanged(); });
|
||||
getChild<LLUICtrl>(FIELD_SKY_HAZE_DENSITY)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onHazeDensityChanged(); });
|
||||
getChild<LLUICtrl>(FIELD_SKY_SCENE_GAMMA)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onSceneGammaChanged(); });
|
||||
|
||||
getChild<LLUICtrl>(FIELD_SKY_CLOUD_COLOR)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onCloudColorChanged(); });
|
||||
getChild<LLUICtrl>(FIELD_SKY_CLOUD_COVERAGE)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onCloudCoverageChanged(); });
|
||||
getChild<LLUICtrl>(FIELD_SKY_CLOUD_SCALE)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onCloudScaleChanged(); });
|
||||
getChild<LLUICtrl>(FIELD_SKY_SUN_COLOR)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onSunColorChanged(); });
|
||||
|
||||
getChild<LLUICtrl>(FIELD_SKY_GLOW_FOCUS)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onGlowChanged(); });
|
||||
getChild<LLUICtrl>(FIELD_SKY_GLOW_SIZE)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onGlowChanged(); });
|
||||
getChild<LLUICtrl>(FIELD_SKY_STAR_BRIGHTNESS)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onStarBrightnessChanged(); });
|
||||
getChild<LLUICtrl>(FIELD_SKY_SUN_ROTATION)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onSunRotationChanged(); });
|
||||
getChild<LLUICtrl>(FIELD_SKY_SUN_SCALE)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onSunScaleChanged(); });
|
||||
|
||||
getChild<LLUICtrl>(FIELD_SKY_MOON_ROTATION)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onMoonRotationChanged(); });
|
||||
|
||||
refresh();
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void LLFloaterEnvironmentAdjust::onOpen(const LLSD& key)
|
||||
{
|
||||
captureCurrentEnvironment();
|
||||
|
||||
mEventConnection = LLEnvironment::instance().setEnvironmentChanged([this](LLEnvironment::EnvSelection_t env, S32 version){ onEnvironmentUpdated(env, version); });
|
||||
|
||||
LLFloater::onOpen(key);
|
||||
refresh();
|
||||
}
|
||||
|
||||
void LLFloaterEnvironmentAdjust::onClose(bool app_quitting)
|
||||
{
|
||||
mEventConnection.disconnect();
|
||||
mLiveSky.reset();
|
||||
LLFloater::onClose(app_quitting);
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
void LLFloaterEnvironmentAdjust::refresh()
|
||||
{
|
||||
if (!mLiveSky)
|
||||
{
|
||||
setAllChildrenEnabled(FALSE);
|
||||
return;
|
||||
}
|
||||
|
||||
setEnabled(TRUE);
|
||||
setAllChildrenEnabled(TRUE);
|
||||
|
||||
getChild<LLColorSwatchCtrl>(FIELD_SKY_AMBIENT_LIGHT)->set(mLiveSky->getAmbientColor() / SLIDER_SCALE_SUN_AMBIENT);
|
||||
getChild<LLColorSwatchCtrl>(FIELD_SKY_BLUE_HORIZON)->set(mLiveSky->getBlueHorizon() / SLIDER_SCALE_BLUE_HORIZON_DENSITY);
|
||||
getChild<LLColorSwatchCtrl>(FIELD_SKY_BLUE_DENSITY)->set(mLiveSky->getBlueDensity() / SLIDER_SCALE_BLUE_HORIZON_DENSITY);
|
||||
getChild<LLUICtrl>(FIELD_SKY_HAZE_HORIZON)->setValue(mLiveSky->getHazeHorizon());
|
||||
getChild<LLUICtrl>(FIELD_SKY_HAZE_DENSITY)->setValue(mLiveSky->getHazeDensity());
|
||||
getChild<LLUICtrl>(FIELD_SKY_SCENE_GAMMA)->setValue(mLiveSky->getGamma());
|
||||
getChild<LLColorSwatchCtrl>(FIELD_SKY_CLOUD_COLOR)->set(mLiveSky->getCloudColor());
|
||||
getChild<LLUICtrl>(FIELD_SKY_CLOUD_COVERAGE)->setValue(mLiveSky->getCloudShadow());
|
||||
getChild<LLUICtrl>(FIELD_SKY_CLOUD_SCALE)->setValue(mLiveSky->getCloudScale());
|
||||
getChild<LLColorSwatchCtrl>(FIELD_SKY_SUN_COLOR)->set(mLiveSky->getSunlightColor() / SLIDER_SCALE_SUN_AMBIENT);
|
||||
|
||||
LLColor3 glow(mLiveSky->getGlow());
|
||||
|
||||
// takes 40 - 0.2 range -> 0 - 1.99 UI range
|
||||
getChild<LLUICtrl>(FIELD_SKY_GLOW_SIZE)->setValue(2.0 - (glow.mV[0] / SLIDER_SCALE_GLOW_R));
|
||||
getChild<LLUICtrl>(FIELD_SKY_GLOW_FOCUS)->setValue(glow.mV[2] / SLIDER_SCALE_GLOW_B);
|
||||
getChild<LLUICtrl>(FIELD_SKY_STAR_BRIGHTNESS)->setValue(mLiveSky->getStarBrightness());
|
||||
getChild<LLVirtualTrackball>(FIELD_SKY_SUN_ROTATION)->setRotation(mLiveSky->getSunRotation());
|
||||
getChild<LLUICtrl>(FIELD_SKY_SUN_SCALE)->setValue(mLiveSky->getSunScale());
|
||||
getChild<LLVirtualTrackball>(FIELD_SKY_MOON_ROTATION)->setRotation(mLiveSky->getMoonRotation());
|
||||
|
||||
}
|
||||
|
||||
|
||||
void LLFloaterEnvironmentAdjust::captureCurrentEnvironment()
|
||||
{
|
||||
LLEnvironment &environment(LLEnvironment::instance());
|
||||
bool updatelocal(false);
|
||||
|
||||
if (environment.hasEnvironment(LLEnvironment::ENV_LOCAL))
|
||||
{
|
||||
if (environment.getEnvironmentDay(LLEnvironment::ENV_LOCAL))
|
||||
{ // We have a full day cycle in the local environment. Freeze the sky
|
||||
mLiveSky = environment.getEnvironmentFixedSky(LLEnvironment::ENV_LOCAL)->buildClone();
|
||||
updatelocal = true;
|
||||
}
|
||||
else
|
||||
{ // otherwise we can just use the sky.
|
||||
mLiveSky = environment.getEnvironmentFixedSky(LLEnvironment::ENV_LOCAL);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
mLiveSky = environment.getEnvironmentFixedSky(LLEnvironment::ENV_PARCEL, true)->buildClone();
|
||||
updatelocal = true;
|
||||
}
|
||||
|
||||
if (updatelocal)
|
||||
{
|
||||
environment.setEnvironment(LLEnvironment::ENV_LOCAL, mLiveSky, FLOATER_ENVIRONMENT_UPDATE);
|
||||
}
|
||||
environment.setSelectedEnvironment(LLEnvironment::ENV_LOCAL);
|
||||
environment.updateEnvironment(LLEnvironment::TRANSITION_INSTANT);
|
||||
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
void LLFloaterEnvironmentAdjust::onAmbientLightChanged()
|
||||
{
|
||||
if (!mLiveSky)
|
||||
return;
|
||||
mLiveSky->setAmbientColor(LLColor3(getChild<LLColorSwatchCtrl>(FIELD_SKY_AMBIENT_LIGHT)->get() * SLIDER_SCALE_SUN_AMBIENT));
|
||||
mLiveSky->update();
|
||||
}
|
||||
|
||||
void LLFloaterEnvironmentAdjust::onBlueHorizonChanged()
|
||||
{
|
||||
if (!mLiveSky)
|
||||
return;
|
||||
mLiveSky->setBlueHorizon(LLColor3(getChild<LLColorSwatchCtrl>(FIELD_SKY_BLUE_HORIZON)->get() * SLIDER_SCALE_BLUE_HORIZON_DENSITY));
|
||||
mLiveSky->update();
|
||||
}
|
||||
|
||||
void LLFloaterEnvironmentAdjust::onBlueDensityChanged()
|
||||
{
|
||||
if (!mLiveSky)
|
||||
return;
|
||||
mLiveSky->setBlueDensity(LLColor3(getChild<LLColorSwatchCtrl>(FIELD_SKY_BLUE_DENSITY)->get() * SLIDER_SCALE_BLUE_HORIZON_DENSITY));
|
||||
mLiveSky->update();
|
||||
}
|
||||
|
||||
void LLFloaterEnvironmentAdjust::onHazeHorizonChanged()
|
||||
{
|
||||
if (!mLiveSky)
|
||||
return;
|
||||
mLiveSky->setHazeHorizon(getChild<LLUICtrl>(FIELD_SKY_HAZE_HORIZON)->getValue().asReal());
|
||||
mLiveSky->update();
|
||||
}
|
||||
|
||||
void LLFloaterEnvironmentAdjust::onHazeDensityChanged()
|
||||
{
|
||||
if (!mLiveSky)
|
||||
return;
|
||||
mLiveSky->setHazeDensity(getChild<LLUICtrl>(FIELD_SKY_HAZE_DENSITY)->getValue().asReal());
|
||||
mLiveSky->update();
|
||||
}
|
||||
|
||||
void LLFloaterEnvironmentAdjust::onSceneGammaChanged()
|
||||
{
|
||||
if (!mLiveSky)
|
||||
return;
|
||||
mLiveSky->setGamma(getChild<LLUICtrl>(FIELD_SKY_SCENE_GAMMA)->getValue().asReal());
|
||||
mLiveSky->update();
|
||||
}
|
||||
|
||||
void LLFloaterEnvironmentAdjust::onCloudColorChanged()
|
||||
{
|
||||
if (!mLiveSky)
|
||||
return;
|
||||
mLiveSky->setCloudColor(LLColor3(getChild<LLColorSwatchCtrl>(FIELD_SKY_CLOUD_COLOR)->get()));
|
||||
mLiveSky->update();
|
||||
}
|
||||
|
||||
void LLFloaterEnvironmentAdjust::onCloudCoverageChanged()
|
||||
{
|
||||
if (!mLiveSky)
|
||||
return;
|
||||
mLiveSky->setCloudShadow(getChild<LLUICtrl>(FIELD_SKY_CLOUD_COVERAGE)->getValue().asReal());
|
||||
mLiveSky->update();
|
||||
}
|
||||
|
||||
void LLFloaterEnvironmentAdjust::onCloudScaleChanged()
|
||||
{
|
||||
if (!mLiveSky)
|
||||
return;
|
||||
mLiveSky->setCloudScale(getChild<LLUICtrl>(FIELD_SKY_CLOUD_SCALE)->getValue().asReal());
|
||||
mLiveSky->update();
|
||||
}
|
||||
|
||||
void LLFloaterEnvironmentAdjust::onGlowChanged()
|
||||
{
|
||||
if (!mLiveSky)
|
||||
return;
|
||||
LLColor3 glow(getChild<LLUICtrl>(FIELD_SKY_GLOW_SIZE)->getValue().asReal(), 0.0f, getChild<LLUICtrl>(FIELD_SKY_GLOW_FOCUS)->getValue().asReal());
|
||||
|
||||
// takes 0 - 1.99 UI range -> 40 -> 0.2 range
|
||||
glow.mV[0] = (2.0f - glow.mV[0]) * SLIDER_SCALE_GLOW_R;
|
||||
glow.mV[2] *= SLIDER_SCALE_GLOW_B;
|
||||
|
||||
mLiveSky->setGlow(glow);
|
||||
mLiveSky->update();
|
||||
}
|
||||
|
||||
void LLFloaterEnvironmentAdjust::onStarBrightnessChanged()
|
||||
{
|
||||
if (!mLiveSky)
|
||||
return;
|
||||
mLiveSky->setStarBrightness(getChild<LLUICtrl>(FIELD_SKY_STAR_BRIGHTNESS)->getValue().asReal());
|
||||
mLiveSky->update();
|
||||
}
|
||||
|
||||
void LLFloaterEnvironmentAdjust::onSunRotationChanged()
|
||||
{
|
||||
if (!mLiveSky)
|
||||
return;
|
||||
mLiveSky->setSunRotation(getChild<LLVirtualTrackball>(FIELD_SKY_SUN_ROTATION)->getRotation());
|
||||
mLiveSky->update();
|
||||
}
|
||||
|
||||
void LLFloaterEnvironmentAdjust::onSunScaleChanged()
|
||||
{
|
||||
if (!mLiveSky)
|
||||
return;
|
||||
mLiveSky->setSunScale((getChild<LLUICtrl>(FIELD_SKY_SUN_SCALE)->getValue().asReal()));
|
||||
mLiveSky->update();
|
||||
}
|
||||
|
||||
void LLFloaterEnvironmentAdjust::onMoonRotationChanged()
|
||||
{
|
||||
if (!mLiveSky)
|
||||
return;
|
||||
mLiveSky->setMoonRotation(getChild<LLVirtualTrackball>(FIELD_SKY_MOON_ROTATION)->getRotation());
|
||||
mLiveSky->update();
|
||||
}
|
||||
|
||||
void LLFloaterEnvironmentAdjust::onSunColorChanged()
|
||||
{
|
||||
if (!mLiveSky)
|
||||
return;
|
||||
LLColor3 color(getChild<LLColorSwatchCtrl>(FIELD_SKY_SUN_COLOR)->get());
|
||||
|
||||
color *= SLIDER_SCALE_SUN_AMBIENT;
|
||||
|
||||
mLiveSky->setSunlightColor(color);
|
||||
mLiveSky->update();
|
||||
}
|
||||
|
||||
|
||||
void LLFloaterEnvironmentAdjust::onEnvironmentUpdated(LLEnvironment::EnvSelection_t env, S32 version)
|
||||
{
|
||||
if (env == LLEnvironment::ENV_LOCAL)
|
||||
{ // a new local environment has been applied
|
||||
if (version != FLOATER_ENVIRONMENT_UPDATE)
|
||||
{ // not by this floater
|
||||
captureCurrentEnvironment();
|
||||
refresh();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,86 @@
|
|||
/**
|
||||
* @file llfloaterenvironmentadjust.h
|
||||
* @brief Floaters to create and edit fixed settings for sky and water.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2011&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2011, Linden Research, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation;
|
||||
* version 2.1 of the License only.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#ifndef LL_FLOATERENVIRONMENTADJUST_H
|
||||
#define LL_FLOATERENVIRONMENTADJUST_H
|
||||
|
||||
#include "llfloater.h"
|
||||
#include "llsettingsbase.h"
|
||||
#include "llsettingssky.h"
|
||||
#include "llenvironment.h"
|
||||
|
||||
#include "boost/signals2.hpp"
|
||||
|
||||
class LLButton;
|
||||
class LLLineEditor;
|
||||
|
||||
/**
|
||||
* Floater container for taking a snapshot of the current environment and making minor adjustments.
|
||||
*/
|
||||
class LLFloaterEnvironmentAdjust : public LLFloater
|
||||
{
|
||||
LOG_CLASS(LLFloaterEnvironmentAdjust);
|
||||
|
||||
public:
|
||||
LLFloaterEnvironmentAdjust(const LLSD &key);
|
||||
virtual ~LLFloaterEnvironmentAdjust();
|
||||
|
||||
|
||||
virtual BOOL postBuild() override;
|
||||
virtual void onOpen(const LLSD& key) override;
|
||||
virtual void onClose(bool app_quitting) override;
|
||||
|
||||
virtual void refresh() override;
|
||||
|
||||
private:
|
||||
void captureCurrentEnvironment();
|
||||
|
||||
void onAmbientLightChanged();
|
||||
void onBlueHorizonChanged();
|
||||
void onBlueDensityChanged();
|
||||
void onHazeHorizonChanged();
|
||||
void onHazeDensityChanged();
|
||||
void onSceneGammaChanged();
|
||||
|
||||
void onCloudColorChanged();
|
||||
void onCloudCoverageChanged();
|
||||
void onCloudScaleChanged();
|
||||
void onSunColorChanged();
|
||||
|
||||
void onGlowChanged();
|
||||
void onStarBrightnessChanged();
|
||||
void onSunRotationChanged();
|
||||
void onSunScaleChanged();
|
||||
|
||||
void onMoonRotationChanged();
|
||||
|
||||
void onEnvironmentUpdated(LLEnvironment::EnvSelection_t env, S32 version);
|
||||
|
||||
LLSettingsSky::ptr_t mLiveSky;
|
||||
LLEnvironment::connection_t mEventConnection;
|
||||
};
|
||||
|
||||
#endif // LL_FLOATERFIXEDENVIRONMENT_H
|
||||
|
|
@ -58,7 +58,6 @@ namespace
|
|||
const std::string CHECK_SKIES("chk_skies");
|
||||
const std::string CHECK_WATER("chk_water");
|
||||
const std::string PANEL_SETTINGS("pnl_settings");
|
||||
const std::string CHECK_SHOWFOLDERS("chk_showfolders");
|
||||
const std::string BUTTON_NEWSETTINGS("btn_gear");
|
||||
const std::string BUTTON_GEAR("btn_newsettings");
|
||||
const std::string BUTTON_DELETE("btn_del");
|
||||
|
|
@ -152,7 +151,6 @@ public:
|
|||
LLFloaterMyEnvironment::LLFloaterMyEnvironment(const LLSD& key) :
|
||||
LLFloater(key),
|
||||
mInventoryList(nullptr),
|
||||
mShowFolders(LLInventoryFilter::SHOW_NON_EMPTY_FOLDERS),
|
||||
mTypeFilter((0x01 << static_cast<U64>(LLSettingsType::ST_DAYCYCLE)) | (0x01 << static_cast<U64>(LLSettingsType::ST_SKY)) | (0x01 << static_cast<U64>(LLSettingsType::ST_WATER))),
|
||||
mSelectedAsset()
|
||||
{
|
||||
|
|
@ -188,14 +186,12 @@ BOOL LLFloaterMyEnvironment::postBuild()
|
|||
mInventoryList->setFilterTypes(filter_types);
|
||||
|
||||
mInventoryList->setSelectCallback([this](const std::deque<LLFolderViewItem*>&, BOOL) { onSelectionChange(); });
|
||||
mInventoryList->setShowFolderState(mShowFolders);
|
||||
mInventoryList->setFilterSettingsTypes(mTypeFilter);
|
||||
}
|
||||
|
||||
childSetCommitCallback(CHECK_DAYS, [this](LLUICtrl*, void*) { onFilterCheckChange(); }, nullptr);
|
||||
childSetCommitCallback(CHECK_SKIES, [this](LLUICtrl*, void*) { onFilterCheckChange(); }, nullptr);
|
||||
childSetCommitCallback(CHECK_WATER, [this](LLUICtrl*, void*) { onFilterCheckChange(); }, nullptr);
|
||||
childSetCommitCallback(CHECK_SHOWFOLDERS, [this](LLUICtrl*, void*) { onShowFoldersChange(); }, nullptr);
|
||||
|
||||
childSetCommitCallback(BUTTON_DELETE, [this](LLUICtrl *, void*) { onDeleteSelected(); }, nullptr);
|
||||
|
||||
|
|
@ -204,8 +200,6 @@ BOOL LLFloaterMyEnvironment::postBuild()
|
|||
|
||||
void LLFloaterMyEnvironment::refresh()
|
||||
{
|
||||
getChild<LLCheckBoxCtrl>(CHECK_SHOWFOLDERS)->setValue(LLSD::Boolean(mShowFolders == LLInventoryFilter::SHOW_ALL_FOLDERS));
|
||||
|
||||
getChild<LLCheckBoxCtrl>(CHECK_DAYS)->setValue(LLSD::Boolean(mTypeFilter & (0x01 << static_cast<U64>(LLSettingsType::ST_DAYCYCLE))));
|
||||
getChild<LLCheckBoxCtrl>(CHECK_SKIES)->setValue(LLSD::Boolean(mTypeFilter & (0x01 << static_cast<U64>(LLSettingsType::ST_SKY))));
|
||||
getChild<LLCheckBoxCtrl>(CHECK_WATER)->setValue(LLSD::Boolean(mTypeFilter & (0x01 << static_cast<U64>(LLSettingsType::ST_WATER))));
|
||||
|
|
@ -238,16 +232,6 @@ void LLFloaterMyEnvironment::onOpen(const LLSD& key)
|
|||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
void LLFloaterMyEnvironment::onShowFoldersChange()
|
||||
{
|
||||
bool show_check (getChild<LLCheckBoxCtrl>(CHECK_SHOWFOLDERS)->getValue().asBoolean());
|
||||
|
||||
mShowFolders = (show_check) ? LLInventoryFilter::SHOW_ALL_FOLDERS : LLInventoryFilter::SHOW_NON_EMPTY_FOLDERS;
|
||||
|
||||
if (mInventoryList)
|
||||
mInventoryList->setShowFolderState(mShowFolders);
|
||||
}
|
||||
|
||||
void LLFloaterMyEnvironment::onFilterCheckChange()
|
||||
{
|
||||
mTypeFilter = 0x0;
|
||||
|
|
|
|||
|
|
@ -61,10 +61,8 @@ public:
|
|||
private:
|
||||
LLInventoryPanel * mInventoryList;
|
||||
U64 mTypeFilter;
|
||||
LLInventoryFilter::EFolderShow mShowFolders;
|
||||
LLUUID mSelectedAsset;
|
||||
|
||||
void onShowFoldersChange();
|
||||
void onFilterCheckChange();
|
||||
void onSelectionChange();
|
||||
void onDeleteSelected();
|
||||
|
|
|
|||
|
|
@ -3485,13 +3485,14 @@ void LLPanelRegionEnvironment::onChkAllowOverride(bool value)
|
|||
mAllowOverrideRestore = mAllowOverride;
|
||||
mAllowOverride = value;
|
||||
|
||||
LLNotification::Params params("ChangeLindenEstate");
|
||||
params.functor.function([this](const LLSD& notification, const LLSD& response) { confirmUpdateEstateEnvironment(notification, response); });
|
||||
|
||||
std::string notification("EstateParcelEnvironmentOverride");
|
||||
if (LLPanelEstateInfo::isLindenEstate())
|
||||
notification = "ChangeLindenEstate";
|
||||
|
||||
LLNotification::Params params(notification);
|
||||
params.functor.function([this](const LLSD& notification, const LLSD& response) { confirmUpdateEstateEnvironment(notification, response); });
|
||||
|
||||
if (!value || LLPanelEstateInfo::isLindenEstate())
|
||||
{ // warn if turning off or a Linden Estate
|
||||
LLNotifications::instance().add(params);
|
||||
|
|
|
|||
|
|
@ -568,9 +568,11 @@ void LLSettingsVOSky::convertAtmosphericsToLegacy(LLSD& legacy, LLSD& settings)
|
|||
|
||||
F32 density_multiplier = legacyhaze[SETTING_DENSITY_MULTIPLIER].asReal();
|
||||
density_multiplier = (density_multiplier < 0.0001f) ? 0.0001f : density_multiplier;
|
||||
density_multiplier *= 0.9f / 2.0f; // take 0 - 2.0 range to 0 - 0.9 range
|
||||
legacy[SETTING_DENSITY_MULTIPLIER] = LLSDArray(density_multiplier)(0.0f)(0.0f)(1.0f);
|
||||
|
||||
F32 distance_multiplier = legacyhaze[SETTING_DISTANCE_MULTIPLIER].asReal();
|
||||
distance_multiplier *= 0.1f; // take 0 - 1000 range to 0 - 100 range
|
||||
legacy[SETTING_DISTANCE_MULTIPLIER] = LLSDArray(distance_multiplier)(0.0f)(0.0f)(1.0f);
|
||||
|
||||
legacy[SETTING_HAZE_DENSITY] = LLSDArray(legacyhaze[SETTING_HAZE_DENSITY])(0.0f)(0.0f)(1.0f);
|
||||
|
|
@ -597,7 +599,7 @@ LLSD LLSettingsVOSky::convertToLegacy(const LLSettingsSky::ptr_t &psky, bool isA
|
|||
legacy[SETTING_GLOW] = ensure_array_4(settings[SETTING_GLOW], 1.0);
|
||||
legacy[SETTING_LIGHT_NORMAL] = ensure_array_4(psky->getLightDirection().getValue(), 0.0f);
|
||||
legacy[SETTING_MAX_Y] = LLSDArray(settings[SETTING_MAX_Y])(0.0f)(0.0f)(1.0f);
|
||||
legacy[SETTING_STAR_BRIGHTNESS] = settings[SETTING_STAR_BRIGHTNESS];
|
||||
legacy[SETTING_STAR_BRIGHTNESS] = settings[SETTING_STAR_BRIGHTNESS].asReal() / 250.0f; // convert from 0-500 -> 0-2 ala pre-FS-compat changes
|
||||
legacy[SETTING_SUNLIGHT_COLOR] = ensure_array_4(settings[SETTING_SUNLIGHT_COLOR], 1.0f);
|
||||
|
||||
LLVector3 dir = psky->getLightDirection();
|
||||
|
|
@ -683,6 +685,28 @@ void LLSettingsVOSky::applySpecial(void *ptarget)
|
|||
LLVector4 vect_c_p_d1(mSettings[SETTING_CLOUD_POS_DENSITY1]);
|
||||
vect_c_p_d1 += LLVector4(LLEnvironment::instance().getCloudScrollDelta());
|
||||
shader->uniform4fv(LLShaderMgr::CLOUD_POS_DENSITY1, 1, vect_c_p_d1.mV);
|
||||
|
||||
LLSettingsSky::ptr_t psky = LLEnvironment::instance().getCurrentSky();
|
||||
|
||||
LLColor4 sunDiffuse = psky->getSunDiffuse();
|
||||
LLColor4 moonDiffuse = psky->getMoonDiffuse();
|
||||
|
||||
F32 max_color = llmax(sunDiffuse.mV[0], sunDiffuse.mV[1], sunDiffuse.mV[2]);
|
||||
if (max_color > 1.f)
|
||||
{
|
||||
sunDiffuse *= 1.f/max_color;
|
||||
}
|
||||
sunDiffuse.clamp();
|
||||
|
||||
max_color = llmax(moonDiffuse.mV[0], moonDiffuse.mV[1], moonDiffuse.mV[2]);
|
||||
if (max_color > 1.f)
|
||||
{
|
||||
moonDiffuse *= 1.f/max_color;
|
||||
}
|
||||
moonDiffuse.clamp();
|
||||
|
||||
shader->uniform4fv(LLShaderMgr::SUNLIGHT_COLOR, 1, sunDiffuse.mV);
|
||||
shader->uniform4fv(LLShaderMgr::MOONLIGHT_COLOR, 1, moonDiffuse.mV);
|
||||
}
|
||||
|
||||
F32 g = getGamma();
|
||||
|
|
@ -719,7 +743,7 @@ LLSettingsSky::parammapping_t LLSettingsVOSky::getParameterMap() const
|
|||
param_map[SETTING_CLOUD_VARIANCE] = DefaultParam(LLShaderMgr::CLOUD_VARIANCE, sky_defaults[SETTING_CLOUD_VARIANCE]);
|
||||
param_map[SETTING_GLOW] = DefaultParam(LLShaderMgr::GLOW, sky_defaults[SETTING_GLOW]);
|
||||
param_map[SETTING_MAX_Y] = DefaultParam(LLShaderMgr::MAX_Y, sky_defaults[SETTING_MAX_Y]);
|
||||
param_map[SETTING_SUNLIGHT_COLOR] = DefaultParam(LLShaderMgr::SUNLIGHT_COLOR, sky_defaults[SETTING_SUNLIGHT_COLOR]);
|
||||
//param_map[SETTING_SUNLIGHT_COLOR] = DefaultParam(LLShaderMgr::SUNLIGHT_COLOR, sky_defaults[SETTING_SUNLIGHT_COLOR]);
|
||||
param_map[SETTING_MOON_BRIGHTNESS] = DefaultParam(LLShaderMgr::MOON_BRIGHTNESS, sky_defaults[SETTING_MOON_BRIGHTNESS]);
|
||||
param_map[SETTING_SKY_MOISTURE_LEVEL] = DefaultParam(LLShaderMgr::MOISTURE_LEVEL, sky_defaults[SETTING_SKY_MOISTURE_LEVEL]);
|
||||
param_map[SETTING_SKY_DROPLET_RADIUS] = DefaultParam(LLShaderMgr::DROPLET_RADIUS, sky_defaults[SETTING_SKY_DROPLET_RADIUS]);
|
||||
|
|
|
|||
|
|
@ -58,6 +58,7 @@
|
|||
#include "llfloaterdeleteprefpreset.h"
|
||||
#include "llfloaterdestinations.h"
|
||||
#include "llfloatereditextdaycycle.h"
|
||||
#include "llfloaterenvironmentadjust.h"
|
||||
#include "llfloaterexperienceprofile.h"
|
||||
#include "llfloaterexperiences.h"
|
||||
#include "llfloaterexperiencepicker.h"
|
||||
|
|
@ -273,7 +274,8 @@ void LLViewerFloaterReg::registerFloaters()
|
|||
|
||||
LLFloaterReg::add("env_fixed_environmentent_water", "floater_fixedenvironment.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterFixedEnvironmentWater>);
|
||||
LLFloaterReg::add("env_fixed_environmentent_sky", "floater_fixedenvironment.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterFixedEnvironmentSky>);
|
||||
//LLFloaterReg::add("env_fixed_environmentent", "floater_fixedenvironment.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterFixedEnvironment>);
|
||||
|
||||
LLFloaterReg::add("env_adjust_snapshot", "floater_adjust_environment.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterEnvironmentAdjust>);
|
||||
|
||||
LLFloaterReg::add("env_edit_extdaycycle", "floater_edit_ext_day_cycle.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterEditExtDayCycle>);
|
||||
LLFloaterReg::add("my_environments", "floater_my_environments.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterMyEnvironment>);
|
||||
|
|
|
|||
|
|
@ -10784,6 +10784,10 @@ class LLWorldEnvSettings : public view_listener_t
|
|||
else
|
||||
LLEnvironment::instance().pauseCloudScroll();
|
||||
}
|
||||
else if (event_name == "adjust_tool")
|
||||
{
|
||||
LLFloaterReg::showInstance("env_adjust_snapshot");
|
||||
}
|
||||
else if (event_name == "my_environs")
|
||||
{
|
||||
LLFloaterReg::showInstance("my_environments");
|
||||
|
|
|
|||
|
|
@ -425,7 +425,8 @@ void LLViewerShaderMgr::setShaders()
|
|||
LLShaderMgr::instance()->mDefinitions["NUM_TEX_UNITS"] = llformat("%d", gGLManager.mNumTextureImageUnits);
|
||||
|
||||
// Make sure the compiled shader map is cleared before we recompile shaders.
|
||||
mShaderObjects.clear();
|
||||
mVertexShaderObjects.clear();
|
||||
mFragmentShaderObjects.clear();
|
||||
|
||||
initAttribsAndUniforms();
|
||||
gPipeline.releaseGLBuffers();
|
||||
|
|
@ -941,6 +942,7 @@ BOOL LLViewerShaderMgr::loadBasicShaders()
|
|||
shaders.push_back( make_pair( "lighting/lightFuncSpecularV.glsl", mShaderLevel[SHADER_LIGHTING] ) );
|
||||
shaders.push_back( make_pair( "lighting/sumLightsSpecularV.glsl", sum_lights_class ) );
|
||||
shaders.push_back( make_pair( "lighting/lightSpecularV.glsl", mShaderLevel[SHADER_LIGHTING] ) );
|
||||
shaders.push_back( make_pair( "windlight/atmosphericsFuncs.glsl", mShaderLevel[SHADER_WINDLIGHT] ) );
|
||||
shaders.push_back( make_pair( "windlight/atmosphericsV.glsl", mShaderLevel[SHADER_WINDLIGHT] ) );
|
||||
shaders.push_back( make_pair( "avatar/avatarSkinV.glsl", 1 ) );
|
||||
shaders.push_back( make_pair( "avatar/objectSkinV.glsl", 1 ) );
|
||||
|
|
@ -981,6 +983,7 @@ BOOL LLViewerShaderMgr::loadBasicShaders()
|
|||
index_channels.push_back(-1); shaders.push_back( make_pair( "windlight/atmosphericsVarsWaterF.glsl", mShaderLevel[SHADER_WINDLIGHT] ) );
|
||||
index_channels.push_back(-1); shaders.push_back( make_pair( "windlight/atmosphericsHelpersF.glsl", mShaderLevel[SHADER_WINDLIGHT] ) );
|
||||
index_channels.push_back(-1); shaders.push_back( make_pair( "windlight/gammaF.glsl", mShaderLevel[SHADER_WINDLIGHT]) );
|
||||
index_channels.push_back(-1); shaders.push_back( make_pair( "windlight/atmosphericsFuncs.glsl", mShaderLevel[SHADER_WINDLIGHT] ) );
|
||||
index_channels.push_back(-1); shaders.push_back( make_pair( "windlight/atmosphericsF.glsl", mShaderLevel[SHADER_WINDLIGHT] ) );
|
||||
index_channels.push_back(-1); shaders.push_back( make_pair( "windlight/transportF.glsl", mShaderLevel[SHADER_WINDLIGHT] ) );
|
||||
index_channels.push_back(-1); shaders.push_back( make_pair( "environment/waterFogF.glsl", mShaderLevel[SHADER_WATER] ) );
|
||||
|
|
@ -1266,9 +1269,13 @@ BOOL LLViewerShaderMgr::loadShadersDeferred()
|
|||
gDeferredSoftenWaterProgram.unload();
|
||||
gDeferredShadowProgram.unload();
|
||||
gDeferredShadowCubeProgram.unload();
|
||||
gDeferredShadowAlphaMaskProgram.unload();
|
||||
gDeferredShadowAlphaMaskProgram.unload();
|
||||
gDeferredAvatarShadowProgram.unload();
|
||||
gDeferredAvatarAlphaShadowProgram.unload();
|
||||
gDeferredAvatarAlphaMaskShadowProgram.unload();
|
||||
gDeferredAttachmentShadowProgram.unload();
|
||||
gDeferredAttachmentAlphaShadowProgram.unload();
|
||||
gDeferredAttachmentAlphaMaskShadowProgram.unload();
|
||||
gDeferredAvatarProgram.unload();
|
||||
gDeferredAvatarAlphaProgram.unload();
|
||||
gDeferredAlphaProgram.unload();
|
||||
|
|
@ -2123,7 +2130,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred()
|
|||
gDeferredSoftenProgram.mFeatures.hasTransport = true;
|
||||
gDeferredSoftenProgram.mFeatures.hasGamma = true;
|
||||
gDeferredSoftenProgram.mFeatures.isDeferred = true;
|
||||
gDeferredSoftenProgram.mFeatures.hasShadows = true;
|
||||
gDeferredSoftenProgram.mFeatures.hasShadows = use_sun_shadow;
|
||||
|
||||
gDeferredSoftenProgram.mShaderFiles.push_back(make_pair("deferred/softenLightV.glsl", GL_VERTEX_SHADER_ARB));
|
||||
gDeferredSoftenProgram.mShaderFiles.push_back(make_pair("deferred/softenLightF.glsl", GL_FRAGMENT_SHADER_ARB));
|
||||
|
|
@ -2156,7 +2163,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred()
|
|||
gDeferredSoftenWaterProgram.mFeatures.hasTransport = true;
|
||||
gDeferredSoftenWaterProgram.mFeatures.hasGamma = true;
|
||||
gDeferredSoftenWaterProgram.mFeatures.isDeferred = true;
|
||||
gDeferredSoftenWaterProgram.mFeatures.hasShadows = true;
|
||||
gDeferredSoftenWaterProgram.mFeatures.hasShadows = use_sun_shadow;
|
||||
|
||||
if (gSavedSettings.getBOOL("RenderDeferredSSAO"))
|
||||
{ //if using SSAO, take screen space light map into account as if shadows are enabled
|
||||
|
|
@ -2261,6 +2268,32 @@ BOOL LLViewerShaderMgr::loadShadersDeferred()
|
|||
}
|
||||
// </FS:Ansariel>
|
||||
|
||||
if (success)
|
||||
{
|
||||
gDeferredAvatarAlphaShadowProgram.mName = "Deferred Avatar Alpha Shadow Shader";
|
||||
gDeferredAvatarAlphaShadowProgram.mFeatures.hasSkinning = true;
|
||||
gDeferredAvatarAlphaShadowProgram.mShaderFiles.clear();
|
||||
gDeferredAvatarAlphaShadowProgram.mShaderFiles.push_back(make_pair("deferred/avatarAlphaShadowV.glsl", GL_VERTEX_SHADER_ARB));
|
||||
gDeferredAvatarAlphaShadowProgram.mShaderFiles.push_back(make_pair("deferred/avatarAlphaShadowF.glsl", GL_FRAGMENT_SHADER_ARB));
|
||||
gDeferredAvatarAlphaShadowProgram.addPermutation("DEPTH_CLAMP", gGLManager.mHasDepthClamp ? "1" : "0");
|
||||
gDeferredAvatarAlphaShadowProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED];
|
||||
success = gDeferredAvatarAlphaShadowProgram.createShader(NULL, NULL);
|
||||
llassert(success);
|
||||
}
|
||||
|
||||
if (success)
|
||||
{
|
||||
gDeferredAvatarAlphaMaskShadowProgram.mName = "Deferred Avatar Alpha Mask Shadow Shader";
|
||||
gDeferredAvatarAlphaMaskShadowProgram.mFeatures.hasSkinning = true;
|
||||
gDeferredAvatarAlphaMaskShadowProgram.mShaderFiles.clear();
|
||||
gDeferredAvatarAlphaMaskShadowProgram.mShaderFiles.push_back(make_pair("deferred/avatarAlphaShadowV.glsl", GL_VERTEX_SHADER_ARB));
|
||||
gDeferredAvatarAlphaMaskShadowProgram.mShaderFiles.push_back(make_pair("deferred/avatarAlphaMaskShadowF.glsl", GL_FRAGMENT_SHADER_ARB));
|
||||
gDeferredAvatarAlphaMaskShadowProgram.addPermutation("DEPTH_CLAMP", gGLManager.mHasDepthClamp ? "1" : "0");
|
||||
gDeferredAvatarAlphaMaskShadowProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED];
|
||||
success = gDeferredAvatarAlphaMaskShadowProgram.createShader(NULL, NULL);
|
||||
llassert(success);
|
||||
}
|
||||
|
||||
if (success)
|
||||
{
|
||||
gDeferredAttachmentShadowProgram.mName = "Deferred Attachment Shadow Shader";
|
||||
|
|
@ -2304,6 +2337,32 @@ BOOL LLViewerShaderMgr::loadShadersDeferred()
|
|||
}
|
||||
// </FS:Ansariel>
|
||||
|
||||
if (success)
|
||||
{
|
||||
gDeferredAttachmentAlphaShadowProgram.mName = "Deferred Attachment Alpha Shadow Shader";
|
||||
gDeferredAttachmentAlphaShadowProgram.mFeatures.hasObjectSkinning = true;
|
||||
gDeferredAttachmentAlphaShadowProgram.mShaderFiles.clear();
|
||||
gDeferredAttachmentAlphaShadowProgram.mShaderFiles.push_back(make_pair("deferred/attachmentAlphaShadowV.glsl", GL_VERTEX_SHADER_ARB));
|
||||
gDeferredAttachmentAlphaShadowProgram.mShaderFiles.push_back(make_pair("deferred/attachmentAlphaShadowF.glsl", GL_FRAGMENT_SHADER_ARB));
|
||||
gDeferredAttachmentAlphaShadowProgram.addPermutation("DEPTH_CLAMP", gGLManager.mHasDepthClamp ? "1" : "0");
|
||||
gDeferredAttachmentAlphaShadowProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED];
|
||||
success = gDeferredAttachmentAlphaShadowProgram.createShader(NULL, NULL);
|
||||
llassert(success);
|
||||
}
|
||||
|
||||
if (success)
|
||||
{
|
||||
gDeferredAttachmentAlphaMaskShadowProgram.mName = "Deferred Attachment Alpha Mask Shadow Shader";
|
||||
gDeferredAttachmentAlphaMaskShadowProgram.mFeatures.hasObjectSkinning = true;
|
||||
gDeferredAttachmentAlphaMaskShadowProgram.mShaderFiles.clear();
|
||||
gDeferredAttachmentAlphaMaskShadowProgram.mShaderFiles.push_back(make_pair("deferred/attachmentAlphaShadowV.glsl", GL_VERTEX_SHADER_ARB));
|
||||
gDeferredAttachmentAlphaMaskShadowProgram.mShaderFiles.push_back(make_pair("deferred/attachmentAlphaMaskShadowF.glsl", GL_FRAGMENT_SHADER_ARB));
|
||||
gDeferredAttachmentAlphaMaskShadowProgram.addPermutation("DEPTH_CLAMP", gGLManager.mHasDepthClamp ? "1" : "0");
|
||||
gDeferredAttachmentAlphaMaskShadowProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED];
|
||||
success = gDeferredAttachmentAlphaMaskShadowProgram.createShader(NULL, NULL);
|
||||
llassert(success);
|
||||
}
|
||||
|
||||
if (success)
|
||||
{
|
||||
gDeferredTerrainProgram.mName = "Deferred Terrain Shader";
|
||||
|
|
@ -2349,6 +2408,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred()
|
|||
gDeferredTerrainWaterProgram.mShaderGroup = LLGLSLShader::SG_WATER;
|
||||
gDeferredTerrainWaterProgram.addPermutation("WATER_FOG", "1");
|
||||
success = gDeferredTerrainWaterProgram.createShader(NULL, NULL);
|
||||
llassert(success);
|
||||
}
|
||||
|
||||
if (success)
|
||||
|
|
@ -2535,6 +2595,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred()
|
|||
gDeferredWLMoonProgram.mFeatures.hasTransport = true;
|
||||
gDeferredWLMoonProgram.mFeatures.hasGamma = true;
|
||||
gDeferredWLMoonProgram.mFeatures.hasAtmospherics = true;
|
||||
gDeferredWLMoonProgram.mFeatures.hasSrgb = true;
|
||||
gDeferredWLMoonProgram.mFeatures.isFullbright = true;
|
||||
gDeferredWLMoonProgram.mFeatures.disableTextureIndex = true;
|
||||
|
||||
|
|
@ -2638,6 +2699,7 @@ BOOL LLViewerShaderMgr::loadShadersObject()
|
|||
gObjectSimpleNonIndexedProgram.mFeatures.hasGamma = true;
|
||||
gObjectSimpleNonIndexedProgram.mFeatures.hasAtmospherics = true;
|
||||
gObjectSimpleNonIndexedProgram.mFeatures.hasLighting = true;
|
||||
gObjectSimpleNonIndexedProgram.mFeatures.hasAlphaMask = true; // Fix for MAINT-8836
|
||||
gObjectSimpleNonIndexedProgram.mFeatures.disableTextureIndex = true;
|
||||
gObjectSimpleNonIndexedProgram.mFeatures.hasAlphaMask = true; // <FS:Ansariel> Possible intentional revert in LL-EEP - keeping change from LMR for now
|
||||
gObjectSimpleNonIndexedProgram.mShaderFiles.clear();
|
||||
|
|
|
|||
|
|
@ -2565,10 +2565,7 @@ void LLPipeline::updateCull(LLCamera& camera, LLCullResult& result, S32 water_cl
|
|||
LLVOCachePartition* vo_part = region->getVOCachePartition();
|
||||
if(vo_part)
|
||||
{
|
||||
// <FS:Ansariel> Possible intentional revert in LL-EEP - keeping change from LMR for now
|
||||
//bool do_occlusion_cull = can_use_occlusion && use_occlusion && !gUseWireframe/* && !gViewerWindow->getProgressView()->getVisible()*/;
|
||||
bool do_occlusion_cull = can_use_occlusion && use_occlusion && !gUseWireframe && 0 > water_clip /* && !gViewerWindow->getProgressView()->getVisible()*/;
|
||||
// </FS:Ansariel>
|
||||
vo_part->cull(camera, do_occlusion_cull);
|
||||
}
|
||||
}
|
||||
|
|
@ -4652,6 +4649,7 @@ void LLPipeline::renderGeom(LLCamera& camera, bool forceVBOUpdate)
|
|||
// Render debugging beacons.
|
||||
gObjectList.renderObjectBeacons();
|
||||
gObjectList.resetObjectBeacons();
|
||||
gSky.addSunMoonBeacons();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -6465,7 +6463,7 @@ void LLPipeline::setupHWLights(LLDrawPool* pool)
|
|||
{
|
||||
F32 size = light_radius*1.5f;
|
||||
light_state->setLinearAttenuation(size);
|
||||
light_state->setQuadraticAttenuation(light->getLightFalloff()*0.5f+1.f);
|
||||
light_state->setQuadraticAttenuation(light->getLightFalloff()*0.5f);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -8806,6 +8804,7 @@ void LLPipeline::renderDeferredLighting(LLRenderTarget* screen_target)
|
|||
|
||||
LLEnvironment& environment = LLEnvironment::instance();
|
||||
soften_shader.uniform1i(LLShaderMgr::SUN_UP_FACTOR, environment.getIsSunUp() ? 1 : 0);
|
||||
soften_shader.uniform4fv(LLShaderMgr::LIGHTNORM, 1, environment.getClampedLightNorm().mV);
|
||||
|
||||
{
|
||||
LLGLDepthTest depth(GL_FALSE);
|
||||
|
|
@ -9474,7 +9473,7 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in)
|
|||
S32 occlusion = LLPipeline::sUseOcclusion;
|
||||
|
||||
//disable occlusion culling for reflection map for now
|
||||
//LLPipeline::sUseOcclusion = 0;
|
||||
LLPipeline::sUseOcclusion = 0;
|
||||
|
||||
glh::matrix4f current = get_current_modelview();
|
||||
|
||||
|
|
@ -10480,6 +10479,7 @@ void LLPipeline::generateSunShadow(LLCamera& camera)
|
|||
|
||||
//far_clip = llmin(far_clip, 128.f);
|
||||
far_clip = llmin(far_clip, camera.getFar());
|
||||
far_clip = llmax(far_clip, 256.0f);
|
||||
|
||||
F32 range = far_clip-near_clip;
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,365 @@
|
|||
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
|
||||
<floater layout="topleft"
|
||||
name="env_adjust_snapshot"
|
||||
help_topic="day_presets"
|
||||
save_rect="false"
|
||||
title="Personal Lighting"
|
||||
width="845"
|
||||
height="225"
|
||||
min_width="500"
|
||||
min_height="225"
|
||||
single_instance="true"
|
||||
can_resize="false">
|
||||
<layout_stack name="outer_stack"
|
||||
width="845"
|
||||
height="212"
|
||||
follows="all"
|
||||
animate="false"
|
||||
top="0"
|
||||
orientation="vertical">
|
||||
<!-- If I put in a timeline it would go here -->
|
||||
<layout_panel name="env_controls"
|
||||
border="false"
|
||||
bevel_style="in"
|
||||
auto_resize="true"
|
||||
user_resize="true"
|
||||
height="150"
|
||||
min_height="0"
|
||||
visible="true">
|
||||
<layout_stack name="settings_stack"
|
||||
width="855"
|
||||
height="150"
|
||||
follows="all"
|
||||
animate="false"
|
||||
orientation="horizontal">
|
||||
<layout_panel border="false"
|
||||
bevel_style="in"
|
||||
auto_resize="false"
|
||||
user_resize="false"
|
||||
visible="true"
|
||||
width="160"
|
||||
height="150">
|
||||
<text follows="left|top"
|
||||
height="10"
|
||||
layout="topleft"
|
||||
left="10"
|
||||
top="5"
|
||||
width="80">Ambient:</text>
|
||||
<color_swatch can_apply_immediately="true"
|
||||
follows="left|top"
|
||||
height="37"
|
||||
label_height="0"
|
||||
layout="topleft"
|
||||
left_delta="0"
|
||||
name="ambient_light"
|
||||
top_pad="5"
|
||||
width="60"/>
|
||||
<text follows="left|top"
|
||||
height="10"
|
||||
layout="topleft"
|
||||
left_delta="0"
|
||||
top_pad="10"
|
||||
width="80">Blue Horizon:</text>
|
||||
<color_swatch can_apply_immediately="true"
|
||||
follows="left|top"
|
||||
height="37"
|
||||
label_height="0"
|
||||
layout="topleft"
|
||||
left_delta="0"
|
||||
name="blue_horizon"
|
||||
top_pad="5"
|
||||
width="60"/>
|
||||
<text follows="left|top"
|
||||
height="10"
|
||||
layout="topleft"
|
||||
left_delta="0"
|
||||
top_pad="10"
|
||||
width="80">Blue Density:</text>
|
||||
<color_swatch can_apply_immediately="true"
|
||||
follows="left|top"
|
||||
height="37"
|
||||
label_height="0"
|
||||
layout="topleft"
|
||||
left_delta="0"
|
||||
name="blue_density"
|
||||
top_pad="5"
|
||||
width="60"/>
|
||||
<text follows="right|top"
|
||||
height="10"
|
||||
layout="topleft"
|
||||
right="-10"
|
||||
top="5"
|
||||
width="60">Sun Color:</text>
|
||||
<color_swatch can_apply_immediately="true"
|
||||
follows="left|top"
|
||||
height="37"
|
||||
label_height="0"
|
||||
layout="topleft"
|
||||
left_delta="0"
|
||||
name="sun_color"
|
||||
top_pad="5"
|
||||
width="60"/>
|
||||
<text follows="left|top"
|
||||
height="10"
|
||||
layout="topleft"
|
||||
left_delta="0"
|
||||
top_pad="10"
|
||||
width="80">Cloud Color:</text>
|
||||
<color_swatch can_apply_immediately="true"
|
||||
follows="left|top"
|
||||
height="37"
|
||||
label_height="0"
|
||||
layout="topleft"
|
||||
left_delta="0"
|
||||
name="cloud_color"
|
||||
top_pad="5"
|
||||
width="60"/>
|
||||
</layout_panel>
|
||||
<layout_panel border="false"
|
||||
bevel_style="in"
|
||||
auto_resize="false"
|
||||
user_resize="false"
|
||||
visible="true"
|
||||
width="200"
|
||||
height="150">
|
||||
<text follows="left|top"
|
||||
height="10"
|
||||
layout="topleft"
|
||||
left_delta="5"
|
||||
top_pad="5"
|
||||
width="80">Haze Horizon:</text>
|
||||
<slider decimal_digits="2"
|
||||
follows="left|top"
|
||||
height="16"
|
||||
increment="0.01"
|
||||
initial_value="0"
|
||||
layout="topleft"
|
||||
left_delta="5"
|
||||
min_val="0"
|
||||
max_val="5"
|
||||
name="haze_horizon"
|
||||
top_pad="5"
|
||||
width="185"
|
||||
can_edit_text="true"/>
|
||||
<text follows="left|top"
|
||||
height="10"
|
||||
layout="topleft"
|
||||
left_delta="-5"
|
||||
top_pad="5"
|
||||
width="80">Haze Density:</text>
|
||||
<slider decimal_digits="2"
|
||||
follows="left|top"
|
||||
height="16"
|
||||
increment="0.01"
|
||||
initial_value="0"
|
||||
layout="topleft"
|
||||
left_delta="5"
|
||||
min_val="0"
|
||||
max_val="5"
|
||||
name="haze_density"
|
||||
top_pad="5"
|
||||
width="185"
|
||||
can_edit_text="true"/>
|
||||
<text follows="left|top"
|
||||
height="10"
|
||||
layout="topleft"
|
||||
left_delta="-5"
|
||||
top_pad="5"
|
||||
width="185">Cloud Coverage:</text>
|
||||
<slider decimal_digits="2"
|
||||
follows="left|top"
|
||||
height="16"
|
||||
increment="0.01"
|
||||
initial_value="0"
|
||||
layout="topleft"
|
||||
left_delta="5"
|
||||
min_val="0"
|
||||
max_val="1"
|
||||
name="cloud_coverage"
|
||||
top_pad="5"
|
||||
width="185"
|
||||
can_edit_text="true"/>
|
||||
<text follows="left|top"
|
||||
height="10"
|
||||
layout="topleft"
|
||||
left_delta="-5"
|
||||
top_pad="5"
|
||||
width="185">Cloud Scale:</text>
|
||||
<slider decimal_digits="2"
|
||||
follows="left|top"
|
||||
height="16"
|
||||
increment="0.01"
|
||||
initial_value="0"
|
||||
layout="topleft"
|
||||
left_delta="5"
|
||||
min_val="0.01"
|
||||
max_val="3"
|
||||
name="cloud_scale"
|
||||
top_pad="5"
|
||||
width="185"
|
||||
can_edit_text="true"/>
|
||||
<text follows="left|top"
|
||||
height="10"
|
||||
layout="topleft"
|
||||
left_delta="-5"
|
||||
top_pad="15"
|
||||
width="80">Scene Gamma:</text>
|
||||
<slider decimal_digits="2"
|
||||
follows="left|top"
|
||||
height="16"
|
||||
increment="0.01"
|
||||
initial_value="0"
|
||||
layout="topleft"
|
||||
left_delta="5"
|
||||
max_val="20"
|
||||
name="scene_gamma"
|
||||
top_pad="5"
|
||||
width="185"
|
||||
can_edit_text="true"/>
|
||||
</layout_panel>
|
||||
<layout_panel border="false"
|
||||
bevel_style="in"
|
||||
auto_resize="false"
|
||||
user_resize="false"
|
||||
height="150"
|
||||
width="310"
|
||||
min_height="0"
|
||||
visible="true">
|
||||
<text follows="top|left"
|
||||
font="SansSerifBold"
|
||||
height="10"
|
||||
layout="topleft"
|
||||
name="label"
|
||||
left="5"
|
||||
top="5"
|
||||
width="105">Sun:</text>
|
||||
<sun_moon_trackball name="sun_rotation"
|
||||
follows="left|top"
|
||||
left_delta="0"
|
||||
top_delta="20"
|
||||
height="150"
|
||||
width="150"
|
||||
thumb_mode="sun"/>
|
||||
<check_box control_name="sunbeacon"
|
||||
width="60"
|
||||
height="16"
|
||||
label="Show Beacon"
|
||||
layout="topleft"
|
||||
name="sunbeacon"
|
||||
left_delta="55"
|
||||
bottom="-10"
|
||||
follows="bottom|right"/>
|
||||
<text follows="left|top"
|
||||
height="10"
|
||||
layout="topleft"
|
||||
left_pad="40"
|
||||
top="25"
|
||||
width="80">Scale:</text>
|
||||
<slider decimal_digits="2"
|
||||
follows="left|top"
|
||||
height="16"
|
||||
increment="0.01"
|
||||
initial_value="0"
|
||||
layout="topleft"
|
||||
left_delta="5"
|
||||
min_val="0.25"
|
||||
max_val="20"
|
||||
name="sun_scale"
|
||||
top_delta="15"
|
||||
width="130"
|
||||
can_edit_text="true"/>
|
||||
<text follows="left|top"
|
||||
height="10"
|
||||
layout="topleft"
|
||||
left_delta="-5"
|
||||
top_pad="5"
|
||||
width="100">Glow Focus:</text>
|
||||
<slider decimal_digits="2"
|
||||
follows="left|top"
|
||||
height="16"
|
||||
increment="0.01"
|
||||
initial_value="0"
|
||||
layout="topleft"
|
||||
left_delta="5"
|
||||
min_val="-2"
|
||||
max_val="2"
|
||||
name="glow_focus"
|
||||
top_pad="5"
|
||||
width="130"
|
||||
can_edit_text="true"/>
|
||||
<text follows="left|top"
|
||||
height="10"
|
||||
layout="topleft"
|
||||
left_delta="-5"
|
||||
top_pad="5"
|
||||
width="200">Glow Size:</text>
|
||||
<slider decimal_digits="2"
|
||||
follows="left|top"
|
||||
height="16"
|
||||
increment="0.01"
|
||||
initial_value="0"
|
||||
layout="topleft"
|
||||
left_delta="5"
|
||||
min_val="0"
|
||||
max_val="1.99"
|
||||
name="glow_size"
|
||||
top_pad="5"
|
||||
width="130"
|
||||
can_edit_text="true"/>
|
||||
<text follows="left|top"
|
||||
height="10"
|
||||
layout="topleft"
|
||||
left_delta="-5"
|
||||
top_pad="10"
|
||||
width="200">Star Brightness:</text>
|
||||
<slider decimal_digits="2"
|
||||
follows="left|top"
|
||||
height="16"
|
||||
increment="0.01"
|
||||
initial_value="0"
|
||||
layout="topleft"
|
||||
left_delta="5"
|
||||
min_val="0"
|
||||
max_val="500"
|
||||
name="star_brightness"
|
||||
top_pad="5"
|
||||
width="130"
|
||||
can_edit_text="true"/>
|
||||
</layout_panel>
|
||||
<layout_panel border="false"
|
||||
bevel_style="in"
|
||||
auto_resize="false"
|
||||
user_resize="false"
|
||||
height="150"
|
||||
width="160"
|
||||
min_height="0"
|
||||
visible="true">
|
||||
<text follows="top|left"
|
||||
font="SansSerifBold"
|
||||
height="10"
|
||||
layout="topleft"
|
||||
name="label"
|
||||
left="5"
|
||||
top="5"
|
||||
width="105">Moon:</text>
|
||||
<sun_moon_trackball name="moon_rotation"
|
||||
follows="left|top"
|
||||
left_delta="0"
|
||||
top_delta="20"
|
||||
height="150"
|
||||
width="150"
|
||||
thumb_mode="moon"/>
|
||||
<check_box control_name="moonbeacon"
|
||||
width="60"
|
||||
height="16"
|
||||
label="Show Beacon"
|
||||
layout="topleft"
|
||||
name="moonbeacon"
|
||||
right="-50"
|
||||
bottom="-10"
|
||||
follows="bottom|right"/>
|
||||
</layout_panel>
|
||||
</layout_stack>
|
||||
</layout_panel>
|
||||
</layout_stack>
|
||||
</floater>
|
||||
|
|
@ -114,22 +114,6 @@
|
|||
filter_asset_type="settings"/>
|
||||
</panel>
|
||||
</layout_panel>
|
||||
<layout_panel
|
||||
auto_resize="false"
|
||||
user_resize="false"
|
||||
tab_group="1"
|
||||
height="14">
|
||||
<check_box
|
||||
follows="left|bottom"
|
||||
height="14"
|
||||
initial_value="false"
|
||||
label="Show Empty Folders"
|
||||
layout="topleft"
|
||||
name="chk_showfolders"
|
||||
top="2"
|
||||
left_delta="-1"
|
||||
width="200" />
|
||||
</layout_panel>
|
||||
<layout_panel
|
||||
auto_resize="false"
|
||||
user_resize="true"
|
||||
|
|
|
|||
|
|
@ -1083,6 +1083,13 @@
|
|||
function="World.EnvSettings"
|
||||
parameter="my_environs" />
|
||||
</menu_item_call>
|
||||
<menu_item_call
|
||||
label="Personal Lighting..."
|
||||
name="adjustment_tool">
|
||||
<menu_item_call.on_click
|
||||
function="World.EnvSettings"
|
||||
parameter="adjust_tool" />
|
||||
</menu_item_call>
|
||||
<menu_item_separator/>
|
||||
<menu_item_check
|
||||
label="Pause Clouds"
|
||||
|
|
|
|||
Loading…
Reference in New Issue