#include <llwlparammanager.h>
Public Member Functions | |
LLWLParamManager () | |
~LLWLParamManager () | |
void | loadPresets (const LLString &fileName) |
load a preset file | |
void | savePresets (const LLString &fileName) |
save the preset file | |
void | loadPreset (const LLString &name) |
load an individual preset into the sky | |
void | savePreset (const LLString &name) |
save the parameter presets to file | |
void | propagateParameters (void) |
Set shader uniforms dirty, so they'll update automatically. | |
void | updateShaderUniforms (LLGLSLShader *shader) |
Update shader uniforms that have changed. | |
void | resetAnimator (F32 curTime, bool run) |
setup the animator to run | |
void | update (LLViewerCamera *cam) |
update information camera dependent parameters | |
LLVector4 | getLightDir (void) const |
LLVector4 | getClampedLightDir (void) const |
LLVector4 | getRotatedLightDir (void) const |
F32 | getDomeOffset (void) const |
get the dome's offset | |
F32 | getDomeRadius (void) const |
get the radius of the dome | |
bool | addParamSet (const std::string &name, LLWLParamSet ¶m) |
add a param to the list | |
BOOL | addParamSet (const std::string &name, LLSD const ¶m) |
add a param to the list | |
bool | getParamSet (const std::string &name, LLWLParamSet ¶m) |
get a param from the list | |
bool | setParamSet (const std::string &name, LLWLParamSet ¶m) |
set the param in the list with a new param | |
bool | setParamSet (const std::string &name, LLSD const ¶m) |
set the param in the list with a new param | |
bool | removeParamSet (const std::string &name, bool delete_from_disk) |
Static Public Member Functions | |
static void | initClass (void) |
Perform global initialization for this class. | |
static void | cleanupClass () |
static LLWLParamManager * | instance () |
Public Attributes | |
LLWLAnimator | mAnimator |
LLVector4 | mLightDir |
actual direction of the sun | |
LLVector4 | mRotatedLightDir |
light norm adjusted so haze works correctly | |
LLVector4 | mClampedLightDir |
LLWLDayCycle | mDay |
LLWLParamSet | mCurParams |
F32 | mSunDeltaYaw |
Sun Delta Terrain tweak variables. | |
WLFloatControl | mWLGamma |
F32 | mSceneLightStrength |
WLColorControl | mBlueHorizon |
Atmospherics. | |
WLColorControl | mHazeDensity |
WLColorControl | mBlueDensity |
WLFloatControl | mDensityMult |
WLColorControl | mHazeHorizon |
WLFloatControl | mMaxAlt |
WLColorControl | mLightnorm |
Lighting. | |
WLColorControl | mSunlight |
WLColorControl | mAmbient |
WLColorControl | mGlow |
WLColorControl | mCloudColor |
Clouds. | |
WLColorControl | mCloudMain |
WLFloatControl | mCloudCoverage |
WLColorControl | mCloudDetail |
WLFloatControl | mDistanceMult |
WLFloatControl | mCloudScale |
F32 | mDomeOffset |
sky dome | |
F32 | mDomeRadius |
std::map< std::string, LLWLParamSet > | mParamList |
Static Private Attributes | |
static LLWLParamManager * | sInstance = NULL |
Definition at line 124 of file llwlparammanager.h.
LLWLParamManager::LLWLParamManager | ( | ) |
Definition at line 66 of file llwlparammanager.cpp.
Referenced by instance().
LLWLParamManager::~LLWLParamManager | ( | ) |
Definition at line 103 of file llwlparammanager.cpp.
void LLWLParamManager::loadPresets | ( | const LLString & | fileName | ) |
load a preset file
Definition at line 107 of file llwlparammanager.cpp.
References addParamSet(), LLSD::beginMap(), LLSD::emptyMap(), LLSD::endMap(), gDirUtilp, LLDir::getExpandedFilename(), LLDir::getNextFileInDir(), LL_DEBUGS2, LL_ENDL, LL_INFOS2, LL_PATH_APP_SETTINGS, llifstream, NULL, and LLSDSerialize::SIZE_UNLIMITED.
Referenced by instance().
void LLWLParamManager::savePresets | ( | const LLString & | fileName | ) |
save the preset file
Definition at line 181 of file llwlparammanager.cpp.
References LLSD::emptyMap(), gDirUtilp, LLDir::getExpandedFilename(), LL_PATH_APP_SETTINGS, mParamList, and LLSDFormatter::OPTIONS_PRETTY.
void LLWLParamManager::loadPreset | ( | const LLString & | name | ) |
load an individual preset into the sky
Definition at line 203 of file llwlparammanager.cpp.
References addParamSet(), LLSD::emptyMap(), gDirUtilp, LLDir::getExpandedFilename(), getParamSet(), LL_PATH_APP_SETTINGS, llendl, llinfos, llwarns, mCurParams, mParamList, NULL, propagateParameters(), setParamSet(), and LLSDSerialize::SIZE_UNLIMITED.
Referenced by LLFloaterWindLight::onChangePresetName().
void LLWLParamManager::savePreset | ( | const LLString & | name | ) |
save the parameter presets to file
Definition at line 247 of file llwlparammanager.cpp.
References LLSD::emptyMap(), gDirUtilp, LLDir::getExpandedFilename(), LL_PATH_APP_SETTINGS, mParamList, NULL, LLSDFormatter::OPTIONS_PRETTY, and propagateParameters().
Referenced by LLFloaterWindLight::newPromptCallback(), and LLFloaterWindLight::saveAlertCallback().
void LLWLParamManager::propagateParameters | ( | void | ) |
Set shader uniforms dirty, so they'll update automatically.
Definition at line 295 of file llwlparammanager.cpp.
References LLShaderMgr::beginShaders(), LLPipeline::canUseWindLightShaders(), LLShaderMgr::endShaders(), LLFastTimer::FTM_UPDATE_WLPARAM, LLWLParamSet::getEastAngle(), LLWLParamSet::getSunAngle(), gPipeline, gSky, mClampedLightDir, mCurParams, mLightDir, LLVector3::mV, LLVector4::mV, NIGHTTIME_ELEVATION_COS, LLVector3::normVec(), LLWLParamSet::set(), LLSky::setOverrideSun(), LLSky::setSunDirection(), LLGLSLShader::SG_WATER, and TRUE.
Referenced by LLDrawPoolWLSky::LLDrawPoolWLSky(), loadPreset(), LLFloaterWindLight::onColorControlBMoved(), LLFloaterWindLight::onColorControlGMoved(), LLFloaterWindLight::onColorControlIMoved(), LLFloaterWindLight::onColorControlRMoved(), LLFloaterWindLight::onFloatControlMoved(), LLFloaterWindLight::onFloatTweakMoved(), LLFloaterWindLight::onGlowBMoved(), LLFloaterWindLight::onGlowRMoved(), LLFloaterWindLight::onSunMoved(), savePreset(), and update().
void LLWLParamManager::updateShaderUniforms | ( | LLGLSLShader * | shader | ) |
Update shader uniforms that have changed.
Definition at line 273 of file llwlparammanager.cpp.
References LLPipeline::canUseWindLightShaders(), LLSingleton< LLViewerCamera >::getInstance(), gPipeline, LLShaderMgr::LIGHTNORM, mClampedLightDir, mCurParams, mRotatedLightDir, mSceneLightStrength, LLGLSLShader::mShaderGroup, LLVector4::mV, LLGLSLShader::SG_DEFAULT, LLGLSLShader::SG_SKY, LLGLSLShader::uniform1f(), LLGLSLShader::uniform3fv(), LLGLSLShader::uniform4fv(), and LLWLParamSet::update().
Referenced by LLGLSLShader::bind().
void LLWLParamManager::resetAnimator | ( | F32 | curTime, | |
bool | run | |||
) |
setup the animator to run
Definition at line 436 of file llwlparammanager.cpp.
References mAnimator, mDay, LLWLDayCycle::mDayRate, LLWLDayCycle::mTimeMap, and LLWLAnimator::setTrack().
Referenced by instance(), LLFloaterDayCycle::onLoadDayCycle(), LLFloaterDayCycle::onRunAnimSky(), and LLFloaterDayCycle::syncTrack().
void LLWLParamManager::update | ( | LLViewerCamera * | cam | ) |
update information camera dependent parameters
Definition at line 366 of file llwlparammanager.cpp.
References LLShaderMgr::beginShaders(), LLPipeline::canUseWindLightShaders(), DEG_TO_RAD, LLShaderMgr::endShaders(), LLFastTimer::FTM_UPDATE_WLPARAM, LLCamera::getYaw(), gPipeline, LLFloaterEnvSettings::instance(), LLFloaterDayCycle::instance(), LLFloaterWindLight::instance(), LLFloaterEnvSettings::isOpen(), LLFloaterDayCycle::isOpen(), LLFloaterWindLight::isOpen(), mAnimator, mCurParams, LLWLAnimator::mIsRunning, mLightDir, mRotatedLightDir, mSunDeltaYaw, propagateParameters(), LLGLSLShader::SG_WATER, stop_glerror, LLFloaterEnvSettings::syncMenu(), LLFloaterDayCycle::syncMenu(), LLFloaterWindLight::syncMenu(), TRUE, LLWLAnimator::update(), and LLWLParamSet::updateCloudScrolling().
Referenced by display_update_camera().
LLVector4 LLWLParamManager::getLightDir | ( | void | ) | const [inline] |
LLVector4 LLWLParamManager::getClampedLightDir | ( | void | ) | const [inline] |
LLVector4 LLWLParamManager::getRotatedLightDir | ( | void | ) | const [inline] |
F32 LLWLParamManager::getDomeOffset | ( | void | ) | const [inline] |
get the dome's offset
Definition at line 262 of file llwlparammanager.h.
References mDomeOffset.
Referenced by LLVOSky::initAtmospherics(), and LLDrawPoolWLSky::render().
F32 LLWLParamManager::getDomeRadius | ( | void | ) | const [inline] |
get the radius of the dome
Definition at line 267 of file llwlparammanager.h.
References mDomeRadius.
Referenced by LLVOWLSky::buildFanBuffer(), LLVOWLSky::buildStripsBuffer(), LLVOSky::initAtmospherics(), and LLDrawPoolWLSky::render().
void LLWLParamManager::initClass | ( | void | ) | [static] |
Perform global initialization for this class.
Definition at line 424 of file llwlparammanager.cpp.
References instance().
Referenced by idle_startup().
void LLWLParamManager::cleanupClass | ( | void | ) | [static] |
Definition at line 430 of file llwlparammanager.cpp.
References NULL, and sInstance.
Referenced by LLAppViewer::cleanup().
bool LLWLParamManager::addParamSet | ( | const std::string & | name, | |
LLWLParamSet & | param | |||
) |
add a param to the list
Definition at line 443 of file llwlparammanager.cpp.
References mParamList.
Referenced by loadPreset(), loadPresets(), and LLFloaterWindLight::newPromptCallback().
add a param to the list
Definition at line 456 of file llwlparammanager.cpp.
References FALSE, mParamList, and TRUE.
bool LLWLParamManager::getParamSet | ( | const std::string & | name, | |
LLWLParamSet & | param | |||
) |
get a param from the list
Definition at line 471 of file llwlparammanager.cpp.
References LLWLParamSet::mName, and mParamList.
Referenced by LLWLDayCycle::changeKeyParam(), LLWLDayCycle::getKeyedParam(), instance(), LLWLDayCycle::loadDayCycle(), and loadPreset().
bool LLWLParamManager::setParamSet | ( | const std::string & | name, | |
LLWLParamSet & | param | |||
) |
set the param in the list with a new param
Definition at line 485 of file llwlparammanager.cpp.
References mParamList.
Referenced by loadPreset(), and LLFloaterWindLight::saveAlertCallback().
bool LLWLParamManager::setParamSet | ( | const std::string & | name, | |
LLSD const & | param | |||
) |
set the param in the list with a new param
Definition at line 492 of file llwlparammanager.cpp.
References LLSD::isMap(), and mParamList.
bool LLWLParamManager::removeParamSet | ( | const std::string & | name, | |
bool | delete_from_disk | |||
) |
gets rid of a parameter and any references to it returns true if successful
Definition at line 505 of file llwlparammanager.cpp.
References LLDir::deleteFilesInDir(), gDirUtilp, LLDir::getExpandedFilename(), LLWLDayCycle::getKey(), LL_PATH_APP_SETTINGS, mDay, mParamList, NULL, and LLWLDayCycle::removeKey().
Referenced by LLFloaterWindLight::deleteAlertCallback().
LLWLParamManager * LLWLParamManager::instance | ( | void | ) | [static] |
Definition at line 550 of file llwlparammanager.cpp.
References getParamSet(), LLWLParamManager(), LLWLDayCycle::loadDayCycle(), loadPresets(), mAnimator, mCurParams, mDay, LLWLAnimator::mUseLindenTime, NULL, resetAnimator(), and sInstance.
Referenced by LLGLSLShader::bind(), LLVOWLSky::buildFanBuffer(), LLVOWLSky::buildStripsBuffer(), LLVOSky::calcAtmospherics(), LLWLDayCycle::changeKeyParam(), LLFloaterWindLight::deactivateAnimator(), LLFloaterWindLight::deleteAlertCallback(), display_update_camera(), LLWLDayCycle::getKeyedParam(), LLWorldEnvSettings::handleEvent(), LLVOSky::initAtmospherics(), LLFloaterWindLight::initCallbacks(), initClass(), LLDrawPoolWLSky::LLDrawPoolWLSky(), LLFloaterDayCycle::LLFloaterDayCycle(), LLFloaterWindLight::LLFloaterWindLight(), LLVOSky::LLVOSky(), LLWLDayCycle::loadDayCycle(), LLFloaterWindLight::newPromptCallback(), LLFloaterEnvSettings::onChangeCloudCoverage(), LLFloaterEnvSettings::onChangeDayTime(), LLFloaterWindLight::onChangePresetName(), LLFloaterWindLight::onCloudScrollXMoved(), LLFloaterWindLight::onCloudScrollXToggled(), LLFloaterWindLight::onCloudScrollYMoved(), LLFloaterWindLight::onCloudScrollYToggled(), LLFloaterWindLight::onColorControlBMoved(), LLFloaterWindLight::onColorControlGMoved(), LLFloaterWindLight::onColorControlIMoved(), LLFloaterWindLight::onColorControlRMoved(), LLFloaterWindLight::onFloatControlMoved(), LLFloaterWindLight::onFloatTweakMoved(), LLFloaterWindLight::onGlowBMoved(), LLFloaterWindLight::onGlowRMoved(), LLFloaterDayCycle::onLoadDayCycle(), LLFloaterDayCycle::onRunAnimSky(), LLFloaterDayCycle::onSaveDayCycle(), LLFloaterWindLight::onSavePreset(), LLFloaterWindLight::onStarAlphaMoved(), LLFloaterDayCycle::onStopAnimSky(), LLFloaterWindLight::onSunMoved(), LLFloaterDayCycle::onTimeRateChanged(), LLFloaterDayCycle::onTimeSliderMoved(), LLFloaterEnvSettings::onUseEstateTime(), LLFloaterDayCycle::onUseLindenTime(), LLDrawPoolWLSky::render(), LLDrawPoolWLSky::renderStars(), LLFloaterWindLight::saveAlertCallback(), LLFloaterWindLight::syncMenu(), LLFloaterEnvSettings::syncMenu(), LLFloaterDayCycle::syncMenu(), LLFloaterDayCycle::syncSliderTrack(), LLFloaterDayCycle::syncTrack(), LLWLAnimator::update(), and LLWaterParamManager::updateShaderUniforms().
Definition at line 202 of file llwlparammanager.h.
Referenced by LLFloaterWindLight::deactivateAnimator(), LLWorldEnvSettings::handleEvent(), instance(), LLFloaterEnvSettings::onChangeDayTime(), LLFloaterDayCycle::onLoadDayCycle(), LLFloaterDayCycle::onRunAnimSky(), LLFloaterDayCycle::onStopAnimSky(), LLFloaterDayCycle::onTimeSliderMoved(), LLFloaterEnvSettings::onUseEstateTime(), LLFloaterDayCycle::onUseLindenTime(), resetAnimator(), LLFloaterEnvSettings::syncMenu(), LLFloaterDayCycle::syncTrack(), and update().
actual direction of the sun
Definition at line 205 of file llwlparammanager.h.
Referenced by getLightDir(), propagateParameters(), and update().
light norm adjusted so haze works correctly
Definition at line 208 of file llwlparammanager.h.
Referenced by getRotatedLightDir(), update(), and updateShaderUniforms().
clamped light norm for shaders that are adversely affected when the sun goes below the horizon
Definition at line 213 of file llwlparammanager.h.
Referenced by getClampedLightDir(), propagateParameters(), and updateShaderUniforms().
Definition at line 216 of file llwlparammanager.h.
Referenced by instance(), LLFloaterDayCycle::onLoadDayCycle(), LLFloaterDayCycle::onSaveDayCycle(), LLFloaterDayCycle::onTimeRateChanged(), removeParamSet(), resetAnimator(), LLFloaterDayCycle::syncMenu(), LLFloaterDayCycle::syncSliderTrack(), and LLFloaterDayCycle::syncTrack().
Definition at line 218 of file llwlparammanager.h.
Referenced by LLVOSky::initAtmospherics(), instance(), loadPreset(), LLFloaterWindLight::newPromptCallback(), LLFloaterEnvSettings::onChangeCloudCoverage(), LLFloaterWindLight::onCloudScrollXMoved(), LLFloaterWindLight::onCloudScrollXToggled(), LLFloaterWindLight::onCloudScrollYMoved(), LLFloaterWindLight::onCloudScrollYToggled(), LLFloaterWindLight::onSavePreset(), LLFloaterWindLight::onStarAlphaMoved(), LLFloaterWindLight::onSunMoved(), propagateParameters(), LLDrawPoolWLSky::renderStars(), LLFloaterWindLight::saveAlertCallback(), LLFloaterWindLight::syncMenu(), update(), and updateShaderUniforms().
Sun Delta Terrain tweak variables.
Definition at line 221 of file llwlparammanager.h.
Referenced by update().
Definition at line 222 of file llwlparammanager.h.
Referenced by LLFloaterWindLight::initCallbacks(), and LLFloaterWindLight::syncMenu().
Definition at line 224 of file llwlparammanager.h.
Referenced by LLVOSky::calcAtmospherics(), and updateShaderUniforms().
Atmospherics.
Definition at line 227 of file llwlparammanager.h.
Referenced by LLFloaterWindLight::initCallbacks(), and LLFloaterWindLight::syncMenu().
Definition at line 228 of file llwlparammanager.h.
Referenced by LLFloaterWindLight::initCallbacks(), and LLFloaterWindLight::syncMenu().
Definition at line 229 of file llwlparammanager.h.
Referenced by LLFloaterWindLight::initCallbacks(), and LLFloaterWindLight::syncMenu().
Definition at line 230 of file llwlparammanager.h.
Referenced by LLFloaterWindLight::initCallbacks(), and LLFloaterWindLight::syncMenu().
Definition at line 231 of file llwlparammanager.h.
Referenced by LLFloaterWindLight::initCallbacks(), and LLFloaterWindLight::syncMenu().
Definition at line 232 of file llwlparammanager.h.
Referenced by LLFloaterWindLight::initCallbacks(), and LLFloaterWindLight::syncMenu().
Lighting.
Definition at line 235 of file llwlparammanager.h.
Referenced by LLFloaterWindLight::initCallbacks().
Definition at line 236 of file llwlparammanager.h.
Referenced by LLFloaterWindLight::initCallbacks(), and LLFloaterWindLight::syncMenu().
Definition at line 237 of file llwlparammanager.h.
Referenced by LLFloaterWindLight::initCallbacks(), and LLFloaterWindLight::syncMenu().
Definition at line 238 of file llwlparammanager.h.
Referenced by LLFloaterWindLight::initCallbacks(), and LLFloaterWindLight::syncMenu().
Clouds.
Definition at line 241 of file llwlparammanager.h.
Referenced by LLFloaterWindLight::initCallbacks(), and LLFloaterWindLight::syncMenu().
Definition at line 242 of file llwlparammanager.h.
Referenced by LLFloaterWindLight::initCallbacks(), and LLFloaterWindLight::syncMenu().
Definition at line 243 of file llwlparammanager.h.
Referenced by LLFloaterWindLight::initCallbacks(), and LLFloaterWindLight::syncMenu().
Definition at line 244 of file llwlparammanager.h.
Referenced by LLFloaterWindLight::initCallbacks(), and LLFloaterWindLight::syncMenu().
Definition at line 245 of file llwlparammanager.h.
Referenced by LLFloaterWindLight::initCallbacks(), and LLFloaterWindLight::syncMenu().
Definition at line 246 of file llwlparammanager.h.
Referenced by LLFloaterWindLight::initCallbacks(), and LLFloaterWindLight::syncMenu().
std::map<std::string, LLWLParamSet> LLWLParamManager::mParamList |
Definition at line 253 of file llwlparammanager.h.
Referenced by addParamSet(), getParamSet(), LLFloaterDayCycle::LLFloaterDayCycle(), LLFloaterWindLight::LLFloaterWindLight(), loadPreset(), LLFloaterWindLight::newPromptCallback(), removeParamSet(), savePreset(), savePresets(), setParamSet(), and LLWLAnimator::update().
LLWLParamManager * LLWLParamManager::sInstance = NULL [static, private] |